09-15-2017
03:46 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
09-15-2017
03:46 AM
You can use .Expression or .Value depending on how you want to use the parameter. Bear in mind there's no error testing in the code to see if the parameter exists or not, so you will get an error if it doesn't exist.
' Get the component definition of the currently open assembly.
' This will fail if an assembly document is not open.
Dim doc As AssemblyDocument
doc = ThisDoc.Document
Dim oAsmCompDef As AssemblyComponentDefinition
oAsmCompDef = doc.ComponentDefinition
Dim oComp As ComponentOccurrence
Dim oComps As ComponentOccurrences
oComps = doc.ComponentDefinition.Occurrences
For Each oComp In oComps
If oComp.Name.Contains("part of the part number") Then
value = oComp.Definition.Parameters.Item("myparam").Expression
End If
Next