• Tekla添加零件ContourPlate


    IDE:Visual Studio 2019

    TEKLA:2022

    创建一个.net Framework窗体应用程序,添加一个按钮:

    using System;
    using System.Collections;
    using System.Windows.Forms;
    using Tekla.Structures.Geometry3d;
    using Tekla.Structures.Model;

    namespace Exercise
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
                MyModel = new Model();
            }

            private readonly Model MyModel;

            private void button2_Click(object sender, EventArgs e)
            {
                if (MyModel.GetConnectionStatus())
                {
                    var p1 = new Point(0, 0, 0);
                    var p2 = new Point(0, 0, 5000);
                    var p3 = new Point(0, 5000, 6000);
                    var p4 = new Point(0, 7000, 0);

                    Contour contour = new Contour();
                    contour.AddContourPoint(new ContourPoint(p1, new Chamfer()));
                    contour.AddContourPoint(new ContourPoint(p2, new Chamfer()));
                    contour.AddContourPoint(new ContourPoint(p3, new Chamfer()));
                    contour.AddContourPoint(new ContourPoint(p4, new Chamfer()));

                    ContourPlate contourPlate = new ContourPlate();
                    contourPlate.Contour = contour;
                    contourPlate.Profile.ProfileString = "500";
                    contourPlate.Material.MaterialString = "S235JR";

                    contourPlate.Insert();

                    MyModel.CommitChanges();

                    ArrayList reportPropertiesNames = new ArrayList()
                    {
                    "WEIGHT",
                    "AREA",
                    "LENGTH"
                    };

                    var hashTable = new Hashtable();
                    contourPlate.GetDoubleReportProperties(reportPropertiesNames, ref hashTable);

                    Console.WriteLine("Contour plate inserterd. Id: " + contourPlate.Identifier.ID);
                    Console.WriteLine("Report properties:");

                    foreach (var key in hashTable.Keys)
                    {
                        Console.WriteLine($"Report property: {key} = {hashTable[key]}");
                    }
                }
            }
        }
    }

  • 相关阅读:
    SpringBoot 代码混淆真香,再也不用担心反编译代码泄露...
    IDEA工具第二篇:自定义Java方法注释模板
    详解线程(一)
    Centos部署openGauss6.0创新版本,丝滑的体验
    计算机毕业论文java毕业设计选题源代码
    Android_JNI编程入门
    JavaScript中async和await的使用以及队列问题
    Hadoop 基础文件上传下载 警告:WARN util.NativeCodeLoader解决 MapReduce入门
    Cholesterol-PEG-NHS,NHS-PEG-CLS,胆固醇-聚乙二醇-活性酯修饰小分子材料
    Java with RocketMQ
  • 原文地址:https://blog.csdn.net/qq_16215957/article/details/126896418