ISmartLabelManager_KC Interface
- GetLabel
- CreateLabelsAutomatic
- CreateObjectLabelAutomatic
- SetStringSource
- GetStringSource
- SetTextToRectangleMargin
- GetTextToRectangleMargin
- AddNewLabel
- GetLabelCreationTemplate
- GetExtendedProperties
Access to Smart Label
Manager. Can be queried from IView.
IDynamicScreenItemManager_KC,
which can be queried from this interface, provides additional functionality
See also: Smart
Labels, Smart Labels sample
HRESULT GetLabel(int index, ILabel3D_KC** label)
Returns index-th managed label
HRESULT CreateLabelsAutomatic()
Creates smart labels one per each entity in the model independently on
child/parent relationship and adds them to the array of managed items. The
labels are created with attributes specified by the
template
acquired with the GetLabelCreationTemplate
method below.
The label is not added if the object already has a smart child label with the
same attachment point and text string
HRESULT CreateObjectLabelAutomatic(ISection* object, VARIANT_BOOL
includeChildren, VARIANT_BOOL childrenOnly)
Creates smart labels one per each child entity of object and adds
them to the array of managed items. The labels are created with attributes
specified by the
template
acquired with the GetLabelCreationTemplate
method below.
The label is not added if the object already has a smart child label with the
same attachment point and text string
HRESULT SetStringSource(EStringSource type)
HRESULT GetStringSource(EStringSource* type)
If type is EStringSource.eStringSourceObjectName labels created
during a call to AddNewLabel, CreateLabelsAutomatic
or CreateObjectLabelAutomatic have
text which is name of the parent object. When type is EStringSource.eStringSourceLayerName
layer name of the parent object is used. Otherwise the name specified in the
template
is used
HRESULT SetTextToRectangleMargin(float textHeightToMarginRatio)
HRESULT GetTextToRectangleMargin(float* textHeightToMarginRatio)
Smart label rectangle size is determined by the text (font) size plus a margin,
measured as a ratio of the text height. This property specifies the ratio. The
default is 0.15
HRESULT AddNewLabel(ISection* parent,
ILabel3D_KC** label)
Creates a new smart label, adds it as a child item of parent and
adds it to the array of managed items. ILabel3D_KC
is returned for convenience for further modifications. It parent is
null the label is created as the last top-level item. The label is created with
attributes copied form the
template.
HRESULT GetLabelCreationTemplate(ILabel3D_KC** label)
Gives acess to the
template,
which defines attributes of new labels created with AddNewLabel, CreateLabelsAutomatic
or CreateObjectLabelAutomatic
HRESULT GetExtendedProperties(IKCContext** context)
Gives acess to the
Extended Properties of smart labels,
|