• Revit API 创建带箭头的标注


     
    [Transaction(TransactionMode.Manual)]
    [Regeneration(RegenerationOption.Manual)]
    public class cmd : IExternalCommand
    {
        public Result Execute(ExternalCommandData cmdData, ref string msg, ElementSet elements)
        {
            UIDocument uiDoc = cmdData.Application.ActiveUIDocument;
            Document doc = uiDoc.Document;
            Selection sel = uiDoc.Selection;

            Transaction ts = new Transaction(doc, "http://revit.5d6d.com");
            ts.Start();

            XYZ xyzOrigin = sel.PickPoint();
            XYZ pt1 = sel.PickPoint();
            XYZ pt2 = sel.PickPoint();
            //
            XYZ baseVec = new XYZ(000);
            XYZ upVec = new XYZ(000);
            double dWidth = 0.16;
            TextAlignFlags textAlign = TextAlignFlags.TEF_ALIGN_LEFT | TextAlignFlags.TEF_ALIGN_TOP;

            TextNote textNote = doc.Create.NewTextNote(
                doc.ActiveView, xyzOrigin, baseVec, upVec, dWidth, textAlign
                , TextNoteLeaderTypes.TNLT_STRAIGHT_L, TextNoteLeaderStyles.LCS_ONE_SEG_LINE, pt1, pt2, "标注");

            ts.Commit();

            return Result.Succeeded;
        }
    }
    url:http://greatverve.cnblogs.com/p/TextNoteLeader.html
  • 相关阅读:
    Django中关于MySQL的bug总结
    css的外边距合并或者外边距塌陷问题
    双十二开篇之作
    浅谈css的行内类型标签和块级标签
    css的padding和border问题
    Django中的bug总结
    css清除浮动的方法
    Ubuntu图标变成问号
    pku1149 PIGS
    sizeof()功能
  • 原文地址:https://www.cnblogs.com/greatverve/p/TextNoteLeader.html
Copyright © 2020-2023  润新知