Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Do Lisp action upon opening file...

2 REPLIES 2
Reply
Message 1 of 3
martjan
265 Views, 2 Replies

Do Lisp action upon opening file...

I want to do some lisp actions upon opening file but I do not want to do this if this file contains authoring elements.



So something like an IF,



IF file containts authoring elements,

do nothing.

else do lisp actions.





PS a file with authoring elements is a wblocked dynamic block.



Regards Martjan.
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: martjan

what is an Authoring element?





"najtram" wrote in message news:6079630@discussion.autodesk.com...
I want to do some lisp actions upon opening file but I do not want to do
this if this file contains authoring elements.



So something like an IF,



IF file containts authoring elements,

do nothing.

else do lisp actions.





PS a file with authoring elements is a wblocked dynamic block.



Regards Martjan.
Message 3 of 3
scottbolton
in reply to: martjan

M,

Place your code, or a call to the code, in your Program Files\AutoCAD 2009\support\acaddoc2009.lsp. This will then run every time a drawing is opened.

Regarding your IF statement you'll need to get the block list either by vl- methods or an (ssget "X" '((0 . "INSERT"))) and loop through looking for particular block types or names. If you have a known list of blocks that you are looking for you could put that in your (ssget). Then use the result of this search in your IF.

Pologies for not offering more but I'm using LT at the moment.

S

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost