|
|
Tip #8: Simplifying Material/Surface Property Assignments to Imported CAD Geometry
If you are importing a lot of your geometry from outside CAD programs into ASAP®, instead of using the IGES or GTX translator to do material assignments in the geometry INR file, you can use a $DO loop in an ASAP script to make the assignment. This makes it easier to quickly change the material and surface properties for repeated analysis, or to vary the property in tolerance analysis runs.
To do this, start by separating different material groups into different IGES or GTX files. For example, if you have a CAD file with a reflector and a lens, export a file with just the reflector and another with just the lens. Translate both files using the translator but don't do any material assignment - simply press Enter or select "File-Finish" to create an ASAP INR file. Then use the following ASAP script syntax in your main file:
$READ REFLECTOR.INR
$GRAB 'GROUP' 1 1 NUMOBJS
$DO 1 (NUMOBJS)
{
OBJECT .?
INTERFACE 0.85
ROUGHNESS MODEL 1
REDEFINE COLOR 3
}
$READ LENS.INR
$GRAB 'GROUP' 1 1 NUMOBJS
$DO 1 (NUMOBJS)
{
OBJECT .?
INTERFACE COAT BARE AIR ACRYLIC
ROUGHNESS MODEL 2
REDEFINE COLOR 4
}
Scripting the material and surface assignments in this matter allows the properties to be changed easily in the script and/or made into variables that can be randomized for tolerance analysis.
Bonus tip: When building complicated CAD models, you are most likely separating your objects into layers. Get into the habit of making a new layer for each optical property in your CAD model, and you will have a head start on exporting your system for analysis in ASAP. Think of these layers as "optical property layers". Turn them on one at a time as you export your model, then follow the above instructions for applying optical properties to the pre-partitioned IGES or GTX files you created.
该贴已经同步到 asdoptics的微博 |
|