Visual LISP, AutoLISP and General Customization

Visual LISP, AutoLISP and General Customization

Reply
Mentor
Nik-D
Posts: 224
Registered: ‎09-10-2012
Message 1 of 4 (327 Views)
Accepted Solution

convert polyline - Bad SSGET list

327 Views, 3 Replies
02-05-2013 01:57 AM

Hi all

 

I'm new to lisp so this may seem like a silly question but i just cannot seem to get this thing to work.

 

I have a data structure called LayerList in the format [LIST "LayerName" "Linetype" Thickness Color]

 

I then use the following piece of code to go through the structure selecting polylines and converting all polylines on a given layer to the correct thickness

 

   (foreach layr layerlist
       (setq player (car layr))
              (if (setq ss (ssget "x" '((0 . "*polyLINE") (8 . player ) )))
                      (command "pedit" "m" ss "" "w" 0.15 "")
                      (princ "\nNo polylines exist!")
      )
   ) 

 

However all i keep getting is Bad SSGET list value at the command line,

 

What am i doing wrong??

 

Nik

Solved it, I changed the code as follows

 

   (foreach layr layerlist
    (if (setq ss (ssget "_x" (list'(0 . "*POLYLINE") (cons 8  (car layr)) )  ))
      (command "pedit" "m" ss "" "w" 0.15 "")
    (princ)
    )
 )

Mentor
Nik-D
Posts: 224
Registered: ‎09-10-2012
Message 2 of 4 (321 Views)

Re: convert polyline - Bad SSGET list

02-05-2013 02:40 AM in reply to: Nik-D

Solved it, I changed the code as follows

 

   (foreach layr layerlist
    (if (setq ss (ssget "_x" (list'(0 . "*POLYLINE") (cons 8  (car layr)) )  ))
      (command "pedit" "m" ss "" "w" 0.15 "")
    (princ)
    )
 )

*Expert Elite*
Kent1Cooper
Posts: 5,879
Registered: ‎09-13-2004
Message 3 of 4 (307 Views)

Re: convert polyline - Bad SSGET list

02-05-2013 05:34 AM in reply to: Nik-D

Good for you for figuring it out.  I would, however, suggest that you stick with the word Width [as in the name of the option used in your Pedit command] rather than referring to an object's Thickness.  Polylines [and many other entity types] can also have Thickness, which has a specific [and different from Width] definition in AutoCAD: their dimension in the up-off-the-page Z direction.

Kent Cooper
Mentor
Nik-D
Posts: 224
Registered: ‎09-10-2012
Message 4 of 4 (304 Views)

Re: convert polyline - Bad SSGET list

02-05-2013 05:39 AM in reply to: Kent1Cooper

Will do. Thanks Kent

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.