
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I would like to be able to retrieve a user parameter inside of a source part of a derived part.
I have a code that works, but it does NOT retrieve User Parameters, just regular parameters.
How could I modify it so I can retrieve user parameters as well please?
Note: I made a MsgBox to make sure it would get the user parameter, but it doesn't. The user parameter variable is called "TypePiece" and it is in a text format. Thanks !
oDoc = ThisApplication.ActiveDocument
If oDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents.Count > 0
Dim oDerComp As DerivedPartComponent = oDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents(1)
Dim oDerDef As DerivedPartDefinition = oDerComp.Definition
oDerDef.UseColorOverridesFromSource = False
oDerComp.Definition = oDerDef
oDerPartComp = oDoc.ComponentDefinition.ReferenceComponents.DerivedPartComponents(1)
Dim oDerivedPartDef As DerivedPartUniformScaleDef
oDerivedPartDef = oDerPartComp.Definition
Dim oDerEntity As DerivedPartEntity
Dim oDerPart As Document = oDerComp.ReferencedDocumentDescriptor.ReferencedDocument
If TypeOf (oDerPart.ComponentDefinition) Is SheetMetalComponentDefinition _
AndAlso TypeOf (oDoc.ComponentDefinition) Is SheetMetalComponentDefinition
oDoc.ComponentDefinition.SheetMetalStyles(oDerPart.ComponentDefinition.ActiveSheetMetalStyle.Name).Activate
End If
For Each oDerEntity In oDerivedPartDef.Parameters
MsgBox(oDerEntity.ReferencedEntity.Name)
Next
Solved! Go to Solution.