WebCAD-Lib-TS API 文档 - v1.0.0
    Preparing search index...

    Class AttributeTextProcessor

    属性文本处理器 负责处理块参照中的属性文本替换逻辑

    Index

    Constructors

    Methods

    • 处理块参照中的属性文本替换

      Parameters

      Returns EntityBase[]

      处理后的实体数组,其中属性文本已被替换

    • 创建属性文本实体

      Parameters

      • originalEntity: TextEnt

        原始的属性定义实体

      • attributeValue: AttributeObject

        属性值对象

      • insertEntity: InsertEnt

        块插入实体

      Returns TextEnt

      新的文本实体

    • 应用位置继承

      Parameters

      • newEntity: TextEnt

        新的文本实体

      • originalEntity: TextEnt

        原始的属性定义实体

      • attributeValue: AttributeObject

        属性值对象

      • insertEntity: InsertEnt

        块插入实体

      Returns void

    • 应用样式继承

      Parameters

      • newEntity: TextEnt

        新的文本实体

      • originalEntity: TextEnt

        原始的属性定义实体

      • attributeValue: AttributeObject

        属性值对象

      • insertEntity: InsertEnt

        块插入实体

      Returns void

    • 计算相对位置 将属性值中的绝对位置转换为相对于块参照的相对位置

      Parameters

      • absolutePosition: Point2D

        绝对位置 {x, y, z}

      • insertEntity: InsertEnt

        块插入实体

      Returns Point2D

      相对位置

    • 检查实体是否是属性定义

      Parameters

      Returns boolean

      是否是属性定义

    • 获取块定义中的所有属性定义

      Parameters

      • blockEntities: EntityBase[]

        块定义中的实体数组

      Returns EntityBase[]

      属性定义数组

    • 检查属性是否不可见

      Parameters

      • attributeValue: AttributeObject

        属性值对象

      • originalEntity: EntityBase | TextEnt

        原始属性定义实体

      Returns boolean

      属性是否不可见

    • 验证属性值的完整性

      Parameters

      • attributeValue: AttributeObject

        属性值对象

      Returns boolean

      属性值是否有效

    • 应用颜色继承逻辑

      CAD特殊规则:当实体位于"0"层且颜色为ByLayer(256)时,它不会使用0层的颜色, 而是继承块参照(INSERT)所在图层的颜色。这是CAD中0层的特殊"变色龙"行为。

      Parameters

      • newEntity: TextEnt

        新的文本实体

      • originalEntity: TextEnt

        原始的属性定义实体

      • attributeValue: AttributeObject

        属性值对象

      • insertEntity: InsertEnt

        块插入实体

      Returns void

    • 应用线型继承逻辑

      Parameters

      • newEntity: TextEnt

        新的文本实体

      • originalEntity: TextEnt

        原始的属性定义实体

      • attributeValue: AttributeObject

        属性值对象

      • insertEntity: InsertEnt

        块插入实体

      Returns void

    • 应用线型比例继承逻辑

      Parameters

      • newEntity: TextEnt

        新的文本实体

      • originalEntity: TextEnt

        原始的属性定义实体

      • attributeValue: AttributeObject

        属性值对象

      • insertEntity: InsertEnt

        块插入实体

      Returns void