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

name entità

  • Thread starter Thread starter Angelo2449
  • Start date Start date

Angelo2449

Guest
Hello everyone,
with this code:
Code:
 (while (or (= palacenax nil) (= palacenax "))
(setq titlex (strcat "select the name of the building > "))
(princ "\n")
(setq palacenax (entsel titlex)
(princ "\n")
);
I draw the string > palacenax < which could be, for example:
> building
or
><nome 22c6fd9d240="" entità:=""> (124.923 199.459 0.0)

how can I distinguish the two conditions so that I can extract the selected string with :
</nome>
Code:
 (setq palacenax (entget)
(setq palacenax (cdr (assoc 1 palacenax)))
without error.
Thank you.
 
if you are sure to treat a text (*)

having a String: "building a" if you check the type of element (type palacenax) re-establishment: str with entsel get a List: (<nome 20cb3e12520="" entità:=""> (3.40929 5.52409 0.0) </nome>if you check the type of element (type palacenax) re-establishment: list so you have to know the type of element you are treating:
Code:
(cond)
(= (type palacenax) (do this) )
(= (type palacenax) 'list (do that) )
)
(*) also by selecting a line a list is returned

p.s. why don't you write exactly what the program returns?
those symbols > and < create only confusion, a string is "building a" not building a < building
 

Forum statistics

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

Members online

No members online now.
Back
Top