Skip to main content
1-Visitor
Aug 16, 2019 2:32 PM UTC
Solved

How to tell if a model is a top assembly?

I could check if a model is an assembly 

 

model.GetType() == ModelType.MDL_ASSEMBLY

However, how can I check if it is top level assembly or just sub-assembly? 

KenFarley
KenFarleyAnswer
21-Topaz II
Aug 16, 2019 5:01 PM UTC

There isn't any data stored in an assembly that indicates what assemblies it is a part of. An assembly only refers to its components, be they parts or further assemblies. It doesn't go the other way. The only place you might be able to get at that kind of information would be in Windchill or a similar data management system. You aren't going to be able to get any information of the sort from a Creo assembly file.

3 replies

KenFarley
KenFarley21-Topaz IIAnswer
21-Topaz II
Aug 16, 2019 5:01 PM UTC

There isn't any data stored in an assembly that indicates what assemblies it is a part of. An assembly only refers to its components, be they parts or further assemblies. It doesn't go the other way. The only place you might be able to get at that kind of information would be in Windchill or a similar data management system. You aren't going to be able to get any information of the sort from a Creo assembly file.

Translate
RLEECI1-VisitorAuthor
1-Visitor
Aug 16, 2019 5:06 PM UTC

Thank you very much. I asked this one because I used to program with NX and I could determine this information by checking for its owner/parent.  

Translate
2-Explorer
Aug 21, 2019 6:50 AM UTC

You might would like to go through "ProAsmcomppath". For top model , it should be -1,-1,-1..... and for other models, asm_comp_path is structure of relative paths.

Translate