田草博客

互联网田草博客


网友交流QQ群:11740834 需注明申请加入原因

微信 公众号:ByCAD

邮箱:tiancao1001x126.com
ByCAD,微信公众号
首页 | 普通 | 电脑 | AutoCAD | VB/VB.NET | FLash | 结构 | 建筑 | 电影 | BIM | 规范 | 软件 | ID
-随机-|-分布-
-博客论坛-|-﨣﨤﨧﨨-
-网站导航-|-规范下载-
-BelovedFLash欣赏-

用户登陆
用户:
密码:
 

站点日历
73 2024 - 4 48
 123456
78910111213
14151617181920
21222324252627
282930


站点统计

最新评论



Get AutoCAD SupportPath Download AutoRebar V2.1 Full Crack
未知 .net中关于DBText注意事项   [ 日期:2023-09-28 ]   [ 来自:本站转帖 ]  HTML
https://www.jianshu.com/p/53a06b6c60c4

.net中关于DBText注意事项

需要设置AdjustAligment
参数传入HostApplicationServieces.WorkingDatabase
且必须放置在最后,否则拖拽前后位置会发生变化。
 
程序代码:

DBText text = new DBText();
 text.SetDatabaseDefaults();//设置默认线型 图层等
 text.VerticalMode = TextVerticalMode.TextVerticalMid;//垂直对齐方式
 text.HorizontaiMode = TextHorizontalMode.TextLeft;//水平对齐方式
 text.ColorIndex = 3;//设置文字颜色索引
 text.WidthFactor = 0.65;//设置文字宽度因子
 text.Height = 5; //设置文字高度
 text.TextString = "Hello World"; //设置文本字符串
 text.Position = textPosition;  //设置文字位置 
 text.TextStyleId = textStyleId;//一个非Null的Id
//下面顺序不要变 否则过拽有问题
 text.AllignmentPoint = textPosition;//设置文字对齐位置
 text.AdjustAlignment(HostApplicationServieces.WorkingDatabase);//设置文字对齐

帮助文档对于AdjustAligment的解释是:
Normally when a text entity is closed,the text‘s position and allignment points are adjusted according to the text's justification settings and the text style.
But , if the text entity is embedded in another entity,it will never be closed in wihch case it won't automatically be adjusted.
Or, if the text is added to a transaction before it's first close(),and the graphics are flushed to the screen before the outemost transaction ends,the text will be displayed before the automatic adjustment takes place.

1、when this method is called,the database used must be the current working database(as return by HostApplicationServiece()->workingDatabase())
2、the text entity must have Non-Null text string data ,
3、and a valid text style objectId that resides in the database being used;
1、传入的参数必须是当前活动的数据库
2、文本必须为非Null
3、文字样式必须有效

作者:yumxuanyi
链接:https://www.jianshu.com/p/53a06b6c60c4
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。




暂时没有评论
发表评论 - 不要忘了输入验证码哦!
作者: 用户:  密码:   注册? 验证:  防止恶意留言请输入问题答案:2*9=?  
评论:

禁止表情
禁止UBB
禁止图片
识别链接
识别关键字

字体样式 文字大小 文字颜色
插入粗体文本 插入斜体文本 插入下划线
左对齐 居中对齐 右对齐
插入超级链接 插入邮件地址 插入图像
插入 Flash 插入代码 插入引用
插入列表 插入音频文件 插入视频文件
插入缩进符合
点击下载按钮 下标 上标
水平线 简介分割标记
表  情
 
Tiancao Blog All Rights Reserved 田草博客 版权所有
Copyright ©