Qselect Polyline

Qselect Polyline

daniellim21st
Explorer Explorer
674 Views
7 Replies
Message 1 of 8

Qselect Polyline

daniellim21st
Explorer
Explorer

Hi


I need 3 script as these action repeat on many drawings.

no.1 script:-
===========
1, qselect
2, apply to : Entire drawing
3, Object type: polyline
4, properties: Lineweight
5, Operator: <> Not Equal
6, value: ByLayer
7, ok

no.2 script:-
===========
1, qselect
2, apply to : Entire drawing
3, Object type: polyline
4, properties: Global width
5, Operator: > Greater than
6, value: 0
7, ok

no.3 script:-
===========
1, qselect
2, apply to : Entire drawing
3, Object type: polyline
4, properties: Start segment width
5, Operator: > Greater than
6, value: 0
7, ok

 

help is really in needy & appreciated.

0 Likes
Accepted solutions (1)
675 Views
7 Replies
Replies (7)
Message 2 of 8

Kent1Cooper
Consultant
Consultant

Just to clarify:  Are you talking about "lightweight" LWPolylines, the ones that the Properties palette calls Polylines and the LIST command calls LWPOLYLINEs?  Or "heavy" ones that Properties calls 2D Polylines and LIST calls POLYLINEs?  Or both?  Maybe 3D Polylines, too?  I ask because some of the characteristics you're after are stored in different ways in the different varieties, and width is irrelevant to 3D Polylines.

Kent Cooper, AIA
0 Likes
Message 3 of 8

daniellim21st
Explorer
Explorer
hi, my drawings are 2D. i have try some lisp with LWPOLYLINE and it seems to work but i can't find the criteria that fits me
0 Likes
Message 4 of 8

dbroad
Mentor
Mentor

Qselect is a dialog based command that can't be scripted.  Use ssget with filters instead.

Architect, Registered NC, VA, SC, & GA.
0 Likes
Message 5 of 8

Kent1Cooper
Consultant
Consultant
Accepted solution

@dbroad 's message is the way to go -- QSELECT doesn't have a command-line version as some commands do.  And to expand, it's going to involve Relational Tests [read about them -- the (-4) codes in (ssget) filter lists] comparing values.  See the DXF Reference on the codes for entity properties [lineweight is among the "Common Group Codes" item at the top; the width ones are within the LWPOLYLINE entry].

 

For lineweights other than ByLayer, try this:
(sssetfirst nil (ssget "_X" '((0 . "LWPOLYLINE") (-4 . ">") (370 . 0))))

For global widths other than zero [which can only be greater than zero]:

(sssetfirst nil (ssget "_X" '((0 . "LWPOLYLINE") (-4 . ">") (43 . 0))))

For starting width other than zero [likewise]:

(sssetfirst nil (ssget "_X" '((0 . "LWPOLYLINE") (-4 . ">") (40 . 0))))

 

[I did it for the lineweight by checking for a value greater than zero, because there's no specific value for ByLayer -- the 370 entry isn't even in entity data to look for in that case -- but any value other than that would be numerical and greater than zero.]

 

You can use those AutoLisp lines in a Script file.  If it's the last or only thing in the file, just add an Enter at the end so the last line in the file is a blank line below the [last] code line.

 

As with QSELECT, those will select/grip/highlight [that's the (sssetfirst nil ...) part] only what they find within the current space.  They will find things elsewhere, and if that's something you need, the total findings can be saved to a variable from which you can get to even those not in the current space.

Kent Cooper, AIA
Message 6 of 8

daniellim21st
Explorer
Explorer
no luck...
i can select all polyline using:
(sssetfirst nil (ssget "_X" '((0 . "*POLYLINE"))))
but when insert filter, won't work
0 Likes
Message 7 of 8

Kent1Cooper
Consultant
Consultant

@daniellim21st wrote:
no luck...  i can select all polyline using:
(sssetfirst nil (ssget "_X" '((0 . "*POLYLINE"))))
but when insert filter, won't work

They work for me with "LWPOLYLINE" as I posted them and also with "*POLYLINE" to include "heavy" 2D Polylines with one exception.  If you want to include those, as I said, some information about them is stored differently.  Among the things you're looking for, they have no code-43 entry for global width [if they are the same width throughout], because that's not a function of the overall Polyline, but each vertex is its own entity name that holds its own width information.  So the one for non-zero global width does not find a "heavy" 2D Polyline like that.

 

Post the way you did it, and a small drawing in which it does not work for you.  If it isn't just an error in copying/pasting, describe more about what "won't work" means -- what happens that you don't expect, what doesn't happen that you do expect, are there any messages?, etc.

Kent Cooper, AIA
0 Likes
Message 8 of 8

daniellim21st
Explorer
Explorer

Hi Kent Cooper 👍,

finally i got it working, thank you so much for your help, it save me hours of repeating those 3 step... 👍👍👍

0 Likes