Is there a Lisp routine that will run the correct Layer setup based on the User input.
I basicly what to have a routine that i can run to re-insert all layers for a startup DWG.
|
Is there a Lisp routine that will run the correct Layer setup based on the User input.
I basicly what to have a routine that i can run to re-insert all layers for a startup DWG.
Requires more information. But have a look at the Layer Manager in Express Tools. You can export the layers from a drawing into an external file and import it back to any drawing.Originally Posted by rhayes.99001
Regards,
Abdul Huck
As opposed to just starting a new drawing from a template?Originally Posted by rhayes.99001
Yes, what you are asking can be done.
Are you wanting to keep these layer, dimstyle, and textstyle definitions stored in a DWG file? If so, just do that then insert this drawing whenever you need it. The downside to that is that any existing object properties will not be overwritten.
To ensure that the end result matches your desires, you will need to define the layers, dimstyles, and textstyles on the fly using lisp.
Here is an example. This creates a new layer named "text", and sets the linetype to "hidden".
Code:(setq *layers* (vla-get-Layers (vla-get-ActiveDocument (vlax-get-acad-object)) ) ) (setq new (vlax-invoke-method *layers* "Add" "text")) (vla-put-Linetype new "Hidden")
R.K. McSwain | CAD Panacea |
Modify the template (*.dwt) file for your startup drawing. If it's not a startup drawing just insert it into one.
From a template you can also drag-n-drop layers into old files as needed.
Or a script could work...
I have an Existing Drawing that I am currently working on.
It has been purged and now I need some of those layers back.
I want to run a lisp to re-load all the layers,dim & text styles that
have been purged out and keep working on the same drawing file.
Is there a better way to re-insert this info.???
If I have a Template file how do I re-load into an existing drawing.???
Use Design Center to import all the layers,dim & text styles from another drawing.Originally Posted by rhayes.99001
one way is to use a macro that will insert the template as a block then delete it without removing the layer and text style info. Warning: this method will leave behind a lot of info from the template as well. Also your template would have to be saved as a dwg.Originally Posted by rhayes.99001
You can also try here for some more complex solutions. While there you can also check the bottom of the thread for similar posts.Code:^C^C_.-insert;"X:/CAD/TEMPLATE.dwg";^C^C_.-purge b;TEMPLATE;n;;;