Managing Part Relations / Hierarchies from Solidworks to 3DVIA Studio

As more and more people are discovering, importing geometry from Solidworks into 3DVIA Studio to create real time user applications is a relatively easy process through the commonly shared 3dxml 3D model format. However, more information than just the geometry is often needed to make a model interact realistically with the user.  Two important pieces of information that need to stay intact between the exchange of software is “where is the pivot point for each of my parts,” and “how do my parts move in relation to each other.” This article will detail how to answer both of those questions when exporting 3dxml CAD models from Solidworks then importing them into 3DVIA Studio.

First, we will define what exactly “pivot points” and “part relations” mean when working inside of 3DVIA Studio, and why they are important. Having the pivot point correctly defined in 3DVIA Studio is very important, especially for any parts that need to rotate. For example, in the case of the door below we can see that the handle rotates because the pivot point is located directly in the center of the base of the handle.

         

If the pivot point were in a different position, the door handle would appear to orbit around that position rather than turn how it is supposed to when rotated. Parts can maintain the correct pivot points from Solidworks to 3DVIA Studio, as long as you are mindful of the origin while working in Solidworks. Additionally, how different parts move in relation to each other is also very important. In the case of the door, I have the frame, door, door handle base, and door handle all modeled as separate parts in Solidworks. Once imported into Studio, when the door frame is moved I want the door, door handle base, and door handle to move with it. Likewise, when I rotate the door I want the door handle base and door handle to rotate with the door.

         

In Solidworks this would be managed by defining different mating information between the parts. However, this information does not translate into 3DVIA Studio because it uses a much different method of keeping different parts together known as hierarchies, or parent/child relationships. This article will cover how to ensure the pivots of your parts stay where you want them, and how to manage the hierarchy of your parts so they stay together when moved and rotated.

You may use the link below to download the basic Solidworks door model we will be working with in this tutorial.


Note: You will need Solidworks 2011 or later to open the project

The first step in preparing a Solidworks model to be exported for 3DVIA Studio is to save all parts that we want to move together into assembly files. Even if your model is very simple and the assemblies will only have one part, such as is the case with the door, we want to be working on the assembly / sub-assembly level, and not dealing with any actual part files. In the door project folder, we can see that each individual part has been put into its own assembly file.



Note: It is recommended to use a prefix or suffix in your file naming to differentiate between parts and assemblies, as the difference won’t be as clear once working in 3DVIA Studio 

 When creating the assembly, it’s very important to make sure that the assembly’s origin is where you want the pivot point for the part(s) to be. With the door, each part’s origin is where the pivot should be, so it’s as simple as creating a coincident mate between the origin of the assembly and part.

Handle assembly

Door assembly

Once all parts have been grouped together in assemblies with the origins set in the correct place, it’s time to create a “master” assembly to establish the hierarchy of all of the assemblies. With the door project, there is already a “master” assembly that simply has each part’s assembly imported into it and positioned correctly, which we can use to start from. If you are creating your own master assembly, you will have to spend a little time positioning all your part assemblies as you want them. Feel free to use mates to aid in this process, as they will have no effect on your final export for 3DVIA Studio.


Master assembly

Once everything is positioned well inside of Solidworks we can begin creating the hierarchy for the assemblies for use in 3DVIA Studio. Because we are dealing with assemblies at this point rather than individual parts, it is as simple as dragging and dropping the assemblies onto each other in the “Feature Manager” list. The part that was dragged becomes the child, and the part that was dropped on becomes the parent. Begin by dragging the “doorHandleAsem” onto the “doorHandleBaseAsem.” Then, drag the “doorHandleBaseAsem” onto the “doorAsem.” Finally, drag the “doorAsem” onto the “doorFrameAsem.” 

Finally, do a “Save As” and select 3dxml as the file type for your export to 3DVIA Studio. Once the 3dxml file is imported into 3DVIA Studio, we can see the hierarchy and the pivot points are as we defined them within Solidworks.

That covers it for how to manage pivot points and hierarchies from Solidworks to 3DVIA Studio. Remember, the door was only a basic model used for example, but the same principles can be used to manage a model with many, many more parts. Just make sure to group the parts into assemblies, be mindful of the origin (pivot) of those assemblies, and set up parent/child (sub-assembly) relationships between your assemblies in one master file to export the 3dxml for 3DVIA Studio.