08-29-2023
04:55 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-29-2023
04:55 AM
I require the mass props to be reported on the parts list to 1dp ,
I know that I need to update the Document settings / units / linear dim display precision in order to do this
can anyone assist in the code required to perform this update on all parts in an assembly
TIA
Solved! Go to Solution.
08-29-2023
05:12 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
08-29-2023
05:12 AM
Hi @keithc03GZXH6 . Please try this code:
Sub main
Dim oDoc As Document = ThisDoc.Document
If TypeOf oDoc Is AssemblyDocument Then
For Each oRefDoc As Document In oDoc.AllReferencedDocuments
If Not oRefDoc.IsModifiable Then Continue For
ChengeLengthDisplayPrecision(oRefDoc.UnitsOfMeasure, 1)
Next
Else If TypeOf oDoc Is PartDocument Then
Dim oPartDoc As Document = oDoc
If Not oPartDoc.IsModifiable Then Exit Sub
ChengeLengthDisplayPrecision(oPartDoc.UnitsOfMeasure, 1)
End If
End Sub
Private Function ChengeLengthDisplayPrecision(ByVal oUOfM As UnitsOfMeasure,
ByVal i As Integer)
oUOfM.LengthDisplayPrecision = i
End Function
Andrii Humeniuk - CAD Coordinator, Autodesk Certified Instructor
LinkedIn | My free Inventor Addin | My Repositories
Did you find this reply helpful ? If so please use the Accept as Solution/Like.
08-29-2023
05:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report