########
Metadata
########

.. program:: converter

In a typical CAD model, each entity in the assembly tree can contain an arbitrary number of metadata of various types.

This metadata can consist of:

* Generic attributes
* Measurement information
* Persistent IDs
* Physical properties


Importing generic attributes
============================

Generic attributes are the attributes attached to a model from the CAD system but they can also be created during authoring. Those might contain manufacturing information or any other type of data.

By default, all generic attributes of a model will be imported. If you don't want to import generic attributes you can specify the :option:`--read_attributes=false` command line option.

If you want generic attributes to be imported but want to exclude them only when generating a SC model you can specify the :doc:`--sc_export_attributes false </api_ref/data_import/converter-command-line-options>` command line option.


Importing physical properties
=============================

By default, HOOPS Communicator will calculate physical properties for entities in a  CAD model. Those properties include surface area, volume, and center of gravity (for multiple parts, center of gravity is calculated as the arithmetic mean). If you don’t want to generate physical properties during the Stream Cache export you can specify the :option:`--sc_export_physical_properties=false` command line option.
Not generating physical properties can improve conversion performance.


Importing measurement data
==========================

By default, HOOPS Communicator will generate "measurement information" from the analytic geometry data within a CAD model. This data represents a subset of the brep topology and geometry definition required to precisely measure surfaces and line geometry. Retrieving and working with measurement data is described in the :doc:`Measurement page </prog_guide/viewing/markup/measurement>`.

If you don’t want to export any measurement data to the SC Model you can specify the :doc:`--sc_export_measurement false </api_ref/data_import/converter-command-line-options>` command line option.


Retrieving metadata
===================

There are various functions to retrieve metadata from a model which are listed below.

:ref:`model.getNodeProperties() <api_ref/viewing/classes/Communicator.Model:getnodeproperties>`

:ref:`model.getNodeUserData() <api_ref/viewing/classes/Communicator.Model:getnodeuserdatamodel>`

The functions above retrieve arbitrary attributes typically attached by the CAD system. They are discussed in the Programming Guide, :doc:`here </prog_guide/viewing/data_model/metadata>`. Physical properties of a node are part of the generic attributes and can also be retrieved with these functions.

:ref:`model.getFaceAttributes() <api_ref/typedoc/classes/communicator.model:getfaceattributes>`

:ref:`model.getEdgeAttributes() <api_ref/typedoc/classes/communicator.model:getedgeattributes>`

It is also possible (though less common) to have generic attributes attached to faces and edges in the model. Those can be retrieved with the functions above.
