单行文字齐的属性
本帖最后由 chpmould 于 2010-12-15 21:33 编辑请教老师: 单行文字中心对齐属性设置是那个函数(我设置为Center不对,请问应该是什么)txent.AlignmentPoint = Center; 另外单行文字宽度是那个属性 DBText.Justify Property
DBText.WidthFactor Property 请问老师我设置文字以中心对齐这一句(txent.AlignmentPoint = Center;)编译出错,应该如何写这一句,请帮助指正...
public static void Test2()
{
Document doc = Application.DocumentManager.MdiActiveDocument;
Editor ed = doc.Editor;
Database db = doc.Database;
using(var tr = db.TransactionManager.StartTransaction())
{
DBText txt = new DBText();
txt.TextString = "ABC";
txt.Justify = AttachmentPoint.MiddleCenter;
txt.AlignmentPoint = new Point3d(10, 10, 0);
txt.SetDatabaseDefaults();
var btr = tr.GetObject(db.CurrentSpaceId, OpenMode.ForWrite) as BlockTableRecord;
AddEntity(tr, btr, txt);
tr.Commit();
}
} 谢谢老师的指点,问题已解决。。。
另外再请教一下单行文字角度是那个属性?
这个在文档很容易就查到的
最好的老师是帮助啊
Autodesk.AutoCAD.DatabaseServices Namespace > DBText Class > DBText Properties > DBText.Rotation Property
DBText.Rotation Property
Collapse AllC#
public double Rotation;
Visual Basic
<UnitType(Autodesk.AutoCAD.DatabaseServices.UnitType.Angle), Category("Text")>
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
谢谢老师提供的帮助,我英文差,看的似懂非懂...
页:
[1]