CADLink is available as a separate asset in the Unity Asset Store and it is included in the Game4Automation Professional package. CADLink is able to import 3MF files and STEP files into Unity. STEP is a de facto standard for 3D CAD data and more or less all CAD Systems are able to export STEP files.
Advanced tools for working with large assemblies like Selection Window, CAD Checker or CAD Updater are only included in Game4Automation Professional. CADLink as a standalone solution only supports what is described on this page.
Please check also the Youtube video, which demonstrates CADLink: https://youtu.be/yXwn6m8ilHE
After installation, you will find CADLink under Assets>CADLink, if you are using it as a stand-alone asset or you will find it under game4automation>private>CADLink
The folder structure looks like this:
In the folder Samples you find a sample scene which is importing the ToyCar example as a 3MF file and another scene based on a STEP file.
To import 3D data into your scene you need to drag and drop the CADLink prefab into your scene or you can use in Game4Automation Professional the Menu game4automation > Add CADLink (Pro).
You are now able to import your CAD assembly as a sub-hierarchy into the CADLink top node. It is possible to include in one scene multiple CADLink interfaces if needed.
The import is always done into the scene itself as meshes in child objects under the CADLink top node. No prefab is created and the meshes are only present in the scene itself. If you would like to create a prefab you could use Unity’s FBX exporter (see https://docs.unity3d.com/Packagesemail@example.com/manual/exporting.html) after importing into the scene.
With CAD Updater you can update your scene data based on a new version of the CAD file without losing anything that you added to the Gameobjects inside the scene. This is a semi-automated process. Before updating you can check changes that are going to be performed by the update.
CAD Updater is attached and started automatically if there is already something existing under CADLink when you start the CADImport. If you don’t want to perform an update you must manually delete all Data which have been imported before.
For more information please read the section CAD Updater.
To import STEP files is the recommended way for reading data of CAD Systems. When importing Step files the tessellation is done within Unity.
STEP file import is only possible in the Unity Editor and not during Unity Play mode.
The STEP import settings are very simple:
The file (.stp or .step) to import.
Removes the top assembly node, which is a Gameobject with the name of the imported file.
The scale factor of the import. 0.001 corresponds to one Unity Unity equals 100mm.
You can select 4 different quality modes for the mesh tesselation (High, Medium, Low and Custom). By selecting Custom a custom angular and chordal deflection can be defined for the Mesh algorithm.
Usually, the Step import applies a standard material with an Albedo value corresponding to the color in the Step file. Another option is to map the colors defined in the Step files to Unity Materials. To do this it is necessary to define a Material mapping where you need to select the color value of the Step color and the corresponding Material.
Some CAD Systems like Solidworks, Solidedge, ProE / Creo and NX are able to write 3MF Files. Please check your CAD System documentation to see if your system is also able to write 3MF Files.
The advantages of 3MF files are:
No known limitations. Solidworks exports everything correct (assembly structure, colors and materials).
No known limitations. Solidedge exports everything correct (assembly structure, colors and materials).
Please use this export options:
You can use this solution to write 3mf files:
Colors and assembly structure is not exported correct (flat structure without colors).
No known limitations
NX is exporting currently no assembly structure. Colors are exported. We will provide a work around in a NX macro which we are going to release soon.
In the Inspector you can check and change the CADLink settings:
You can type in the relative or absolute File path or you can select the file path by pushing on the button Select CAD Import File
This deletes the old imported data automatically when importing once again.
Removes the top assembly node when importing the CAD data. This means that CADLink object is acting like the top assembly node.
If clones (multiple occurrences of an identical part in the assembly structure) you can name all of the same or you can let the importer add a number in brackets to the imported name.
The scale factor for the import. Normally, if one unit in Unity means for you 1 meter and you are exporting the 3mf file in millimeters this should be 0.001.
Defines that Unity should recalculate the normals. We recommend to turn that off.
Lets the importer to recalculate the normals and - if needed - to combine the separated vertices again to one. The calculation is done based on the angel between the triangle surfaces. If the angle is above the defined angle (in Degrees) an edge is created (with separated vertices). This gives a sharp edge shading. If the angle is below the vertices are combined and a normal is calculated which gives a smooth edge.
See the difference in this pictures.
With recalculated normals:
Without recalculated normals:
This option takes some time when importing. So please just turn it on when needed.
You can calculate UVs automatically for mapping material textures on the surface. You can change the UV scale factor.
With scale factor 0.01:
With scale factor 1:
Usually during the import new materials are created - if not existing - based on the naming of the imported color. You can change these materials if needed.
Another option is to define a Material Mapping. This will map a given material to a certain imported material and color name combination.
You can start the material assignment independent from the import by pushing the button “Update Materials”. In the import process the materials are automatically updated.
If turned of no materials are created during import.
If a material which is currently imported already exists it will be overwritten.
Defines the path where the new imported materials should be created.
Defines the Material mapping table. You can have in your project multiple material mapping tables. To create a new one and to automatically assign the new one to the CADLink object just press the button Create New Material Mapping
In the Material Mapping settings you can define a color and/or a material name and assign this to a Unity material.
CADLink checks the assignment in the following order:
You can import 3MF files also during runtime. During runtime import materials are not created in the Material Assets. For changing materials you must provide before importing during runtime all materials with a corresponding Material Mapping.
public class DemoImportRuntime : MonoBehaviour