Skip to main content

KToolHelper

kds-plugin-document / Exports / KToolHelper

Interface: KToolHelper

自定义工具帮助器

Table of contents

Methods

Methods

clearExcludedInferenceEntities

clearExcludedInferenceEntities(): boolean

清空被排除在外的用于吸附的图形实体列表

Clear the excluded inference entities.

Returns

boolean

Return true if successful, else return false.

Defined in

api.d.ts:4367


clearPickingFilter

clearPickingFilter(): void

清空选择器过滤器

Clear the user setting of selectable entity types.

Returns

void

void

Defined in

api.d.ts:4323


enablePicking

enablePicking(enable): void

允许或禁止酷大师默认的选择行为

Enable or disable the picking process of the system defauts. Note: This method only works within an activated KTool. By default, picking process is not enabled for a KTool.

Parameters

NameTypeDescription
enablebooleanenable the picking if true, or disable if false.

Returns

void

void

Defined in

api.d.ts:4291


enableRectPicking

enableRectPicking(enable): void

允许或禁止酷大师的框选行为

Enable or disable the rect picking process of the system defauts. Note: This method only works within an activated KTool. By default, rect picking process is not enabled for a KTool. Rect picking only can be enabled when picking process is enabled.

Parameters

NameTypeDescription
enablebooleanenable the rect picking if true, or disable if false.

Returns

void

void

Defined in

api.d.ts:4303


getBoundingBoxOfFaces

getBoundingBoxOfFaces(faces): KBoundingBox3d

获取一组面的包围盒

Parameters

NameTypeDescription
facesKFace[]The target faces.

Returns

KBoundingBox3d

Return the bounding box of the faces.

Defined in

api.d.ts:4429


getHoveredItem

getHoveredItem(): KEntity[]

获取当前鼠标 hover 高亮的图形实体

Get the hovered item.

Returns

KEntity[]

Return the hovered entity. If it is a continuous edge or face, then return all its KEdges or KFaces.

Defined in

api.d.ts:4376


getVertexPointsOfFaces

getVertexPointsOfFaces(faces): KPoint3d[]

获取一组面的顶点的几何点

Parameters

NameTypeDescription
facesKFace[]The target faces.

Returns

KPoint3d[]

Return the unique vertex point array.

Defined in

api.d.ts:4420


getVerticesOfFaces

getVerticesOfFaces(faces): KVertex[]

获取一组面的顶点

Parameters

NameTypeDescription
facesKFace[]The target faces where to collect vertices.

Returns

KVertex[]

Return the unique vertex array.

Defined in

api.d.ts:4411


projectPointOntoFaces

projectPointOntoFaces(targetFaces, point, projectDirection): Object

将一个点投影到一组面上,求投影点、投影面、投影点法向和投影距离

The method is used to project a point onto a face region. Note: currently it only supports faces in the active group definition.

Parameters

NameTypeDescription
targetFacesKFace[]The face region where the point projects onto.
pointKPoint3dThe point to be projected.
projectDirectionKVector3dThe project direction.

Returns

Object

Return an object which contains projected faces, project location, face normal at the project location and project distance if successful, otherwise return null. If the projected face is in a continuouse face group, then we will return all of the faces in that continuouse face group.

NameType
distancenumber
normalKVector3d
projectedFaceKFace[]
projectionKPoint3d

Defined in

api.d.ts:4390


projectPointOntoGroupInstance

projectPointOntoGroupInstance(groupInstance, point, projectDirection): Object

将一个点投影到一个成组实例上,求投影点、投影点法向和投影距离

The method is used to project a point onto a group instance. Note: currently it only supports group instance in the active group definition.

Parameters

NameTypeDescription
groupInstanceKGroupInstanceThe target groupInstnace where the point projects onto.
pointKPoint3dThe point to be projected.
projectDirectionKVector3dThe project direction.

Returns

Object

Return an object which contains project location, face normal at the project location and project distance if successful, otherwise return null.

NameType
distancenumber
normalKVector3d
projectionKPoint3d

Defined in

api.d.ts:4403


setDefaultSelectBehavior

setDefaultSelectBehavior(behavior): void

设置酷大师的默认选择行为。 这可以使用户在并没有按住 shift, control 或 shift + control 时,可以拥有不一样的选择行为。(酷大师在没有按住上述按键时的默认选择行为是单选) 用户在做框选时,总是要按住 shift, control 或者 shift + control,所以框选没有默认选择行为 但是如果插件禁止了酷大师的框选行为,实现了它自己的框选,那这里设置的默认选择行为也会应用到插件自定义的框选行为中

Set the default select behavior when user didn't press shift key, control key or shift + control key. Note: by default system uses the replace mode. user has to allways explicitly press shift key, control key or shift + control key to do box picking, so box picking has no default select behavior. but if plugin has disabled the system box picking and implemented its own box picking, then this select behavior will be applied to that custom box picking too.

Parameters

NameTypeDescription
behaviorKSelectBehaviorone of the four select behaviors: replace, toggle, add and remove.

Returns

void

void

Defined in

api.d.ts:4339


setExcludeInferenceTypes

setExcludeInferenceTypes(types): boolean

设置被排除在外的吸附类型列表

Set the excluded inference types.

Parameters

NameTypeDescription
types(KArchFaceType | KEntityType)[]The excluded inference types.

Returns

boolean

Return true if successful, else return false.

Defined in

api.d.ts:4359


setExcludedInferenceEntities

setExcludedInferenceEntities(entities): boolean

设置被排除在外的用于吸附的图形实体列表

Set the excluded inference entities.

Parameters

NameTypeDescription
entitiesKEntity[]The excluded inference entities.

Returns

boolean

Return true if successful, else return false.

Defined in

api.d.ts:4349


setPickingFilter

setPickingFilter(pickableEntityTypes): void

设置选择器过滤器。可以仅允许用户选择特定类型的图形实体

Set the selectable entity types. Note: This method only works within an activated KTool.

Parameters

NameTypeDescription
pickableEntityTypesKEntityType[]the selectable entity types. If it is empty, then all entities are selectable.

Returns

void

void

Defined in

api.d.ts:4314