Jump to content

Lisp code to select all polylines with lineweight > than 0.5


JovanG

Recommended Posts

Hello Every one. 

 

I would like to have a lisp that helps me to select only the polilines that have a lineweight greater than or equal to 0.5 in my current selection.

 

If you can help me, I would really appreciate your help.

Wish you a good day.

Link to comment
Share on other sites

2 hours ago, Tharwat said:

(ssget '((0 . "LWPOLYLINE") (-4 . ">") (370 . 0)))

 

Hi Tharwat, I really thank you for your help. But (I don´t know why) in this dwg it doesn`t work well at all, because:

1. Select some objects with lineweight = 0.7 but some others with same lineweight not

2. Apparently select all but LW different of cero (not in all cases like I said in first point), but I need just greater than 0.5

image.png.bf827f2bb0722e718c4a7ac4e5e19c9d.png

And Can you help me please with a piece of code that helps me to run the program with already selected objects.

 

I'll add the dwg shown in the image.

this is the code that I use according to yours:

 

(defun c:aux (/ ss)
(sssetfirst nil (setq ss (ssget '((0 . "LWPOLYLINE") (-4 . ">") (370 . 0))))))

 

Thank you in advance.

P-ALC-600-458_03_PR.dwg

Link to comment
Share on other sites

5 minutes ago, JovanG said:

Hi Tharwat, I really thank you for your help. But (I don´t know why) in this dwg it doesn`t work well at all, because:

1. Select some objects with lineweight = 0.7 but some others with same lineweight not

2. Apparently select all but LW different of cero (not in all cases like I said in first point), but I need just greater than 0.5

 

The codes allow you select LWpolylines that are above zero which means that the 0.5 is already included into account as you mentioned into your first post ' greater than or equal to 0.5'

If you want to exclude the 0.5 line weight then just change (370 . 0) to (370 . 5)

Link to comment
Share on other sites

15 minutes ago, Tharwat said:

 

The codes allow you select LWpolylines that are above zero which means that the 0.5 is already included into account as you mentioned into your first post ' greater than or equal to 0.5'

If you want to exclude the 0.5 line weight then just change (370 . 0) to (370 . 5)

Oh yeah. I´m sorry, greater than or equal to 0.5, but what I mean is that program don´t run well at all becase happen something like this:

image.png.dbed640e4987837f1d3910df436587b4.png

Pline enclosed in red has a lineweight of 0.4 and the one enclosed in blue too, but red is selected and blue not. Why does it happen?

Link to comment
Share on other sites

All red rectangles are on 0.0 line weight as show in the following snapshot.

If you changed the GC (370 . 0) to (370 . 5) then that means only the lwpolylines that are on line weight that greater than zero would be selected 

image.png.67af8e6b9dca7107891a2598ba62f63b.png

Link to comment
Share on other sites

17 minutes ago, Tharwat said:

I forgot to say also is that the red rectangles are a combination of line objects and are not LWpolyline objects.

Oh, That´s why. Line objects are not included and there are some line objects in my selection. I Really thank you Tharwat

Edited by JovanG
Link to comment
Share on other sites

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