cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

How to tell if a model is a top assembly?

SOLVED
Highlighted
Participant

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? 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to tell if a model is a top assembly?

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 3

Re: How to tell if a model is a top assembly?

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.

Re: How to tell if a model is a top assembly?

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.  

Re: How to tell if a model is a top assembly?

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.