明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 681|回复: 2

[图元] 求助多重引线问题

[复制链接]
发表于 2022-3-18 20:36 | 显示全部楼层 |阅读模式
2明经币
本帖最后由 d1742647821 于 2023-2-23 10:19 编辑

找到原因了,会受到默认样式的影响
版主麻烦帮忙删贴




求助,为什么多重引线向左边点时位置与预期为止不一样呢?

  1. public static MLeader Type1(Point3d basePoint,Point3d tagPoint,string textString,double textHeight)
  2.         {
  3.             var ml = new MLeader();
  4.             var n1 = ml.AddLeader();
  5.             var n2 = ml.AddLeaderLine(n1);
  6.             ml.AddFirstVertex(n2, basePoint);
  7.             ml.AddLastVertex(n2, tagPoint);
  8.             ml.LeaderLineType = LeaderType.StraightLeader;//引线格式-类型:直线
  9.             ml.ContentType = ContentType.MTextContent;//内容-多重引线类型:多行文字
  10.             ml.TextAttachmentType = TextAttachmentType.AttachmentBottomOfTopLine;//连接位置:第一行加下划线
  11.             ml.EnableDogleg = false;//水平基线:否
  12.             var text = new MText();
  13.             text.Contents = "{\\W0.7;"+ textString + "}" ;
  14.             text.LineSpacingStyle = LineSpacingStyle.Exactly;
  15.             text.LineSpacingFactor = 1;
  16.             //text.Location = tagPoint;
  17.             ml.MText = text;
  18.             ml.TextHeight = textHeight;
  19.             return ml;
  20.         }

子函数是这样写的

附件: 您需要 登录 才可以下载或查看,没有账号?注册
发表于 2022-6-24 17:21 | 显示全部楼层
设置的第一行和最后文字连接位置改下
回复

使用道具 举报

 楼主| 发表于 2023-2-23 09:05 | 显示全部楼层
是默认样式的问题
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-4-28 02:27 , Processed in 0.254092 second(s), 20 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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