Skip to main content
1-Visitor
August 16, 2019
Solved

How to tell if a model is a top assembly?

  • August 16, 2019
  • 2 replies
  • 1807 views

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? 

Best answer by KenFarley

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.

2 replies

KenFarley21-Topaz IIAnswer
21-Topaz II
August 16, 2019

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.

RLEECI1-VisitorAuthor
1-Visitor
August 16, 2019

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.  

1-Visitor
August 21, 2019

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.