Cad Data Translators
Cad Data Translators
V21.0.x
Table of Contents
Section 1.
Introduction to the CAD to ANSA Translators
& supported platforms
1.1. General
The CAD to ANSA Translators developed by BETA CAE Systems are a part of the complete BETA suite.
The supported CAD-data formats handled by the CAD to ANSA Translators are listed below:
Pro/ENGINEER (from WF 3 to WF 5)
PTC Creo Parametric 2.0 M140
PTC Creo Parametric 3.0 M020
PTC Creo Parametric 3.0 M030
PTC Creo Parametric 3.0 M040 [.prt] and [.asm]
PTC Creo Parametric 3.0 M090
PTC Creo Parametric 4.0 F000
PTC Creo Parametric 5.0
PTC Creo Parametric 6.0
CAD-data translation can be achieved through command-line, scripts or through a graphical user
interface (GUI) that integrates the different translators and their respective options into a single
environment. Details on these are given in later paragraphs.
Windows
32 bit NO NO NO NO
NX (NXOpen based)
The translation of NX files with the use of NXOpen libraries requires a valid NX installation, which
must be accessible by the machine performing the translation.
Parasolid (NXOpen based)
The translation of parasolid files with the use of NXOpen libraries requires a valid NX installation,
which must be accessible by the machine performing the translation.
JT (NXOpen based)
The translation of JT files with the use of NXOpen libraries requires a valid NX installation, which
must be accessible by the machine performing the translation.
JT
The translation of JT files on Windows systems requires the run-time components of the Microsoft
Visual C++ 2005 SP1 Redistributable Package, version 8.0.50727.762 or any later updated version.
1.3.1. Notes regarding incompatibilities that may occur with some outdated Windows platforms
On some older or outdated Windows platforms, specific system errors may pop up when trying to perform
a translation or even launching the translator's user interface. These system errors usually inform the user
for some missing system libraries. This is usually due to the fact that some Microsoft Visual C++
Redistributable Packages might be missing from the operating system. These need to be installed on
the platform as well, and users are prompted to download these from Microsoft's website:
Windows 32bit:
Do a search for "Microsoft Visual C++ 2005 Redistributable Package (x86)".
Windows 64bit:
Do a search for "Microsoft Visual C++ 2005 Redistributable Package (x64)".
Windows 32bit:
Do a search for "Microsoft Visual C++ 2008 Redistributable Package (x86)".
Windows 64bit:
Do a search for "Microsoft Visual C++ 2008 Redistributable Package (x64)".
Windows 32bit:
Do a search for "Microsoft Visual C++ 2010 x86 Redistributable Package".
Windows 64bit:
Do a search for "Microsoft Visual C++ 2010 x64 Redistributable Package".
By default, the latest version of NXOpen libraries installed are used by ANSA. In case more than one NX
versions are installed in the machine performing the translation, the UGII_BASE_DIR and
UGII_ROOT_DIR environment variables can be edited and set to point to the desired NX version.
PTC Creo
NX/ Parametric Core
CATIA V4 CATIA V5 (Pro/
SolidWorks JT Inventor
Technologie
Parasolid
ENGINEER)
Included in the
Standard ANSA
package; no extra YES -- YES -- -- -- YES YES
license/ fee is
required
Additional feature is YES YES YES YES
required. feature adds feature adds (requires the feature adds
-- an extra of -- an extra of CATIA V5 an extra of -- --
See notes for 25 credits 100 credits feature) 25 credits
details (not shared) (not shared) . (not shared)
PTC Creo
NX/ Parametric Core
CATIA V4 CATIA V5 (Pro/
SolidWorks JT Inventor
Technologie
Parasolid
ENGINEER)
Note:
All additional features are marketed separately upon request and require additional PO, fee
and license keys.
Section 2.
Installation of the CAD to ANSA Translators
2.1. Installation of the CAD to ANSA Translators
The CAD to ANSA Translators are installed along with the BETA Suite [ANSA-EPILYSIS-META software
products]. The entire BETA Suite is installed using a single installation file. The appropriate one must be
selected for download, depending on the operating system on which the installation process will take
place.
By default, all features of the suite are selected for installation (ANSA, CAD to ANSA Translation, ANSA
NX Translation, ANSA JT Translation, META, etc.), but it is possible to selectively disable the
unnecessary ones during the installation process.
Please refer to the BETA Suite Set-Up Guide pdf document for complete and detailed instructions on
installing our complete software suite.
2.1.1. Notes regarding incompatibilities that may occur with some outdated Windows platforms
On some older or outdated Windows platforms, specific system errors may pop up when trying to perform
a translation or even when launching the translator's user interface. These system errors usually inform
the user for some missing system libraries. This is usually due to the fact that some Microsoft Visual
C++ Redistributable Packages might be missing from the operating system. These need to be installed
on the platform as well, and users are prompted to download these from Microsoft's website:
Windows 32bit:
Do a search for "Microsoft Visual C++ 2005 Redistributable Package (x86)".
Windows 64bit:
Do a search for "Microsoft Visual C++ 2005 Redistributable Package (x64)".
Windows 32bit:
Do a search for "Microsoft Visual C++ 2008 Redistributable Package (x86)".
Windows 64bit:
Do a search for "Microsoft Visual C++ 2008 Redistributable Package (x64)".
Windows 32bit:
Do a search for "Microsoft Visual C++ 2010 x86 Redistributable Package".
Windows 64bit:
Do a search for "Microsoft Visual C++ 2010 x64 Redistributable Package".
Section 3.
Using the CAD to ANSA Translators
3.1. Command-line driven translation
The CAD to ANSA Translators are launched by running the appropriate executable file. Depending on the
platform open a command shell/ prompt and type in the following :
Platform Command
Linux/ Mac OS
Windows
Platform Command
Linux/ Mac OS
Windows
where -i is the input CAD-data file and -o is the ANSA database filename to be saved (optional). The
option -odir can also be used in order to state the directory where the ANSA files will be saved (optional).
The default output directory is the same as the source directory.
Important Note:
On Windows platforms please make sure that the paths you insert in your command prompt
do not contain blanks. In case your paths contain blanks then you have to include your
absolute paths inside quotes (" "). Otherwise you will get an error and no translation will be
performed.
WARNING:
A directory named "work" is generated temporarily in the user’s home directory everytime the ansa_cad
executable is run. This directory is generated by our vendor’s libraries (CoreTechnologie libraries) and its
generation is necessary for the unhindered operation of the translator in conjunction with the CT libraries.
The following environment variables are searched sequentially, in order to find a place for this directory to
be temporarily generated:
TMP,
TMPDIR,
TEMP,
TEMPDIR,
HOME,
PWD
The first environment variable to be found is the location to be used for the temporary generation of this
directory. Towards the end of the translation process, this directory is automatically erased by the
translator. Therefore, it is highly unlikely for this directory to be noticed by the user as a left over from the
translation.
Notes:
1. - There is no restriction regarding the format of the selected CAD files. Different types of CAD
format files can be selected at once and added in the list of files to be translated.
2. - Selecting to read a PLMXML file will automatically extract and add all the CAD files referenced
in the PLMXML file in the list of files to be translated.
Notes:
Basically, the layout of the right vertical section actually directs the user to the final two steps he will have
to go through when performing a translation process:
The equivalent python code and command line options to the selected translation options can be seen at
any time simply by pressing the "Script/Cmd >" button. The automatically generated code snippet can be
readily used inside an external python script and the command line options can be readily used in a
command in the case the user is performing the same translation via a command prompt.
The translation options that have been selected can be saved in the translators.defaults file, so that
they can be used again in future translation jobs. This can be done simply by pressing the Save settings
button which exists in Tools>Preferences. The translators.defaults file is saved in the directory:
/home/user/.BETA/Translators/version_17.0.0/
Additional settings which affect the translation process can be found under Tools>Preferences.
These "preferred" settings are not directly accessible like the translation options, since they may not be
frequently changed between translation jobs. For example, specifying the location where the translated
files are going to be saved. By default, the translated files are saved in "the same directory with source
file(s)", but there is also the option to specify a different destination directory ("a single directory") or a
single output file ("a single ANSA file").
The destination directory can also be specified by directly editing the line fields under the "Destination file
path" column. If the "Destination file path" column is edited directly, then this takes precedence over the
setting in the Preferences>Settings>[Destination output] card.
As already mentioned, the translator offers the option to translate several of the supported CAD formats
with different translation libraries. The preferred libraries that the translator will be using for the translation
of these formats must be set prior the translation process through the File associations card.
Moreover, the interface offers the option to set up additional actions to be executed after the translation of
each part file or to be executed once after all part files have been translated. These additional actions
must be in the form of script functions described in script files. These custom scripts can be loaded
through the Post Actions card.
Accordingly, if additional treatment needs to be performed after the translation of each part file, then the
user would have to activate the "Per part" option, load the script file and finally select the function to be
executed. The list of available functions is automatically populated as soon as the script file is loaded. In
this case, the post script function needs one single argument, the part itself.
If additional treatment needs to be performed only once after all part files have been translated, then the
user would have to activate the "For all parts" option, load the desired script file and finally select the
function to be executed. The list of functions is automatically populated as soon as the script file is
loaded. When using this option the post script function needs no arguments at all.
Additional settings, which affect the database that will be finally saved are the Resolution, Tolerances and
Units values. These can be found in the Resolution/Tolerances/Units card.
In case a translation process needs to be performed with specific resolution and tolerances values, then
the preferred values need to be set here before the translation process starts.
Important Note:
These values are different from the Resolution and Tolerances values used by ANSA. The values
set here are used only whenever a translation process is taking place, whether the translation is
performed when a CAD file is opened in ANSA or whether the translation process is performed
via a script.
Important Notes:
1. - The options that affect the translation are the options used in the command-line plus the options
that are set within the translators.defaults file.
2. - The following terminal command brings up a list of all the available translation options:
On Unix platforms
../ansa_v17.0.0/ansa64.sh -help --cad-options
or
../ansa_v17.0.0/ansa_cad.sh -help --cad-options
On Windows platforms
../ansa_v17.0.0/ansa64.bat -help --cad-options
or
../ansa_v17.0.0/ansa_cad64.bat -help --cad-options
I/O
[ -idir indirname ] CATIA ONLY: where to read CATIA files from.
The directory where the ANSA files will be saved (optional)
[ -odir outdirname ]
(Default directory is the same as the source directory).
3.3.2. Options controlling what to read from the CAD data file
Command-line option Description
[ -read_noshow ] Read hidden entities.
[ -notread_noshow ] Do not read hidden entities (default).
[ -layer #ln1,#ln2,... ] Read entities only from these layers. ( ie. -layer 1,2,3 )
[ -xlayer #ln1,#ln2,... ] Do not read entities from these layers. ( ie. -xlayer 1,2,3 )
[ -layer_vis ] Read entities only from visible layers.
[ -notlayer_vis ] Read entities from all layers (default).
Read any extra attributes of entities, which may have been defined
[ -read_attr ]
in the native CAD files.
Do not read any extra attributes of entities, which may have been
defined in the native CAD files. (This is the default for all entities
[ -notread_attr ]
except from ANSA Parts and Properties. The attributes of Parts
and Properties are read by default.)
[ -read_anno ] Read annotations which may have been defined in the model.
[ -notread_anno ] Do not read annotations (default).
CATIA option only : Read any CATIA publications which may exist
[ -publications ]
in the CATIA file.
[ -notpublications ] CATIA option only : Do not read CATIA publications (default).
[ -freegeom ] Read free geometry (free surfaces).
[ -facetted_data all ] JT option only : Read all data which exist in the facetted data
container (read facets, points and curves).
[ -geom_mode solids ] JT option only : Read only the solids of an XTBrep model.
[ -geom_mode shells ] JT option only : Read only the shells of an XTBrep model.
JT option only : Read both the solids and the shells of an XTBrep
[ -geom_mode both ] model (default).
3.3.3. Options controlling how to read the contents of the CAD data file
Command-line option Description
IMPORTANT:
1.- Regarding the [ -flatten ] flag:
- If active, then a single ANSA DB will be created containing the parts of the CATIA
Session/Product file in the correct position and with all instances.
- If not active, then each part referenced in the CATIA Session/Product file will become a
separate ANSA DB. In addition one more "master" ANSA DB will be created having the name of
the Session/Product file. This "master" ANSA DB is empty of any geometry, and contains only the
assembly structure described in the Session/Product file. In this case, if a user desires to recover
the complete assembly of the Session/Product file, he should follow these actions:
(a) open the "master" ANSA DB
(b) merge the ANSA DBs of the individual parts into the "master" ANSA DB, activating
the "auto position parts" flag
(c) open the Part Manager and "synchronize" the merged parts in order to get the correct
instantiation.
2.- The [ -layer ] and [ -xlayer ] options are mutually exclusive.
3.- The [ -singlepid ], [ -lay2pid ], [ -col2pid ], [ -part2pid ] options are mutually exclusive.
4.- The [ -free_geom ] and [ -read_construction_surfaces ] options must be used to translate CATIA V4
files that contain free surfaces with "no loops" (which are essentially untrimmed surfaces). Otherwise the
message "Faces with zero loops" appears and no face is created and the result might be empty ANSA
databases.
5.- In NX assemblies, a Part having the name of the *prt file plus the word "GEOM" at the end, specifies
the geometry lying in an assembly or subassembly. NX permits the use of geometry within an assembly
file together with links to other parts.
translated data
[ -notclean_geo ] Do not try to clean the geometry (default).
[ -respect_file_topo ] Respect the topology info found in the CAD file (default).
[ -notrespect_file_topo ] Do not respect the topology info found in the CAD file.
[ -heal ] Force healing of model. Currently NOT saved in the ANSA.defaults file.
[ -notheal ] Do not use any healing function. Currently NOT saved in the ANSA.defaults file (default).
[ -log ] Create log file, named as: <name of file>_<unique system id>.log. (default) See note.
[ -notlog ] Do not create log file.
Options listed here are passed to ANSA_TRANSL and can be used to call user defined
[ user options ]
functions that affect the translation. See note.
When used, an ANSA file containing the assembly structure but NO geometry will be
[ -preview ] / [ -notpreview ]
created. (default is -notpreview).
m = ProgramArguments();
len = MatLen(m);
for(i=0;i<len;i++)
{
Print(m[i]);
if(MatchString(m[i],"do_it"))
my_routine();
}
IMPORTANT:
During CATIA to ANSA translation, the translator will "connect" individual faces using the topological
information (if any) already described in the CATIA file, and then will apply uniform orientation based
on the rules above. However, in case of doubt about the existence of topology information within the
CATIA file, it is strongly suggested to use the [ -perf_topo ] option in order to get uniform orientation.
The orientation options are discussed in this paragraph with the aid of the following three examples:
Warning:
The orientation of faces might be applied incorrectly, if the material vector is found near the edges of a
face and not in the middle of the face.
Note:
The distance between the two parallel
lines indicates the thickness of the part.
3.3.7. A note on the translation of NX files by using the NXOpen based translator
In order for the NXOpen-based translator to work properly with assemblies, you need to inform the
translator about which directories to search, in order to find the files that make up the assembly. There
are three ways of specifying the search directories:
a) By defining the UGII_SEARCHDIRS environment variable. Lists all the directories, just like
windows paths.
b) By defining the UGII_DIRFILE environment variable, i.e. specifying the name of a file which
contains the directories (one directory in each line of the file).
c) By specifying the directories through the graphical user interface of the translator. Option named
"Directories".
The translator tries these three options sequentially. The first time it succeeds, it stops looking for the
next option. That is, if the UGII_SEARCHDIRS environment variable is found, the translator does not
look for the UGII_DIRFILE environment variable.
3.3.8. A note on reading extra attributes, which have been defined inside native CAD files
This information is usually extra attributes like names of Parts, Properties, Materials, Curves and Points.
The attributes of Parts and Properties are always read by the translator by default. For all other entities
(free geometric entities), the user must use the option "Read attributes" in combination with the option
"Read free geometry". The equivalent shell command options are [ -read_attr ] and [ -freegeom ].
These extra attributes will be written into the "Comment" field of the corresponding ANSA entity card
with the form:
…
ATTRIBUTE: sample filled in text
Value: sample filled in text
…
By using an ANSA_TRANSL script file, the user can then retrieve the value of interest from the
"Comment" field and assign it to the respective field of the corresponding ANSA entity card. For further
details and examples of ANSA_TRANSL.py script files, please also refer to the API documentation which
is available within ANSA in the form of html pages.
TRANSL_FLATTEN_ASSEMBLIES = false
TRANSL_PREVIEW = false
TRANSL_LOG = true
TRANSL_SINGLE_PART = false
TRANSL_FEATURE_MODE = false
TRANSL_HIDDEN = false
TRANSL_LAYER_VIS = false
TRANSL_INCLUDE_LAYERS = false
TRANSL_INCLUDED_LAYERS =
TRANSL_EXCLUDE_LAYERS = false
TRANSL_EXCLUDED_LAYERS =
TRANSL_INCLUDE_CATEGORIES = false
TRANSL_INCLUDED_CATEGORIES =
TRANSL_FREE_GEOMETRY = false
TRANSL_ATTRIBUTES = false
TRANSL_ANNOTATIONS = false
TRANSL_PUBLICATIONS = false
TRANSL_GENERATE_3D_CURVES = false
TRANSL_CONSTRUCTION_SURFACES = false
TRANSL_ANSACOLOR = false
TRANSL_PART2PID = false
TRANSL_LAYER2PID = false
TRANSL_COLOR2PID = false
TRANSL_SINGLEPID = false
TRANSL_SINGLEPID_VALUE = 1
TRANSL_CREATE_VOLUMES = true
TRANSL_CREATE_SETS = false
TRANSL_ORIENT_VEC = false
TRANSL_ORIENT_VEC_VALUE = 1
TRANSL_THICKNESS_LINES = false
TRANSL_THICKNESS_LINES_VALUE = 1
TRANSL_MATERIAL_VECTOR = false
TRANSL_MATERIAL_VECTOR_VALUE =
TRANSL_EXTERN_HEAL = false
TRANSL_PERFORM_TOPOLOGY = false
TRANSL_TOPO_BETWEEN_LAYERS = false
TRANSL_TOPO_BETWEEN_PARTS = false
TRANSL_RESPECT_FILE_TOPO = true
TRANSL_GEOMETRY_CLEAN_UP = false
TRANSL_TIMEOUT = false
TRANSL_TIMEOUT_VALUE = 1
TRANSL_EXTRA_OPTIONS = false
TRANSL_EXTRA_OPTIONS_VALUE =
TRANSL_REPRESENTATION = COMPARE
TRANSL_FILTERS = all
TRANSL_READ_MODE = both
TRANSL_LOD = 0
TRANSL_GEOM_MODE = both
TRANSL_WIREFRAME = false
TRANSL_PMI = false
TRANSL_FACETTED_DATA = 1, 0, 0
TRANSL_NTOLERANCE = 0.05
TRANSL_CTOLERANCE = 0.02
TRANSL_TOLERANCE_MODE = middle
TRANSL_CURVES_RESOLUTION = 10
TRANSL_PERIMETER_LENGTH = 20
TRANSL_DISTORTION_DISTANCE = 20%
TRANSL_DISTORTION_ANGLE = 50
The above default settings can also be edited from within ANSA ( Windows>Settings>Translators ) by
selecting the preferred options and by clicking on the Save settings>[ Translators ] button.
The effect of the translators.defaults file is reflected in two levels: (a) in a level that refers to "what is read
from the CAD-file" and (b) in a level that refers to "topology actions taken in ANSA":
(a) The translators.defaults settings that control "what is read from the CAD-file" are:
GUI-driven translation
translators.defaults setting Command-line translation option
option
1. TRANSL_LAYER_VIS "Read visible layers" [ -layer_vis ] / [ -notlayer_vis ]
TRANSL_INCLUDED_CATEGORIES [ -categories ]
7. "Categories"
ie. -categories <c1>,<c2>,…
[ -layer_filters default ] /
[ -layer_filters all ] (default) /
TRANSL_FILTERS [ -layer_filters "specific filters" ]
8. "Layer filters"
names of specific filters must be inside
("double quotes") and separated by
comma (,))
[ -read_mode ]
9. TRANSL_READ_MODE "Read mode"
"geometry" reads geometry only,
"facets" reads facets only,
"both" reads both (default)
[-read_lod ]
10. TRANSL_LOD "Level of detail (LOD)"
"all" reads all the LODs,
"(number)" reads the specific LOD
[-geom_mode ]
"Read facets"
[ -facetted_data all ]
"Read curves (from
TRANSL_FACETTED_DATA "all" reads all data which exist in the
14. facetted data container)"
facetted data container (i.e. facets,
points and curves).
"Read points (from
facetted data container)"
[ -facetted_data facets,points,curves ]
For the above settings any options that are given through the command-line take precedence over the
equivalent settings in the translators.defaults file. This means that:
The options given in the command line take precedence over the equivalent settings in the
translators.defaults file. For example, consider a command-driven CATIA-file translation where the
TRANSL_HIDDEN in the translators.defaults is set equal to true, but the user types the [ -
notread_noshow ] option in the command line. In this case, the hidden entities will not be translated.
On the other hand, if the user does not add any option concerning the hidden entities, then these will
be translated as dictated by the translators.defaults setting.
(b) The translators.defaults settings that control the "topology actions taken in ANSA" are:
TRANSL_PERFORM_TOPOLOGY [ -perf_topo ] /
1.
[ -notperf_topo ] (default)
[ -layer_topo ] /
2. TRANSL_TOPO_BETWEEN_LAYERS
[ -notlayer_topo ] (default)
TRANSL_TOPO_BETWEEN_PARTS [ -parts_topo ] /
3.
[ -notparts_topo ] (default)
TRANSL_RESPECT_FILE_TOPO [ -respect_file_topo ] (default) /
4.
[ -notrespect_file_topo ]
[ -clean_geo ] /
5. TRANSL_GEOMETRY_CLEAN_UP
[ -notclean_geo ] (default)
TRANSL_EXTERN_HEAL [ -heal ] /
6.
[ -notheal ] (default)
Settings 2 to 5 follow the general rules given earlier. This means that any options that are given through
the Command-line take precedence over the equivalent settings in the translators.defaults file.
Setting No. 1 has a GLOBAL effect: it determines whether ANY topological actions will be taken AT ALL
when the native CAD files are translated into ANSA databases. During this "topology" step, ANSA
decides on the connectivity of the geometric entities, so that adjacent Faces are connected along their
common boundaries. The result of this action depends also on the current tolerance settings.
IMPORTANT:
By default, the TRANSL_PERFORM_TOPOLOGY setting is set to "false". This means that ANSA will not
take any actions with respect to topology, regardless of options 2 to 5 being set to true.
Hence, if any "connectivity" is seen in the ANSA database, it is not a result of ANSA topology actions,
but it was already prescribed in the native CAD file itself.
3.5.1. Messages about the existence of the ANSA.defaults and translators.defaults file
The translator will look for the ANSA.defaults file and the translators.defaults file in all designated
locations and the relative messages will be displayed. Regardless of this, the translation process will
continue normally, ignoring any settings that were to be found within the translators.defaults file.
Note the detailed information on the effect of the translators.defaults settings to the result of a translation
process given in paragraph 3.4.
3.5.2. Messages about the existence of the ANSA_TRANSL and ANSA_TRANSL.py file
The ANSA script loader will look for the ANSA_TRANSL and ANSA_TRANSL.py file in all designated
locations, in order to read any extra information for the manipulation of the CAD-data contents or any
additional instruction for the handling of the CAD files to be translated.
This additional info or instruction goes into an ANSA_TRANSL file in the form of scripts. Additionally,
post-translation functionality may also be included in an ANSA_TRANSL file.
For further details and examples of ANSA_TRANSL files, please also refer to the API documentation
which is available within ANSA in the form of html pages.
IMPORTANT:
- If an ANSA_TRANSL or ANSA_TRANSL.py file is not found in any of the designated locations, then
a NOTICE message will appear. This notice is irrelevant to the progress of the translation process,
which will continue normally, ignoring any scripts that were to be found in an ANSA_TRANSL or
ANSA_TRANSL.py file.
3.5.3. Messages related to the settings, progress and result of the translation process
The translation options selected for the current translation job are printed in the info window as "Current
options" in the form of a list.
Moreover, messages about the progress of the translation phases are also printed. Finally, information
about the contents of the saved database is also displayed, along with the location path where the ansa
database is saved.
The above translation output messages may differ slightly depending on the format of the CAD file and
the library selected to accomplish the translation. Note that the same output messages can also be seen
in the terminal window.