Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

INSERT LISP - sub folders?

Status
Not open for further replies.

danielhyde

Civil/Environmental
Feb 7, 2003
23
GB
Hi,
We currently have a LISP routine that inserts our OS-map drawing tiles - It works by us clicking on screen the area where we want the mapping (coordinates) and it then inserts the correct one.
However it only works from one Folder, so is there a way to make it search through multiple folders (basically we want to split up the mapping in to sub-directorary's)
Any help would be great either in altering our current lisp, or a new one, or if there is another way such as VBA.
(Can email current lisp if required)

Thanks

 
Replies continue below

Recommended for you

Are you looking to browse for a certain file to get it to insert?

"Whether you think that you can, or that you can't, you are usually right "
.. Henry Ford
 
Hi borgunit,
No - I want the lisp routine to search through a number of folders and find the correct block to insert (by name).
Hope that makes it a bit clearer.
 
If all of the folders are in your search path, Autocad will automatically do the search.
 
Not all the folders are in the search paths as there are quite alot of folders (20+) and it I put them all in the search path it would then make autoCad run slower.
 
There are a couple ways to do it. If the files will always be in these certain folders, you can do a FILEFIND lisp call i.e. (findfile "c:\program files\acad2000\some folder\somedwg.dwg"). You could do this for any number of folders. If the folder names can change and you want to do a recursive search then.



"Whether you think that you can, or that you can't, you are usually right "
.. Henry Ford
 
Oops, cut myself off. Try this...


(setq FileToFind "Drawing1.dwg"
StartDir "C:/Program Files/ACAD2000"
)
(setq WheresTheFile(acet-file-dir FileToFind 0 StartDir))

"Whether you think that you can, or that you can't, you are usually right "
.. Henry Ford
 
Hi Borgunit,

Your second idea seems to be what I am looking for, but it does not work (acet-file-dir is unknown) - I guess I have the wrong version of expressTools. Anyway is there another to do a recursive search?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top