Announcements
Due to scheduled maintenance, the Autodesk Community will be inaccessible from 10:00PM PDT on Oct 16th for approximately 1 hour. We appreciate your patience during this time.
Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to add text to dimension with iLogic

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
J_Dumont
286 Views, 2 Replies

How to add text to dimension with iLogic

I'm using the iLogic snippets to create linear dimensions without issue, but I would like to know if it's possible to add some text during the creation. For example, I would like to add "TYP" after the dimension value.

 

Below is the code that creates one of the dimensions.

 

'Front View Dimensions
Dim VIEW45 = UPPER_SM_PAN_18.DrawingViews.ItemByName("VIEW45")
Dim Edge5 = VIEW45.GetIntent("Edge5")
Dim Edge6 = VIEW45.GetIntent("Edge6")
Dim linDim7 = genDims.AddLinear("Dimension 7", VIEW45.SheetPoint(0, 1.1), Edge5, Edge6)
Tags (2)
Labels (2)
2 REPLIES 2
Message 2 of 3
Michael.Navara
in reply to: J_Dumont

You need to modify the FormattedText of the dimension. See XML Tags for FormattedText for more information.

This is the line of code which appends "TYP" after the dimension text

Dim linDim7 = genDims.AddLinear("Dimension 7", VIEW45.SheetPoint(0, 1.1), Edge5, Edge6)

linDim7.NativeEntity.Text.FormattedText = "<DimensionValue/> TYP"

 

Message 3 of 3
J_Dumont
in reply to: Michael.Navara

Hi Michael,

 

Your solution worked perfectly. Thank you for the URL for the XML tags.

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report