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:3141


getBoundingBox

getBoundingBox(): KBoundingBox3d

获取组实例的外包围盒

Get the bounding box of this group instance.

Returns

KBoundingBox3d

The bounding box.

Defined in

api.d.ts:3102


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:3120


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:3084


getKey

getKey(): string

获取唯一标识符

Get a unique key assigned to a group instance.

Returns

string

The unique key.

Defined in

api.d.ts:3075


getLocalBoundingBox

getLocalBoundingBox(): KBoundingBox3d

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

Get the local bounding box of this group instance.

Returns

KBoundingBox3d

The local bounding box.

Defined in

api.d.ts:3111


getParentGroupDefinition

getParentGroupDefinition(): KGroupDefinition

获取组实例的父组

Get the parent KGroupDefinition of this.

Returns

KGroupDefinition

Defined in

api.d.ts:3167


getTransform

getTransform(): KMatrix4

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

Get the transformation matrix of this group instance.

Returns

KMatrix4

The transformation matrix.

Defined in

api.d.ts:3093


getType

getType(): KEntityType

获取图形实体类型

Get the entity's type.

Returns

KEntityType

The entity's type.

Inherited from

KEntity.getType

Defined in

api.d.ts:2656


isInvisible

isInvisible(): boolean

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

获取该成组是否可见

Get the group property of it is invisible or not.

Returns

boolean

Defined in

api.d.ts:3151


isVisible

isVisible(): boolean

获取该成组是否可见

Get the group property of it is visible or not.

Returns

boolean

Defined in

api.d.ts:3159


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:3132