To traverse the instance definition to get geometry only once

Hello guys,
I want to export Rhino model to Parasolid.
While traversing Rhino model I am getting instance reference object. I have added code to iterate instance definition block to get geometry for instance reference. While traversing I am facing problem that each instance reference object have UUID for instance definition. If instance definition have instance reference as geometry then I am getting same geometry again and again please refer the below image.
04-12

Could you please help me to traverse the instance definition to get geometry only once.

Hi @psomesh94,

Let me know of the attached is helpful (or not).

cmdTestPsomesh94.cpp (3.2 KB)

– Dale

Thank you for sharing the sample code, we have used Rhino document for iterating instance definition https://developer.rhino3d.com/guides/opennurbs/traverse-instance-definitions/

We are facing problem in finding whether the underlying object is an assembly or it is a part. Is there any way to find out the same.
Like in the above snapshot the block ‘Assemblage_PE_PG’ has reference of all the parts mentioned in the section highlighted in purple color. So if I traverse only ‘Assemblage_PE_PG’ then I am able to get the complete model. But the code that you have is traversing all the items present in the block table due to which I am getting geometries again and again.

Hi @psomesh94,

Rhino does not have parts and assemblies.

Can I assume that an assembly, to you, is an instance definition that is not referenced by any instance object used by another instance definition, and that a part is an instance definition that is referenced by an instance object used by another instance definition?

This is incorrect - the code I posted above only traverses the instance definition that you specify.

– Dale