Autodesk Inventor Customization
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
Change Drawing Dimension Text and Symbols Font with iLogic
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
I was looking to change the fonts in a drawing for the Dimensions and Symbols that might have been inserted in the Dimension text entries.
This can be done manually bu editing the dimentions text after placemement, but I was ooking to set this as a default.. I cannot see where exactly this is controlled in the Styles Manager - I am only able to change the Dimension text font but the diameter symbol font is always on AIGDT.
I was therefore looking for an iLogic\vb code that could do the trick, but I am not able to even change the dimension fonts... The code runs with no errors but nothing gets updated in the drawing...
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
Dim oBaseDimSet As BaselineDimensionSet
Dim oBaseDimSets As BaselineDimensionSets
For Each oBaseDimSets In oSheet.DrawingDimensions.BaselineDimensionSets
oBaseDimSet.Style.TextStyle.Font = "Chiller"
oBaseDimSet.Style.TextStyle.FontSize = 10
Next
InventorVb.DocumentUpdate()
Any idea what I am doing wrong here?
Best Regards,
Vas
Re: Change Drawing Dimension Text and Symbols Font with iLogic
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Here you go
Dim oDoc As DrawingDocument
oDoc = ThisApplication.ActiveDocument
Dim oSheet As Sheet
oSheet = oDoc.ActiveSheet
Dim oBaseDimSet As BaselineDimensionSet
Dim oBaseDimSets As BaselineDimensionSets
oBaseDimSets = oSheet.DrawingDimensions.BaselineDimensionSets
For Each oBaseDimSet In oBaseDimSets
oBaseDimSet.Style.TextStyle.Font = "Chiller"
'.396 = .156in Text
'.458 = .180in Text
oBaseDimSet.Style.TextStyle.FontSize = 0.458
Next
Applications Engineer
Autodesk Inventor Certified Expert
Microsoft Certified Application Developer
_____________________________________________________
Did I help you? Please choose Accept as Solution or Kudos below
Re: Change Drawing Dimension Text and Symbols Font with iLogic
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi Joh,
Thank for the response and assitance, I knew I was forgetting something importnat in that code... Although this code still make no effect on the drawing for some reason, does that work for you on existing dimension text?
Many thanks,
Vas
Re: Change Drawing Dimension Text and Symbols Font with iLogic
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
Hi,
the code jdkriek shared in message 2 works well at my side. I created some base dimension set manually. then run the code, all dimensions font size are changed. Could you elaborate "....make no effect...."?
Xiaodong Liang
Developer Technical Services
Autodesk Developer Network
