• 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]}");
                    }
                }
            }
        }
    }

  • 相关阅读:
    _linux 进程间通信(匿名管道)
    【华为云】用VNC远程连接Ubuntu20.04图形界面
    【线上问题】服务器关机导致docker启动的mysql数据库消失了
    Mach-O Inside: 命令行工具集 otool objdump od 与 dwarfdump
    C / C++ 内存管理
    全面解析优化企业Microsoft 365网络的加速方案
    LeetCode刷题day22||235. 二叉搜索树的最近公共祖先&&701.二叉搜索树中的插入操作&&450.删除二叉搜索树中的节点--二叉树
    NetSuite知识会 第7谈 项目如何保证按时上线
    JMeter笔记8 | JMeter关联
    MATLAB 向量和矩阵
  • 原文地址:https://blog.csdn.net/qq_16215957/article/details/126896418