Jump to content

AutoLISP: loop through selected objects and do something


Recommended Posts

Posted

Hi everyone,

I'm currently trying to write a routine that handles multiple selected objects.

 

In my drawing imported survey points are automatically stored as COGO-points with a specific point label style (a block reference defined by description sets).

The problem is upon exploding the COGO-point (twice) it's layer is reverted to 0. Therefore I need a routine to change the layer back to the one defined by the corresponding description key.

 

This routine should:

  1. prompt for selecting object(s) - COGO-points only
  2. for each COGO-point do the following
    1. store its layer to a variable (eg. "XX_TOPO_TREE")
    2. explode the COGO-point - which will result in a block reference with name *Uxxx (eg. *U123)
    3. explode the block - will result in a named block on layer 0 (eg. "sym_topo_tree")
    4. change the block layer to the one stored before

 

After trying to teach myself AutoLISP over a year ago I almost forgot anything I've read due to a longer break.

Now I am starting from the beginning again.

 

Since it would take some time until I get this on my own, I hereby ask for a solution / a lisp routine.

 

Best regards

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...