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

recognition of a polylinea

  • Thread starter Thread starter Angelo2449
  • Start date Start date

Angelo2449

Guest
Hello everyone,
I would like to check the selection of a polylinea and I wrote this:
Code:
(while (= ed1 nil)
                (setq ed1 (entsel "\nseleziona la polilinea esterna : "))
            );;while

            (setq ed11 (entget (entlast)))
            (setq ed111 (cdr (assoc 0 ed11)))

            (princ "\n")
            (princ "ed111 >>>>>>>>>>>>>>>>>>>>>>>>>> ")
            (princ ed111)
            (princ "\n")

            (if (or (/= ed111 "lwpolyline") (/= ed111 "polyline"))
            (progn
                    (alert "non hai selezionato una polilinea!")
                (vl-exit-with-error "uscita dal programma")
            );;progn
            );;if
the code not by mistake, recognizes the wrong selection but does not make me pass"
This is the result:
select the external polyline :
e111 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >
Thank you.
 
first and 11 you do not have to take it by entlast, but by its name (entlast is the last entity created, not the last selected).
as you do, always pick up the last created entity that (presuming) is a polyline.

Secondly education or lwpline - beads always returns you true because even when the value is lwpline it is different from beads.
replacing the or with a and management becomes correct. in fact the condition returns true only if the value is different piss from lwpline that from pline. if instead the value is a lwpline or a pline the condition and turns out nothing and therefore does not activate the alrt.
Code:
(setq ed1 nil ed11 nil ed111 nil)
(while (= ed1 nil)
                (setq ed1 (entsel "\nseleziona la polilinea esterna : "))
            );;while

            (setq ed11 (entget (car ed1)))
            (setq ed111 (cdr (assoc 0 ed11)))

            (princ "\n")
            (princ "ed111 >>>>>>>>>>>>>>>>>>>>>>>>>> ")
            (princ ed111)
            (princ "\n")

            (if (and (/= ed111 "lwpolyline")(/= ed111 "polyline"))
            (progn
                    (alert "non hai selezionato una polilinea!")
                (vl-exit-with-error "uscita dal programma")
            );;progn
            );;if
 
Crystal, I still have a question,
a polylinear with :
Code:
 (command "_pline" spigextsinup spigextdesup spigextdesdown spigextsindown spigextsinup "")
 (setq pl1 (entlast))
later with this other code:
Code:
 (if) (tof heightambientedes) (tof heightambientesin)
(progn)
(command "_extend" pl1 "" murasinsopra "")
(princ)
);
);
I would like to extend wallsinsopra (provided line) up to > pl1 <, this causes error, enlighten me, thank you.
Angel.
 
If I remember well you can't extend with the extend command, because it asks for a video pick that you can't pass.
you have to geometrically find the intersection (I think the lisp function is inters) and then point to the point found.
 
Last edited:
Therefore I should first draw a provisional line to > pl1 <, find the intersection through the inters command, possibly cancel the provisional line and trace a new one up to the point found.
here it is good but I should also truncate a line compared to > pl1 <, I hope the command "_breack" fictions!
Thank you.
 
look at the syntax of the inters function
no need for the line, just the points that define it. and you can also search for a continuation intersection (flag onseg). check through the help.
 

Forum statistics

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

Members online

No members online now.
ciao
Back
Top