You may use swView.ReferencedDocument to get the model and then get the required values/properties without opening the file. Also for your information, all models referenced by the drawing are opened up in the invisible mode.
Thanks, I have had a small look, and can see to get the material, I would use this command
What command would I use to get the mass of the part. Also how would I tell if it's a part or assembly, as my macro crashes if it's an assembly.
Lewis Russell wrote:
What command would I use to get the mass of the part.
I need to check that, not sure.
Also how would I tell if it's a part or assembly, as my macro crashes if it's an assembly.
You can get the model type and use IF condition to process the macro further.
To get the mass of the part, you can use the following method. You'll have to convert it to an array and get the item at the correct index. It will return the value in kilograms by default so you will have to manually convert that to whatever your units are for comparison.
To check the document type as Deepak suggested, an If statement is needed such as this one: