XML Assembly Tree Format

HOOPS Converter can parse a model file, assign unique IDs to each part, and build an XML file based on that data. You can then correlate the model parts with your external data and incorporate it into HOOPS Web Viewer using those unique IDs. The XML file is generated during the conversion process if HOOPS Converter is passed the output_xml_assemblytree argument.

Generating XML Data

The following will generate an XML file called my3dModel.xml based on the model in my3dModel.CATPart.

converter --output_sc "models/my3dmodel" --output_xml_assemblytree "my3dModel.xml" --input "c:\temp\my3dModel.CATPart"

XML Data Format

Below is a snippet from an XML file generated by HOOPS Converter. Note the flat structure of the file. The developer is responsible for parsing the XML.

<!--HC 4.0-->
<Root>
    <ModelFile Name="_micro engine" ModellerType="3" Unit="1" UnitFromCAD="0" VM="9" Vm="0">
        <ProductOccurence Id="3" Name="HOUSING" PersistentId="2" Layer="65535" Style="65535" Behaviour="1" FilePath="D:\webgl\SampleModelsForInitalDemo\Micro_engine_CV5/housing .CATPart" ModellerType="3" ProductLoadStatus="4" ProductFlag="2" Unit="1" UnitFromCAD="1">
            <PartDefinition Name="HOUSING" PersistentId="2" Layer="65535" Style="65535" Behaviour="1">
                <RepItem SCKey_Mesh="1" Name="MechanicalTool.1" PersistentId="9" Layer="65535" Style="1" Behaviour="1">
                    <Transformation RelativeTransfo="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1" />
                    <UserData Title="CV5FACENAME">
                        <UserValue Type="String" Value="EdgeFillet.71396" />
                    </UserData>
                </RepItem>
            </PartDefinition>
            <Transformation RelativeTransfo="1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1" />         
        </ProductOccurence>
        <ProductOccurence Id="2" SCKey_Instance="1" InstanceRef="3" Name="HOUSING(HOUSING.1)" PersistentId="4" Layer="65535" Style="0" Behaviour="1" FilePath="D:\webgl\SampleModelsForInitalDemo\Micro_engine_CV5\_micro engine.CATProduct" ModellerType="3" ProductLoadStatus="0" ProductFlag="0" Unit="1" UnitFromCAD="0">
            <Transformation RelativeTransfo="1 0 -0 0 -0 1 0 0 0 0 1 0 21.5 -0.5 -0.31000000000000227 1" />          
        </ProductOccurence>

Each part of the model is associated with a <ProductOccurence> tag in the XML. The part name and file path identifiers will already be known to you. You simply need to associate either identifier with the ID generated by HOOPS Converter (represented by the XML Id attribute). You can use this ID via APIs in the HOOPS Web Viewer to control object properties, the HOOPS Web Viewer also returns this ID when responding to a query or selection event.

We export as much data as possible to the XML file. Here are the definitions of some of the more important tags:

Below is the table of values for the ModellerType flag:

ModellerType       Description
0 Unknown
1 Retired
2 CatiaV4
3 CatiaV5
4 Retired
5 NX
6 Parasolid
7 Retired
8 Retired
9 IGES
10 Retired
11 VDA-FS
12 STL
13 VRML
14 Retired
ModellerType       Description
15 ACIS
16 ProE
17 Retired
18 STEP
19 I-DEAS
20 JT
21 Retired
22 SolidWorks
23 CGR
24 PRC
25 XVL
26 Retired
27 Retired
28 Retired
29 3DXML
ModellerType       Description
30 Inventor
31 Retired
32 PDF
33 U3D
34 IFC
35 Retired
36 Retired
37 Solid Edge
38 OBJ
39 Retired
40 Retired
41 3DS
42 Retired
43 Rhino
44 XML

Below is the table of values for ProductFlag:

ProductFlag Description
0x0001 Default container, configuration or view
0x0002 The product occurrence is internal. Only used when the product occurrence has no father.
0x0004 The product occurrence is a container.
0x0008 The product occurrence is a configuration.
0x0010 The product occurrence is a view.
0x0100 The configuration does not include the model data or the model data is not up to date.

Connecting HOOPS Web Viewer

How do you use the ID attribute to show your data in HOOPS Web Viewer? There are many ways to do this, and you are free to choose the one most suitable for your application. A common example use case is as follows:

  1. Model file is processed by HOOPS Converter, and the XML integration file is generated
  2. Developer parses the XML file and creates a mapping between each part of the model and corresponding external data. He does this by correlating the HOOPS Converter ID with either the part name or model file path.
  3. Developer writes logic to retrieve data in response to user interaction in HOOPS Web Viewer. If you're storing your data locally, this could entail looking it up in a data structure. You could also make a call to a remote database or web server.
  4. Developer calls the appropriate API functions to display the external data in HOOPS Web Viewer.