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

transformation names entity into string

  • Thread starter Thread starter Giuseppe Beatrice
  • Start date Start date

Giuseppe Beatrice

Guest
Hi, guys. .
exists, that you know, the possibility of transforming a name of entity (which is then marked by the format <.....>) into a string?
In fact, the "itoa" "rtos" commands allow to transform an entire or real number into a string, but I do not realize that it is possible to transform a data of type 'ename.
the transformation into string of the entity name could be for example useful to store it in a file.
thanks for the attention.
 
store the handle of the entity, which is unique, string value
(setq handle)
this value you can store it in a file

loading it later, using the same design, using the handent function, searching in the entity database and returning the entity name.
(setq nomeent (lovely trade)
bye
 
Okay.
It works very well.
thanks as usual, very kind and very fast.:finger:
 
I resume this discussion because it already seemed incomplete; probably will no longer serve the data subject, but simply shows the use of some functions of little known autolisp.
if the purpose is (was) the storage of the entity name (in exadec) in a list or table, it would not be very elegant to carry behind each time the wording <nome entità:.......=""> </nome><nome 7ffff609b70="" entità:=""><nome 7ffff609b80="" entità:=""><nome 7ffff609b60="" entità:=""><nome 7ffff609c60="" entità:="">......
but preferably:
7ffffff609b80
7ffffff609b80
7ffffff609b
7ffffff609
......
data that can be obtained with the following code:
</nome></nome></nome></nome>(setq str (vl-princ-to-string (car (entsel))))
(setq aa (substr str 15))
(setq exadec (read (vl-string-right-trim ">" aa)))
 
thank you for the comment, which opens as usual interesting "windows" on the possibilities of autolisp and the enormous potential of a use of autocad not simply "executive" but through programming; the only closing phrase that comes to mind is a humble reference to the immortal dante: "because you weren't like brutes."
thanks again and next.
 

Forum statistics

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

Members online

No members online now.
Back
Top