Lisp to find lwpolyline

Lisp to find lwpolyline

martin.mardikas
Enthusiast Enthusiast
1,559 Views
5 Replies
Message 1 of 6

Lisp to find lwpolyline

martin.mardikas
Enthusiast
Enthusiast

Hi!

Many cases i have drawings, where there seems to be LWpolylines. I can't find these with qselect command. Can i?

Anybody can helo me with lisp routine to find lwpolylines in the drawing and mark it/these?

Thanks!

M

0 Likes
1,560 Views
5 Replies
Replies (5)
Message 2 of 6

Kent1Cooper
Consultant
Consultant

@martin.mardikas wrote:

.... LWpolylines. I can't find these with qselect command. Can i?

Anybody can helo me with lisp routine to find lwpolylines in the drawing and mark it/these? ....


Yes, you can find them with Qselect.  They are called just "Polyline" in the available Object type: choices in the Qselect pull-down list [the same as they are in the object-type slot at the top of the Properties box].  If there are any "heavy" 2D ones in the drawing, they are called "2D Polyline" in that pull-down, and if there are any 3D ones, they are called "3D Polyline."

 

But you can also find/select/highlight/grip them with AutoLisp, this way:

 

(sssetfirst nil (ssget "_X" '((0 . "LWPOLYLINE"))))

Kent Cooper, AIA
0 Likes
Message 3 of 6

martin.mardikas
Enthusiast
Enthusiast

I will send on drawing.

I'm using special applications to draw frame. But the program is telling that some polylines have "truned" to lwpolylines and can't be used.

So my question is, what are lwpolylines over here and how can i find them. Because all the objects here are polylines.

 

0 Likes
Message 4 of 6

Ranjit_Singh
Advisor
Advisor

All objects in your drawing are not 2D polylines. Some are Heavy and some are light. See Kent1Cooper's response to find which are heavy and which are light. It seems like your special application needs all heavy polylines. Use

 

(command "._convertpoly" "_h" "_all" "")

to convert all polylines to heavy and then run your application

 

 

In case it needs all light polyline

(command "._convertpoly" "_l" "_all" "")

 

0 Likes
Message 5 of 6

Kent1Cooper
Consultant
Consultant

@martin.mardikas wrote:

.... what are lwpolylines over here and how can i find them. Because all the objects here are polylines.


You can find them with what I suggested in Post 2, with either the AutoLisp function, or Qselect by picking Polyline in the Object type pull-down list [and don't forget Select All in the Operator pull-down list].  You can find the "heavy" ones in the same way, choosing 2D Polyline instead, or with this  slightly different AutoLisp function:

 

(sssetfirst nil (ssget "_X" '((0 . "POLYLINE"))))

 

[Yes, it is confusing that "lightweight" ones are called POLYLINE in the Qselect list and the Properties box, but are called LWPOLYLINE in entity data and (ssget), while "heavy" ones are the ones called POLYLINE in entity data and (ssget), and either 2D POLYLINE or 3D POLYLINE in Qselect and Properties.  They didn't design all of that very well for clarity....]

 

You can use the CONVERTPOLY command to change either kind [of flat ones -- not 3D] into the other kind.

Kent Cooper, AIA
0 Likes
Message 6 of 6

martin.mardikas
Enthusiast
Enthusiast

Thanks!

This convertpoly works.

M

0 Likes