Short description
π Assembly MText Label is an AutoCAD Civil 3D labeling utility that creates a dynamic MText field label linked directly to a selected Civil 3D Assembly object.
π The main benefit is faster Assembly annotation, fewer manual text edits, and automatic label updates when the Assembly name changes.
Command:
π§° The user starts the tool, selects a Civil 3D Assembly in the drawing, then picks an insertion point for the generated label.
π΄ The exact command name is not specified in the provided code description, but the workflow is built around Assembly selection, ObjectId retrieval, FIELD expression creation, and MText insertion.
ποΈ Target platform: AutoCAD Civil 3D, using AutoCAD database objects, Civil 3D Assembly objects, dynamic fields, and annotation text.
Description:
Helper function: (if any)β
- π Assembly selection logic – prompts the user to choose a valid Civil 3D Assembly entity from the active drawing.
- π§© ObjectId binding – retrieves the selected entity
ObjectIdso the generated field points to the correct drawing object. - π§ FIELD expression builder – creates an AutoCAD
FIELDexpression linked to the AssemblyNameproperty, with the option to adapt the expression toDisplayNameif required. - π Insertion point workflow – asks the user to pick the exact location where the Assembly label should be placed.
- π MText creation – creates an
MTextdatabase object and assigns the generated field expression as its text content. - π Automatic text sizing – reads the current
TEXTSIZEsystem variable and applies a practical fallback height when needed. - π Dynamic update behavior – uses AutoCAD field evaluation so the label can reflect Assembly property changes after field updates.
Functionalities:
- π Create Civil 3D Assembly labels – quickly places an Assembly name label without typing the text manually.
- π Select an Assembly object – lets the user choose the Civil 3D Assembly directly in the drawing.
- π§© Link label to ObjectId – binds the text field to the real selected object instead of using static text.
- π Generate dynamic MText – creates an
MTextlabel that contains a live AutoCAD field expression. - π Pick custom placement point – allows precise manual placement of the annotation label.
- π Apply automatic formatting – uses
TEXTSIZEfor readable text height and consistent drawing annotation. - π Update when Assembly name changes – supports dynamic field-based updates for better Civil 3D annotation control.
- π Reduce manual drafting errors – prevents mismatches between Assembly names and typed labels.
Result:
β
The final result is a productivity-focused AutoCAD Civil 3D Assembly labeling tool that creates a dynamic MText field label connected to the selected Assembly object.
π’ It improves drawing accuracy, speeds up annotation workflows, reduces manual text maintenance, and helps Civil 3D users keep Assembly labels synchronized with object properties.
Images, animations etc.
XAML code:
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:src="clr-namespace:Autodesk.Windows;assembly=AdWindows">
<src:RibbonToolTip x:Key="AssemblyLabel">
<src:RibbonToolTip.ExpandedContent>
<StackPanel>
<TextBlock Background="AntiqueWhite" TextAlignment="Left">
<Bold>Function Syntax: AssemblyLabel</Bold>
<LineBreak/>
<Bold>Version: 1 Date: 25.09.2025</Bold>
<LineBreak/>
<LineBreak/>
<Hyperlink>AI</Hyperlink>
<LineBreak/>
<Bold>Description</Bold><LineBreak/>
This program allows the user to create an <Bold><Span Foreground="DarkRed">MText label</Span></Bold> that is automatically linked to a selected <Bold><Span Foreground="DarkRed">Civil 3D Assembly</Span></Bold> object.<LineBreak/>
<Bold>Main actions:</Bold><LineBreak/>
β’ The program prompts the user to <Bold><Span Foreground="DarkRed">select an Assembly object</Span></Bold> in the drawing.<LineBreak/>
β’ It retrieves the <Bold><Span Foreground="DarkRed">ObjectId</Span></Bold> of the selected entity and uses it to build a <Bold><Span Foreground="DarkRed">FIELD expression</Span></Bold>.<LineBreak/>
β’ The <Bold><Span Foreground="DarkRed">FIELD</Span></Bold> is bound to the Assemblyβs <Bold><Span Foreground="DarkRed">Name</Span></Bold> property (or can be adjusted to <Bold><Span Foreground="DarkRed">DisplayName</Span></Bold>).<LineBreak/>
β’ The user is prompted to pick an <Bold><Span Foreground="DarkRed">insertion point</Span></Bold> for the label.<LineBreak/>
β’ An <Bold><Span Foreground="DarkRed">MText object</Span></Bold> is created at that location with the FIELD as its content.<LineBreak/>
β’ The <Bold><Span Foreground="DarkRed">text height</Span></Bold> is set automatically based on the current <Bold><Span Foreground="DarkRed">TEXTSIZE</Span></Bold> system variable (or a fallback value).<LineBreak/>
β’ The label will <Bold><Span Foreground="DarkRed">update dynamically</Span></Bold> if the Assembly name changes.<LineBreak/>
<Bold>Functionalities provided:</Bold><LineBreak/>
β’ <Span Foreground="Red">Entity selection</Span> β choose the Civil 3D Assembly.<LineBreak/>
β’ <Span Foreground="Red">ObjectId retrieval</Span> β ensures correct binding in FIELD expression.<LineBreak/>
β’ <Span Foreground="Red">FIELD generation</Span> β links label to Assembly property.<LineBreak/>
β’ <Span Foreground="Red">Point placement</Span> β user defines label location.<LineBreak/>
β’ <Span Foreground="Red">MText creation</Span> β adds FIELD as dynamic text.<LineBreak/>
β’ <Span Foreground="Red">Automatic formatting</Span> β height and width handled for readability.<LineBreak/>
β’ <Span Foreground="Red">Dynamic updates</Span> β text reflects property changes automatically.<LineBreak/>
</TextBlock>
<Grid>
<Image Source="PNG" Stretch="Uniform"/>
</Grid>
<Grid>
<MediaElement
Source="GIF"
Stretch="Uniform"
Visibility="Visible"/>
</Grid>
</StackPanel>
</src:RibbonToolTip.ExpandedContent>
</src:RibbonToolTip>
</ResourceDictionary>
