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

id extraction from an element

  • Thread starter Thread starter nicolas74
  • Start date Start date

nicolas74

Guest
Help! !
I am trying to extract the id of a newly created item (setq element1 (ssname (entlast) 0))

but error comes out
error: incorrect type - <entity 6a01e938="" name:="">I'd pull it out, but the macro stops... .</entity>
 
(setq element1 (entlast)) non va bene?
Hi.
thanks for the answer,
unfortunately it is not good because it comes out <entity 1b931d60="" name:=""> while I only need the number 1b931d60, as to do operations on that element I will have to write only that number and not <entity 1b931d60="" name:=""></entity></entity>
 
n = entity name
(defun strename(n / strn)
(setq strn (vl-princ-to-string n))
(setq strn (substr strn 15))
(setq strn (substr strn 1 (1- (strlen strn))))
)
 
But sure you only need the number to do operations?
if you go via command (e.g. move) and give it as item selection1, take the selected entity
if you go away lisp (e.g. entget) and the steps element1 intercepts the selected entity.
If you pass to the lisp the only number, you don't understand what you're talking about.. .

by element1 I mean the value <entity 1b931d60="" name:=""> contained in the variable element1.. .</entity>
 
I never had such a necessity.
If you want to uniquely identify an element, just the handle.
Let's see that says nicolas74
 
siiii, it works,,, with the handle I can get what I needed!! !
thank you so much for the help!!! ! !
 

Forum statistics

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

Members online

No members online now.
Back
Top