How to get the value of a parameter in a family table instance with VBA?
I have an Excel sheet that lists all of an assembly's components, and a "Part Number" parameter for each component. My problem is, the parameter isn't read if the component is a sub-assembly, or a part that is an instance of a family table.
Does anyone have an example of how to check if the component is a subassembly or FT instance, and if so...how to get a parameter value from it?
Here is a code snippet of how I'm reading the parameter from every componet (which works if its a part)
For iCnt = 0 To (pathArray.Count - 1)
Set eachPath = pathArray.item(iCnt + 1)
Set mdl = eachPath.Leaf
' if model is part
If mdl.Type = EpfcModelType.EpfcMDL_PART Then
iRow = iRow + 1
Range("Components").Cells(iRow, colFileName).Value = mdl.Filename
Set paramOwner = mdl
Set params = paramOwner.ListParams()
For i = 1 To (params.Count - 1)
' Get part number and extrusion
Set param = params(i)
Set paramValue = param.Value
Set paramName = param
If paramName.Name = "PART_NUMBER" Then
PartNumber = paramValue.StringValue
Range("Components").Cells(iRow, colPartNumber).Value = PartNumber
Exit For
End If
Next i
End If
End If
Next iCnt
This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.

