Jump to content

me again ! -iterate through SSGET


Recommended Posts

Posted

hi again again!:P

 

i have a another question. what if I want to change the DXF values of multiple objects using (ssget). I'm searching for an answer. I have no idea how to do this. thanks in advance!

Posted

You will need to iterate through the set, and change each entity's DXF in turn.

 

Take a look a many of my examples, I do this quite often.

 

I believe I even linked you to an example of such (changing all entities to green). :wink:

 

Lee

Posted

hmmm i'll have to take a look.

Posted

well I looked at one of your posts and it does what I want. I just changed some the color and instead of layer I changed linetype. but I just want to make sure I understand this code

 

 

 

  
(defun c:doit (/ i ss ent eLst)
(if (setq i -1        [color=Red];i'm guessing this is for the "while" counter[/color]
       ss (ssget "_:L"))  [color=Red];this is the selection set.  not sure what kind if selec :L is[/color]
   (while
     (setq ent                [color=Red];variable for the entity name[/color]
        (ssname ss
            (setq i (1+ i))))    [color=Red];this will continue to +1 untill it runs out of object entities[/color]
                               [color=Red];when it runs out it returns nil and stops the loop.[/color]
                               [color=Red];(1+ i) = 0 which is first entity in selection set[/color]
     (setq eLst (entget ent))       [color=Red] ;retrieve DXF codes[/color]
     
     (setq eLst (subst '(8 . "0") (assoc 8 eLst) eLst)) [color=Red];modify DXF[/color]

     (entmod                    [color=Red];all of this is incase a DXF code does not exist.[/color]
       (if (assoc 62 eLst)
         (subst '(62 . 3) (assoc 62 eLst) eLst)
         (append eLst '((62 . 3)))))))

 (princ))

Posted

The groups that need the ( append ) call that I know of are:

  • -3 - XDATA
  • 6 - Linetype
  • 39 - Thickness
  • 48 - LTYPEScale
  • 62 - Color

 

67 needed it in R12, but not since.

 

They may be a bunch more in newer stuff. -David

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