To create a hierarchical structure using the Common Data Access API, a database must have the following set of properties and attributes:
ODAUniqueID
property with
a value of the OdUInt64
type. In this case,
ODAUniqueID
is used to link a tree node with visualization
geometry.
HierarchyLevel
attribute or they must be included in
the CollectionProperty
of the parent object. This property must
contain a reference to a child object (or objects of the
CollectionProperty
type). It is recommended to exclude
unnecessary or service objects.
CollectionProperty
type and return an array of
references to these nested objects.
HierarchyLevel
attribute can be set to the following
values: Database
, Model
,
BlockReference
, Block
, Entity
,
Hidden
. It is recommended to set the attribute based on the
following criteria:
Entity
— A leaf element of a hierarchical tree.
Block
— A set of elements of the hierarchical
structure that can be used in the tree several times.
BlockReference
— An element that serves as a
reference to the hierarchical element of the Block
type.
Model
— A set of elements of a hierarchical
structure, which can be separated logically in the hierarchical tree.
Database
— An element that contains a reference to
an external database.
Hidden
— A utility element that has no significant
properties and can be hidden when displaying the tree in viewer
applications.
OdRxHierarchyLevelAttribute
class and override
the following function:
virtual OdString value(OdRxValue& value);
. DisplayAsAttribute
property for the
objects involved in the formation of the hierarchical tree and the property
cache do not return an empty string.
For example:
A database object contains a property of the model of the
CollectionProperty
type with the HierarchyLevel
attribute. The value of this attribute is Model
. This property
contains a collection of references to the objects, that is, model objects. Each model
object contains an Entity property of the CollectionProperty
type with the HierarchyLevel
attribute. The value of the
attribute is Entity
. To determine the exact type of the item, the
overloaded function virtual OdString value(OdRxValue& value);
of
the OdRxHierarchyLevelAttribute
class is required.
Copyright © 2002 – 2020. Open Design Alliance. All rights reserved.
|