Skip to main content

KGroupInstance

kds-plugin-document / Exports / KGroupInstance

Interface: KGroupInstance

组实例

组实例用来表达一个成组的实例。可以把“组定义”看成面向对象编程中的“类”,而“组实例”看成面向对象编程中的“对象” 组实例会包含一个对组定义的应用,然后包含一个齐次变换矩阵,用来表达它在酷大师 3D 场景中的位姿

The KGroupInstance class is used to represent group instances of a group definition. Therefore, the KGroupInstance class contains a reference to a corresponding KGroupDefinition object and a Transformation object (which contains the location of the group instance in the Drawing Window).

Hierarchy​

Table of contents​

Methods​

Methods​

getAllCustomPropertiesKey​

▸ getAllCustomPropertiesKey(): string[]

获取该成组上所有的业务数据的key

Get all keys of custom property data which set by current plugin.

Returns​

string[]

array of keys

Defined in​

api.d.ts:3763


getBoundingBox​

▸ getBoundingBox(): KBoundingBox3d

获取组实例的全局外包围盒

Get the global bounding box of this group instance.

Returns​

KBoundingBox3d

The global bounding box.

Defined in​

api.d.ts:3724


getCustomProperty​

▸ getCustomProperty(key): string

获取业务数据

Get custom property data.

Parameters​

NameTypeDescription
keystring: unique key for this kind of custom.

Returns​

string

Defined in​

api.d.ts:3742


getGroupDefinition​

▸ getGroupDefinition(): KGroupDefinition

获取组定义

Get the group definition for this group instance.

Returns​

KGroupDefinition

The group definition if successful, else false.

Defined in​

api.d.ts:3697


getId​

▸ getId(): string

获取实例ID

Get the unique ID assigned to a group instance.

Returns​

string

The unique ID.

Defined in​

api.d.ts:3688


getKey​

▸ getKey(): string

获取唯一标识符

Get a unique key assigned to a group instance.

Returns​

string

The unique key.

Defined in​

api.d.ts:3679


getLocalBoundingBox​

▸ getLocalBoundingBox(): KBoundingBox3d

获取组实例的局地外包围盒

Get the local bounding box of this group instance.

Returns​

KBoundingBox3d

The local bounding box.

Defined in​

api.d.ts:3733


getParentGroupDefinition​

▸ getParentGroupDefinition(): KGroupDefinition

获取组实例的父组

Get the parent KGroupDefinition of this.

Returns​

KGroupDefinition

Defined in​

api.d.ts:3789


getTransform​

▸ getTransform(): KMatrix4

获取齐次变换矩阵。此矩阵用于表达组实例在酷大师 3D 场景中的位姿

Get the transformation matrix of this group instance.

Returns​

KMatrix4

The transformation matrix.

Defined in​

api.d.ts:3706


getType​

▸ getType(): KTopoType | KEntityType

获取图形实体类型

Get the entity's type.

Returns​

KTopoType | KEntityType

The entity's type.

Inherited from​

KEntity.getType

Defined in​

api.d.ts:3252


isInvisible​

▸ isInvisible(): boolean

@deprecated:建议使用KGroupInstance.isVisible()

获取该成组是否可见

Get the group property of it is invisible or not.

Returns​

boolean

Defined in​

api.d.ts:3773


isVisible​

▸ isVisible(): boolean

获取该成组是否可见

Get the group property of it is visible or not.

Returns​

boolean

Defined in​

api.d.ts:3781


setCustomProperty​

▸ setCustomProperty(key, data): Object

添加业务数据

Set custom property data. key + value should be as small as possible, we have a maximum size limit which is around 256 characters. count of customProperty can't exceed 100.

Parameters​

NameTypeDescription
keystring: key of custom
datastring: support string type

Returns​

Object

NameType
isSuccessboolean

Defined in​

api.d.ts:3754


setTransform​

▸ setTransform(transform): void

设置组实例的齐次变换矩阵。此矩阵用于表达组实例在酷大师 3D 场景中的位姿

Set the transformation matrix for this group instance.

Parameters​

NameTypeDescription
transformKMatrix4The transformation matrix to apply.

Returns​

void

Defined in​

api.d.ts:3715