• This forum is the machine-generated translation of www.cad3d.it/forum1 - the Italian design community. Several terms are not translated correctly.

select objects within a closed and erased polyline

  • Thread starter Thread starter non-linear
  • Start date Start date

non-linear

Guest
Hello, therefore.. I have a closed polyline in the middle of a large number of scattered points: I'm trying to figure out how I can select all the points that fall within this polyline (without doing it by hand, of course.). I tried to load and use wps, without results. Any advice?
Thank you.
No
 
here a lisp I wrote a long time ago.
select the support polyline and select all entities inside, at that point the selected entities can be managed.
 

Attachments

the lisp works correctly but in case you want to also select the balls above the boundary polyline and not only inside as I can do!?

Thank you for the swp!
 
edit the file lisp and in the row where the command is:
(command "_select" "_wp")
Make it
(command "_select" "_cp")

bye
 
Can I ask you one more innovation if feasible? !
Your lisp once you select everything inside a closed polyline could uncheck the polyline itself when sending the command? !
es: I have to put on a layer "a" the content of a closed polylinea but the polylinea must remain in the layer "b". the lisp now also converts polylinea to "a". .

Thank you for your help!
 
Hello I am new to this forum

I cling to this conversation the lisp on cited is very useful to me, but if you can also create a lisp that selects everything that is outside of a closed polyline leaving clear what is inside

thanks in advance
 
select all entities except those contained in polylinea (type of crossing polygon selection)

bye
hi, first of all great! I wanted to ask if it was possible to select more polylines together and then delete everything inside them.
 
the swp2 command deletes everything that is included in the closed polylines through a crossing selection.
is completely different from the previous swp, more compact and simple.

bye
 

Attachments

Hello.
First of all I thank you because your lisp files work properly. But I wanted to ask you for help:
I have a polylinea closed on a layer "a" and all that is contained in the closed polylinea is located in the layer "b". Now how can I change the file lisp so that, the command "swp" in addition to selecting the polyline content also allows me to bring the selected elements to the layer of the closed polyline (layer a) automatically?
Thank you for your help.
 
Code:
(defun c:swp2 (/ polylinee nomelista organita pt_list group c)

(prompt "\nselect polyline group: "
(setq polylinee (ssget '(0 . "lwpolyline"))))

(setq c 0)
(repeat (sslength polylinee)
(setq nomelista (ssname polilinee c))
(setq entitlement)
(setq pt_list (fncoordlw entita)
(setq group (ssget "_cp" pt_list))
(command "_erase" group "")
(in the namelist)
(setq c (1+ c))
)
)

(defun c:swpl()
(swpl_m "a" "b")
)

(defun swpl_m (layer layerentsel / polylinee nomelista organita pt_list group c)

(prompt (strcat "\nselect polyline group on layer <" layer ">: ")
(setq polylinee (ssget (cons 0 "lwpolyline") (cons 8 layers))))
(setq c 0)
(repeat (sslength polylinee)
(setq nomelista (ssname polilinee c))
(setq entitlement)
(setq pt_list (fncoordlw entita)
(setq group (ssget "_cp" pt_list (list (cons 8 layerentsel)))))
(command "_change" group "_pr" "_la" layer "")
(setq c (1+ c))
)
)

(defun fncoordlw (entry/list pt1 p index)
(set indexq 0)
(while (nth index entita)
(setq p (nth index)
(if (= (car p) 10)
(progn)
(setq pt1 (cdr p))
(setq list (list append)
)
)
(setq index (+ 1 index)
)
list
)
the new swpl command instead of erasing the polylines with their content, changes the plan.
I added the filter to the ssget function to select only polylines on the "a" plane and select only entities on the "b" plane.
the command c:swpl recalls a function to which two values pass, "a" and "b", which in swpl_m become the two variables layer and layerentsel.
if the plan changes name, you just change c:swpl.
you can also call swpl_m directly by writing on the command line (swpl_m "a" "b").

bye
 
edit the file lisp and in the row where the command is:
(command "_select" "_wp")
Make it
(command "_select" "_cp")

bye
hi, in case you want to also select objects intersected by the polylinea how should I change the code?
Thank you very much
 

Forum statistics

Threads
44,997
Messages
339,767
Members
4
Latest member
ibt

Members online

No members online now.
Back
Top