乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 81|回复: 6

单行文字齐的属性

[复制链接]

84

主题

543

帖子

12

银币

中流砥柱

Rank: 25

铜币
886
发表于 2010-12-15 21:30:00 | 显示全部楼层 |阅读模式
请教老师: 单行文字中心对齐属性设置是那个函数(我设置为Center不对,请问应该是什么)txent.AlignmentPoint = Center; 另外单行文字宽度是那个属性
回复

使用道具 举报

72

主题

2726

帖子

9

银币

社区元老

Rank: 75Rank: 75Rank: 75

铜币
3014
发表于 2010-12-15 21:46:00 | 显示全部楼层
DBText.Justify Property
DBText.WidthFactor Property
回复

使用道具 举报

84

主题

543

帖子

12

银币

中流砥柱

Rank: 25

铜币
886
发表于 2010-12-16 12:30:00 | 显示全部楼层
请问老师我设置文字以中心对齐这一句(txent.AlignmentPoint = Center;)编译出错,应该如何写这一句,请帮助指正...
回复

使用道具 举报

0

主题

37

帖子

2

银币

初来乍到

Rank: 1

铜币
37
发表于 2010-12-16 18:18:00 | 显示全部楼层
  1.         [CommandMethod("t2")]
  2.         public static void Test2()
  3.         {
  4.             Document doc = Application.DocumentManager.MdiActiveDocument;
  5.             Editor ed = doc.Editor;
  6.             Database db = doc.Database;
  7.             using(var tr = db.TransactionManager.StartTransaction())
  8.             {
  9.                 DBText txt = new DBText();
  10.                 txt.TextString = "ABC";
  11.                 txt.Justify = AttachmentPoint.MiddleCenter;
  12.                 txt.AlignmentPoint = new Point3d(10, 10, 0);
  13.                 txt.SetDatabaseDefaults();
  14.                 var btr = tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite) as BlockTableRecord;
  15.                 AddEntity(tr, btr, txt);
  16.                 tr.Commit();
  17.             }
  18.         }
回复

使用道具 举报

84

主题

543

帖子

12

银币

中流砥柱

Rank: 25

铜币
886
发表于 2010-12-16 19:31:00 | 显示全部楼层
谢谢老师的指点,问题已解决。。。
另外再请教一下单行文字角度是那个属性?
回复

使用道具 举报

0

主题

37

帖子

2

银币

初来乍到

Rank: 1

铜币
37
发表于 2010-12-16 20:57:00 | 显示全部楼层
这个在文档很容易就查到的
最好的老师是帮助啊
Autodesk.AutoCAD.DatabaseServices Namespace > DBText Class > DBText Properties > DBText.Rotation Property
DBText.Rotation Property
Collapse AllC#
[UnitType(Autodesk.AutoCAD.DatabaseServices.UnitType.Angle), Category("Text")]
public double Rotation;
Visual Basic
[U]
Public Property Rotation() As double
Description

Accesses the rotation angle of the text. The rotation angle is relative to the X axis of the text's OCS, with positive angles going counterclockwise when looking down the Z axis towards the origin. The OCS X axis is determined by using the text's normal, the WCS Z axis, and the arbitrary axis algorithm.
Conditions
Read / Write
Links
DBText Class, Autodesk.AutoCAD.DatabaseServices Namespace
回复

使用道具 举报

84

主题

543

帖子

12

银币

中流砥柱

Rank: 25

铜币
886
发表于 2010-12-17 12:31:00 | 显示全部楼层
谢谢老师提供的帮助,我英文差,看的似懂非懂...
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-3-15 10:48 , Processed in 0.398877 second(s), 66 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表