Message 1 of 4
Lisp - Is it possible to "paste a path" instead of clicking on folders ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi, sorry if it's a stupid question, I searched but I don't really know what words to look for.
A long time ago I found a lisp online that sets a certain layer to "no plot".
It works like a charm, but to select the folder where the drawings are, I need to click on a lot of folders.
Here is an example (and I haven't reached the right folder yet) :
I would like to know if there's a way to get a box where I could paste the path instead of clicking all the folders ?
Does it exist ?
I don't really know Lisp.
I tried to make some many years ago but didn't touch it since then.
Here is the Lisp :
;|function to to set a specific layer to NoPlot in the drawings of a
specified folder
by Jeff Mishler May 19, 2006 .... will not affect any drawings that do not
have the layer|;
(defun setlay2noplot (lyrname / *acad dwgs f folder odbx)
;;as posted the autodesk discussion customization group by Tony Tanzillo
(defun BrowseForFolder (title / sh folder parentfolder folderobject
result)
(vl-load-com)
(setq sh
(vla-getInterfaceObject
(vlax-get-acad-object)
"Shell.Application"
)
)
(setq folder
(vlax-invoke-method
sh 'BrowseForFolder 0 title 0)
)
(vlax-release-object sh)
(if folder
(progn
(setq parentfolder
(vlax-get-property folder 'ParentFolder)
)
(setq FolderObject
(vlax-invoke-method
ParentFolder
'ParseName
(vlax-get-property Folder 'Title)
)
)
(setq result
(vlax-get-property FolderObject 'Path)
)
(mapcar 'vlax-release-object
(list folder parentfolder folderobject)
)
result
)
)
)
(defun getdwglist (folderlist)
(apply 'append
(mapcar '(lambda (f)
(mapcar '(lambda (name)
(strcat f "\\" name)
)
(vl-directory-files f "*.dwg" 1)
)
)
folderlist
)
)
)
(if (and (setq *acad (vlax-get-acad-object))
(setq folder (browseforfolder "Folder to modify drawings from"))
(setq dwgs (getdwglist (list folder)))
)
(progn
(setq
odbx (if (< (atoi (setq verno (substr (getvar "acadver") 1 2))) 16)
(vla-GetInterfaceObject *acad "ObjectDBX.AxDbDocument")
(vla-GetInterfaceObject
*acad
(strcat "ObjectDBX.AxDbDocument." verno)
)
)
)
(foreach dwg dwgs
(and
(not (vl-catch-all-error-p
(vl-catch-all-apply
'(lambda ()
(vla-open odbx dwg)
)
)
)
)
(not
(vl-catch-all-error-p
(vl-catch-all-apply
'(lambda ()
(setq lyr (vla-item (vla-get-layers odbx) lyrname))
(vla-put-plottable lyr :vlax-false)
(vla-saveas odbx dwg)
)
)
)
)
)
)
(mapcar 'vlax-release-object (list odbx *acad))
)
)
)
(defun c:setnoplot ()
(setlay2noplot "QUESTIONS");;provide the layer name to set to no-plot here
(princ)
)
Thank you!