hi there
i was wondering if there is anyway to create a tag/leader/label (similar to revit) that will automatically pick up the layer name of the object i am selecting?
i'd like to create a floor plan and label all the items i have without having to use "dumb text" so to speak
many thanks
Solved! Go to Solution.
Solved by Kent1Cooper. Go to Solution.
@sagnewYUXLR wrote:
... pick up the layer name of the object i am selecting?
.... without having to use "dumb text" ....
That sounds like you want Mtext with a FIELD for content. That will update [upon REGEN] if you change the Layer of the object the Field is tied to. Do you know how to go about that?
If you pick Object [instead lf All] in the Field category: list, does it not then offer Layer as a choice?
no, "Layer" is not a field type.
[ALL] or [OBJECT]
and then
OBJECT -> <select object> -> Property: LAYER
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[!]
Sebastian
There are easier ways to label any drawing objects. If you need multi-leaders, then use the AVC Smart Leader plugin and configure it to display a layer (%layer% substitution). If you need to place simple texts above objects, then use the AVC Mark plugin in Label mode. Both plugins can be configured so that "fields" appear in the mLeader or mText, and not just the name of the layer.
Yes, I should have said pick Object in the Field category: list, and pick an object [pick on the little icon to the right of the Object type: slot] to see Layer as an available property.
Can't find what you're looking for? Ask the community or share your knowledge.