Community
Hello,
I'm trying to run a for loop to check a part's thickness parameter within an assembly but I do not know how to access that parameter from the assembly. Once I check that the thickness does not equal 1/4" I want to assign the sheet metal rule to be user defined. Here is what I got so far:
Dim SheetMetalRule As String = BODY_GAUGE & " " & SHEET_METAL_RULE Dim assyDoc As AssemblyDocument assyDoc = ThisApplication.ActiveDocument Dim partDoc As Document For Each partDoc In assyDoc.AllReferencedDocuments If partDoc.ComponentDefinition.Parameters.UserParameters("THICK").Value = .25 Then Else If partDoc.ComponentDefinition.Parameters.UserParams.Value <> .25 Then ThisApplication.Documents.Open(partDoc.FullFileName, False) SheetMetal.SetActiveStyle(SheetMetalRule) partDoc.Save partDoc.Close End If Next
Hi,
The sheet metal thickness parameter seems to be called "Thickness", so this should work.
Also keep in mind that internally length values are in cm. So you would need to convert it - you could also use UnitsOfMeasure class for that.
doc = ThisDoc.Document MsgBox(doc.ComponentDefinition.Parameters("Thickness").Value)
I hope this helps.
Cheers,