This section discusses the operation of the auto-generated commands which allow the user to assign Creo Elements/Direct Modeling attributes which are exchanged with the ModelManager database. Custom personality commands specific to a user's environment may also be created (usually by an administrator).
In this section:
The auto-generated Creo Elements/Direct Modeling commands which allow the user to assign attributes which are exchanged with the database have a consistent form and mode of operation. The following is an example of such a command for a Material attribute:
assign_material_attribute :owner owner :ID id :HEAT_TREAT ht :FINISH sf
with its corresponding user interface:
Such commands are registered in Creo Elements/Direct Modeling's set of available commands which allows them to be accessed from menus, toolbars, etc. They can also be invoked from the Database Attribute Browser.
Note that although such commands assign attribute values and change the state of the model when they complete, their effect will not be propagated to the database until a subsequent store operation.
Every command for assigning database-exchanged attributes has an option labelled Owner. This option allows the user to select the object on which the attribute is to be assigned. Only owner objects of the allowed types for the attribute (e.g. parts, assemblies, parts and assemblies) may be selected. In addition the owner object must not be read-only at the attachment level for the attribute which is to be assigned.
All options (other than the Owner option) in each command for assigning database-exchanged attributes correspond to individual database attributes. Thus, for the example Material attribute, there are options corresponding to the database attributes recording material-id, surface finish and heat treatment.
When an owner is selected, if the corresponding user defined attribute exists on the selected owner, the value of each option in the command will be set to the corresponding keyed value currently stored in the attribute. If the corresponding user defined attribute does not exist on the owner, the value of each option will be set to any default value (as specified in the database schema).
The values which a user may enter for the various database attributes via a command are constrained by the database schema:
Where possible the entry of illegal value is prohibited by the dialog, but ultimately all values are checked when the command completes before the attribute data is written to the model.
For required database attributes, a value must be specified via the command. For optional attributes it is possible to specify a null value. This is supported in the dialogs by a check-box (unchecked for a null value). In the example dialog for the Material attribute, the material id is required, but the surface and heat treatment are optional.
A single command, REMOVE_DB_ATTRIBUTES, is provided to allow the deletion of attributes which are exchanged with the database. This command operates on a single (owner) object and presents, at the user interface, a list of the database exchanged user defined attributes present on the object. All selected attributes will be deleted.
Note that although deleted attributes are no longer present on the model, they will not be removed from the database until a subsequent store operation.
It is not possible to completely remove user defined attributes which are mapped to one or more required database attributes (since such attributes must always be present in the database). For such attributes, the effect of the REMOVE_DB_ATTRIBUTES command is to remove all optional keys, but reset any required keys to their default values.
© 2023 Parametric
Technology GmbH (a subsidiary of PTC Inc.), All Rights Reserved |