Attribute passing utilities
In Design Data Management, customizations were allowed to use any DB*REF attributes. Creo Elements/Direct Model Manager supports the attribute passing utilities and has moved away from using the DB*REF attributes. For performance reasons, Creo Elements/Direct Model Manager will only send required (configured) attributes to Creo Elements/Direct Modeling. Without using the attribute passing utilities, it’s impossible to access previously available DB*REF attributes.
* 
The <TransferToModeling> tag and related code, added to provide a transition period, were removed as of OneSpace Manager 2006.
The attribute passing utilities provide an easy way of defining and managing database attributes inside Modeling while maintaining the data dictionaries from the database, but minimize the amount of data transferred to only required attributes.
Using the <TargetAttributeName> specification, it is possible to have the same DB attribute transferred to Creo Elements/Direct Modeling as different pseudo attributes visible in Creo Elements/Direct Modeling. By using unique names for each attribute, different users can have customizations based on the same DB attribute. To avoid name collisions, it is recommended to prefix your attribute names with some company name-based prefix (for example, you might use COCREATE_NAME instead of using the default NAME attribute).
The <TargetAttributeName> specification allows a new pseudo attribute to be defined on the Creo Elements/Direct Model Manager side which can directly map to an existing DB attribute. The target attributes allow non-localized strings to map to localized attributes.
The example below shows that a non-localized MD_NAME attribute (pseudo attribute) has been added to the MASTERDATA class, and it directly maps to the DB attribute NAME from the awm_stda catalog, number 200.
<Attribute>
MD_NAME
<TargetAttributeName catalog="awm_stda" msg_num="200">NAME</TargetAttributeName>
<Visible>false</Visible>
<Protect>false</Protect>
<DataType>VARCHAR</DataType>
<DisplayInModeling>false</DisplayInModeling>
</Attribute>
There is no limit to how many pseudo attributes you can map to one real attribute. You could have five pseudo attributes all pointing to the NAME attribute; the only problem is that when the attributes are applied, only the last value will exist in the database. Having multiple mappings to one attribute will work for reading attributes, but when setting the attributes, only one customization will apply.
Once you have configured the XML to define the pseudo attribute, you can define the pseudo attribute to exist in the Creo Elements/Direct Modeling side. You can do this easily by using the attribute passing utilities.
(oli::sd-define-db-attribute "MD-NAME"
:class-name "_MASTERDATA"
:attachment :contents
:keys '("MD_NAME")
:allowed-owner-types :part-assembly
:master :all
:on-copy :copy
:command-name 'assign_name_attribute)
Note the _MASTERDATA entry for the class-name; this allows the attribute to be registered based on 'ANY' masterdata class. You can either enter the specific database class or use _MASTERDATA for any masterdata class or _MODEL for any model class.
Defining Attribute Passing attributes to be visible in a Creo Elements/Direct Modeling browser view
There are three steps to defining an attribute passing value so that is appears in one of the Creo Elements/Direct Modeling browser views:
1. Define the attribute passing attribute.
2. Define the uda column definition.
3. Define the browser view.
1. Define the attribute passing attribute
The attribute must have attribute passing enabled for it to be displayed in the browser. To register the attribute with the attribute passing code you should use the Creo Elements/Direct Modeling integration kit call sd-define-db-attribute. This example sets up the DESCRIPTION2 attribute for the MODEL_3D class.
(oli::sd-define-db-attribute "DESC2"
:class-name "MODEL_3D"
:attachment :contents
:keys
'(
("DESCRIPTION2")
)
:allowed-owner-types :part-assembly
:filing '(:db :sd-file)
:master :all
:on-split :copy
)
* 
This will only work on English systems.
2. Define the uda column definition
You must create the uda column definition. This is done by using one of the following calls, depending on the attribute's type:
sd-create-uda-string-column-definition
sd-create-uda-integer-column-definition
sd-create-uda-float-column-definition
sd-create-uda-boolean-column-definition
sd-create-uda-enum-column-definition
For this example, use the sd-create-uda-string-column-definition call.
(oli::sd-create-uda-string-column-definition :description2-column
:title "Desc2"
:attribute "DESC2"
:value-list-key "DESCRIPTION2"
:attachment :contents
)
The key parts of this call are :attribute and :value-list-key. The :attribute value should match the sd-define-db-attribute value from step 1 (DESC2 in the example). The :value-list-key should match the :keys value from step 1 (DESCRIPTION2 in the example).
3. Define the browser view
You can either create a new browser view to show your column or you can copy one of the standard Creo Elements/Direct Modeling views and add columns.
This example creates a new view to show just the DESCRIPTION2 attribute.
(oli:sd-create-browser-view "MM-DESC2-ONLY"
:title "Desc2 Only"
:tree-config '(:instance-name " [" :mm-version "] " :mm-state)
:detail-config '(:description2-column)
:activate-detail-configuration t
:enable '(oli:sd-license-free-module-active-p "ModelManager")
)
This example overrides the default Creo Elements/Direct Model Manager Details view.
(oli:sd-create-browser-view "MM_DETAILS"
:title "Details"
:tree-config '(:instance-name " [" :mm-version "] " :mm-state)
:detail-config '( :doc-uid-column :mm-version :description2-column
:mm-state :part-uid-column :in-packet-dms-name-column :shared
:selective-instance-context :path-name :modifiable :modified
:clip-flag)
:activate-detail-configuration t
:enable '(oli:sd-license-free-module-active-p "ModelManager")
)
Was this helpful?