Message 1 of 7
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am trying to use an old rule that worked for me years ago but am having trouble setting it up again.
The rule utilizes an user parameter that gives the option for the user to select what dimension style to use on a drawing when starting up.
Here is my parameters:
Here is the styles library showing the available options
and lastly here is the rule, I am not sure to why it isn't applying the selected dimension style.
' To use this rule, create a Text parameter named Standard in the drawing.
' Assign it values such as:
' ANSI
' ANSI-mm
doc = ThisDoc.Document
customPropertySet = doc.PropertySets.Item("Inventor User Defined Properties")
'Make sure drawingUNITS property exists
Try
prop = customPropertySet.Item("drawingUNITS")
Catch
'Assume error means not found
customPropertySet.Add("", "drawingUNITS")
End Try
Dim drawingDoc as DrawingDocument = ThisDoc.Document
For Each standardX In drawingDoc.StylesManager.StandardStyles
Dim internalName As String = standardX.InternalName
Do
Trace.WriteLine(" -- internalName = " & internalName)
Dim ch As Char = internalName(internalName.Length-1)
If (ch <> vbCr And ch <> vbLf And ch <> ")" And ch <> " ") Then Exit Do
internalName = internalName.SubString(0, internalName.Length-1)
Loop
Trace.WriteLine(String.Format(" Style: {0}, {1}", standardX.Name, internalName))
If (internalName.EndsWith(Standard, StringComparison.OrdinalIgnoreCase)) Then
drawingDoc.StylesManager.ActiveStandardStyle = standardX
Trace.WriteLine(" --- Changed the active drawing standard to " & standardX.Name & "...")
Exit For
End If
Next
iProperties.Value("Custom", "drawingUNITS") = Standard
InventorVb.DocumentUpdate()
Exit Sub
handleErrors:
'do nothing
EDIT:
I found out that the rule is calling out the ANSI, ANSI-mm from the standard section of the style library, I thought it was pulling the dimension styles from the active standard. Is a way to edit the rule to allow me to select the dimension styles?
Sean Farr
Product Designer at Teksign Inc.
Inventor 2016 SP1
Dell Precision 3660
i7-12700 @ 2.40GHz-4.90GHz
32GB DDR5 4400MHz RAM
NIVDIA RTX A2000 6GB
Product Designer at Teksign Inc.
Inventor 2016 SP1
Dell Precision 3660
i7-12700 @ 2.40GHz-4.90GHz
32GB DDR5 4400MHz RAM
NIVDIA RTX A2000 6GB
Solved! Go to Solution.