no, "Layer" is not a field type.
[ALL] or [OBJECT]
and then
OBJECT -> <select object> -> Property: LAYER
@sagnewYUXLR
Hi,
in this list is NO property listed. Take "OBJECT" from this list,
and you can select an object then.
NOW, the dialog offers near to all properties of this object - and one general property of each object is LAYER.
> Learn to use field and explore the huge offer of possibilities
https://help.autodesk.com/view/ACD/2024/ENU/?guid=GUID-742C92C3-1284-4722-B650-C46F9191C701
For a better worflow, use tools for less steps.
Very basic codes or very smart 3rd party programs, the core part is all the same - how to create the FieldCode
IF you want to use field for it.
; Show object layer by Mleader
; Very simple sample for mleaderstyle with max.2 Leader Points
(defun c:FieldObjectLayer-MLEADER (/ seldata #object FieldCode)
(if (and
(setq seldata (entsel))
(setq #object (vlax-ename->vla-object (car seldata)))
(setq FieldCode (strcat "%<\\AcObjProp Object(%<\\_ObjId "
(itoa(vla-get-ObjectID #object))
">%).Layer"
">%"
) )
)
(command "_.MLEADER" "_h" "_nea" (last seldata) pause FieldCode "")
(princ "\nSomething went wrong")
)
(princ)
)
; Show object layer by Text
; Very simple sample for Styles with height=0
(defun c:FieldObjectLayer-TEXT (/ seldata #object FieldCode)
(if (and
(setq seldata (entsel))
(setq #object (vlax-ename->vla-object (car seldata)))
(setq FieldCode (strcat "%<\\AcObjProp Object(%<\\_ObjId "
(itoa(vla-get-ObjectID #object))
">%).Layer"
">%"
) )
)
(command "_.TEXT" pause pause pause FieldCode "")
(princ "\nSomething went wrong")
)
(princ)
)
(princ "\ncommand FieldObjectLayer-MLEADER loaded")
(princ "\ncommand FieldObjectLayer-TEXT loaded")
(princ)
If you use dimensions/leader/mleader: Turn AnnoMonitor ON to see which ones are no longer associated[!]