Although shattered assembly can be created from some native CAD formats whose sub-components reside in individual files such as CATIA V5, Creo - Pro/E, NX or SolidWorks, it is not possible to create from a monolithic assembly file such as IFC, Revit or 3DXML.
This article introduces a sample which creates shattered assembly from a monolithic assembly file using HOOPS Exchange and LibConverter of HOOPS Communicator. Created shattered parts and master XML file can be loaded using HOOPS Communicator WebViewer APIs:
You can study advantage of the shattered approach over the monolithic workflow from here
Download sample project from here.
shattered.zip (82.6 KB)
READM.MD in downloaded zip file.
This sample imports a monolithic assembly file and traversed it using HOOPS Exchange. The traverse process exports a master XML file and create individual part models. Part models are converter to SC (SCZ) and SCS files using LibConverter of HOOPS Communicator.
Usage of HOOPS Exchange with LibConverter is introduced here
This sample uses Visitor pattern contained in HOOPS Exchange samples to traverse imported model.
Usage of the the Visitor pattern is introduced here
Instanced parts are only represented once but show up multiple times in the hierarchy.
SetTraverseInstance, the Visitor pattern accesses only the first part instance so that it creates a part SC of instanced parts.
A3DVisitorContainer sA3DVisitorContainer(CONNECT_TRANSFO); sA3DVisitorContainer.SetTraverseInstance(false);
It is necessary to create a copy of part ProductOccurrence using
A3DAsmProductOccurrenceDeepCopy before creating individual part PRC.
A3DAsmProductOccurrence* pCopyPO; iRet = A3DAsmProductOccurrenceDeepCopy(pPartPO, &pCopyPO);
(Same part ProductOccurrence cannot be refereed from both master and part model files)