Jump to content

Lisp for Auto changing a selection of possible layers to a select few


ausswonder

Recommended Posts

hi all,

we are facing some standards and automation consistency problems. we have our C3D files with 6 design options all with standard layer names with a suffix "Option A", "Option B" etc

 

we export these files to AutoCAD for the shared references for the rest of the disciplines on the project to use. what we are needing is to change the model layers with the options suffix back to a standard name.

 

is there a lisp or way to automate the change or conversion of the layers without too much manual interaction and time investment.

 

Cheers

 

A

Link to comment
Share on other sites

The rename tool can utilize wild cards and layer merge will combine layers. That should do the the trick for you, if I understand correctly.

Link to comment
Share on other sites

I do the opposite we have a look up text file that has the layer name in it prefered colour linetype etc this was the easiest way to change field surveys from various sources, it adds to the layer name EX_EDGE_ROAD SU_Water.

 

Robdraw is on the money using rename it can be programmed via script or lisp etc. Only hiccup is the * is not supported in simple -rename layer EX* OLD* Lee may know a way, else do a search layer table look at 1st 2 for "EX" then rename.

 

 ; simple example to start with
(setq layer (vla-get-layers (vla-get-activedocument (vlax-get-acad-object))))
(vlax-for each layer
(setq layname (vla-get-name each)) ; here is where you would check for layer name 1st characters
; (if (= (substr layname 1 2) "EX" )
;(vla-put-name each "newname") ; chop the EX from the front
)

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...