天气与日历 切换到窄版

 找回密码
 立即注册
中国膜结构网
十大进口膜材评选 十大国产膜材评选 十大膜结构设计评选 十大膜结构公司评选
查看: 8|回复: 0

objectarx二次开发,文字实体AcDbText获取插入点不准确的问题

[复制链接]
  • TA的每日心情
    开心
    昨天 15:23
  • 签到天数: 69 天

    [LV.6]常住居民II

    410

    主题

    167

    回帖

    2704

    积分

    管理员

    积分
    2704
    发表于 2024-6-22 09:46:18 | 显示全部楼层 |阅读模式
    objectarx二次开发,文字实体AcDbText获取插入点不准确的问题
    AcDbText::position Function
    AcDbText::alignmentPoint Function
    `获取文字插入点函数如下`
    如有问题,欢迎拍砖留言指正
    AcDbText::position Function
    AcGePoint3d position() const;

            This function returns the insertion point of the text in WCS coordinates.
            If vertical mode is AcDb::kTextBase and horizontal mode is either AcDb::kTextLeft, AcDb::kTextAlign, or AcDb::kTextFit, then the position point is the insertion point for the text object and, for AcDb::kTextLeft, the alignment point (DXF group code 11) is automatically calculated based on the other parameters in the text object.
            For all other vertical and horizontal mode combinations, the alignment point is used as the insertion point of the text and the position point is automatically calculated based on the other parameters in the text object.
            The position value is the WCS equivalent of DXF group code 10.
    大概意思就是:verticalMode() == AcDb::kTextBase时,如果 horizontalMode()== AcDb::kTextLeft 或 horizontalMode()== AcDb::kTextAlign 或 horizontalMode()== AcDb::kTextFit,那么position() 函数就是文字的插入点,否则alignmentPoint ()就是插入点

    AcDbText::alignmentPoint Function
    AcGePoint3d alignmentPoint() const;

            This function returns the alignment point of the text.
            If vertical mode is AcDb::kTextBase and horizontal mode is either AcDb::kTextLeft, AcDb::kTextAlign, or AcDb::kTextFit, then the position point (DXF group code 10) is the insertion point for the text object and, for AcDb::kTextLeft, the alignment point is automatically calculated based on the other parameters in the text object.
            For all other vertical and horizontal mode combinations, the alignment point is used as the insertion point of the text and the position point is automatically calculated based on the other parameters in the text object.
            The alignment point value is the WCS equivalent of DXF group code 11.

    获取文字插入点函数如下
            AcDbText * pEntityPtr;
            AcGePoint3d insertPosition;
            if (pEntityPtr->verticalMode() == AcDb::kTextBase)
            {
                    TextHorzMode hzModel = pEntityPtr->horizontalMode();
                    if (hzModel == AcDb::kTextLeft ||hzModel == AcDb::kTextAlign || hzModel == AcDb::kTextFit)
                    {
                            insertPosition = pEntityPtr->position();
                    }else{
                            insertPosition = pEntityPtr->alignmentPoint();
                    }
            }else{
                            insertPosition = pEntityPtr->alignmentPoint();
            }

     

     

     

     

    objectarx二次开发,文字实体AcDbText获取插入点不准确的问题
    中国膜结构网打造全中国最好的膜结构综合平台 ,统一协调膜结构设计,膜结构施工,膜材采购,膜材定制,膜结构预算全方位服务。 中国空间膜结构协会合作单位。
    您需要登录后才可以回帖 登录 | 立即注册

    本版积分规则

    QQ|Archiver|手机版|中国膜结构网|中国膜结构协会|进口膜材|国产膜材|ETFE|PVDF|PTFE|设计|施工|安装|车棚|看台|污水池|

    GMT+8, 2024-7-1 05:38 , Processed in 0.057686 second(s), 23 queries .

    Powered by Discuz! X3.5

    © 2001-2024 Discuz! Team.

    快速回复 返回顶部 返回列表