It seems simple but I am not yet getting it on how to use entget
to retrieve values from the Extended Dictionary of an AutoCAD object.
(entget (car (entsel)))
works, and shows e.g.:
(
(-1 . <Entity name: 17812cb4670>)
(0 . "LWPOLYLINE")
(5 . "83F")
(102 . "{ACAD_XDICTIONARY")
(360 . <Entity name: 17812cb4680>)
(102 . "}")
(330 . <Entity name: 177903809f0>)
(100 . "AcDbEntity")
Now I guess that numbers like 17812cb4680 are identifiers to objects that may contain data, but you cannot just give such a number to entget
, like:
(entget 17812cb4680)
I can save a selection in a variable:
(setq x (entsel))
which returns something like an ID plus x-y-z coordinate:
(<Entity name: 17812cb4670> (121311.0 486438.0 0.0))
Evaluating that variable normally needs just typing the name, but in Autocad it needs an exclamation mark:
!x
but using that variable in entget
is not straightforward, these all fail:
(entget x)
(entget 17812cb4670)
(entget !17812cb4670)
(entget (<Entity name: 17812cb4670> (121311.0 486438.0 0.0)))
(entget '(<Entity name: 17812cb4670>))
Apparently, that little what I know about Lisp works differently in AutoCAD. I searched a lot for solutions but could not find it.
Any help is very much appreciated.