How do you assign a material to a property?
When a part doesn't have a material, but a property has been entered manually, the material corresponding to this property should be assigned to the part. This may be the case when the project comes from a subcontractor, or when, for reasons of simplicity, no care has been taken to assign the right material to the various parts at the time of their creation...
This operation is not very complicated, but if the project involves a lot of parts, it can take a long time. Generally speaking, the same materials are often used, and this can easily be automated.
To make these changes, we'll use the "Integration. Here are the steps to follow:
Step 1:
Select the folder or files to be processed.
Step 2:
Create a first action corresponding to a material (e.g. AISI 1020).
2 conditions must be defined:
- Only process part-type documents.
- Test the presence of a property (e.g. MATERIAL).
Step 3:
Create an operation, meeting the 2 conditions, to change the material of the part. The materials listed correspond to the "material databases" defined in the SOLIDWORKS options.
Step 4:
Repeat action creation as many times as necessary for all materials.
Once the process has been launched, the material assigned to the selected parts is found.
You can find this example of creating "Mat to Mat SOLIDWORKS.mcact" actions in the myCADtools installation directory:
(..\Program Files\Visiativ\myCADtools\Integration\Samples\fr)
This directory contains many more practical examples of how to use the "Integration" tool.
For more details on this tool, see Integration