分享

Tekla Structures二次开发)图纸中输入两点画线

 无名无为001 2022-12-25 发布于上海
2020-07-30 18:06:22
  • Mike_detailing

    码龄2年

  •  

提示输入起点,终点,画一条线段
代码如下:

DrawingHandler MyDrawingHandler = new DrawingHandler();
            Tekla.Structures.Drawing.UI.Picker picker = MyDrawingHandler.GetPicker();
            TSG.Point firstPoint = null;
            TSG.Point secondPoint = null;
            ViewBase view = null;
            picker.PickTwoPoints('please input first', 'please input second', out firstPoint, out secondPoint, out view);
            if (MyDrawingHandler.GetConnectionStatus())
            {
                Tekla.Structures.Drawing.Line MyLine;
                Drawing currentDrawing = MyDrawingHandler.GetActiveDrawing();
                if (currentDrawing != null)
                {
                    MyLine = new Tekla.Structures.Drawing.Line(view as ViewBase, firstPoint, secondPoint, 0.0);
                    MyLine.Insert();
                }
            }

在创建前,可以设置线段的属性。
例如设置“凸出”

MyLine.Bulge = 1.0;

例如设置线形

MyLine.Attributes.Line.Type = LineTypes.DashedLine;

    本站是提供个人知识管理的网络存储空间,所有内容均由用户发布,不代表本站观点。请注意甄别内容中的联系方式、诱导购买等信息,谨防诈骗。如发现有害或侵权内容,请点击一键举报。
    转藏 分享 献花(0

    0条评论

    发表

    请遵守用户 评论公约

    类似文章 更多