Because suppressed components are not loaded into memory, it is hard to get details about IModelDoc2 object. You could un-suppress the components temporary, do what you want and then suppress them again. I know it is not the best way.
Thanks for the input. I had thought of un-suppressing, however some models might take a large amount of time to process that way. I opted to predetermine if it was suppressed or not. Not many should be, but it happens and its a possibility. I switched the suppressed models to look at ComponentArr(i).Name2 to grab the name of the component. All of my standard fasteners names start with "INCH-" or "METRIC-"....so this will work for me in this case. I have additional conditions for other suppressed components.
GetModelDoc - This method return Nothing or null if a component is suppressed or lightweight. Its nothing to do with if its toolbox or other type.
This can be done without removing suppression. You can get full path, name.
Set swComp = ComponentArr(i)
Debug.Print " Comp Name? " & swComp.Name2
Debug.Print " Is suppressed? " & swComp.IsSuppressed
Correct, I'm now using:
For i = 0 To UBound(ComponentArr)
Set swCompModel = ComponentArr(i).GetModelDoc
SupVal = ComponentArr(i).IsSuppressed
If SupVal = True Then...
swComp.Name2 doesn't return full path (which is the location in of the part/ assembly in the directory) as you mentioned, it only returns hierarchical instance path of the component.
- swComp.Name2, returns: Part name and instance Count ...Example: Fastener-1
- swComp.GetPathName, returns Full File Path with Full File Name with Extension ...Example: c:\standards\fastener.sldprt
- swComp.GetTitle, returns: File Name with Extension ...Example: fastener.sldprt