• Tekla查询零件


    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.Windows.Forms;
    using Tekla.Structures;
    using Tekla.Structures.Catalogs;
    using Tekla.Structures.Drawing;
    using Tekla.Structures.Filtering;
    using Tekla.Structures.Filtering.Categories;
    using Tekla.Structures.Geometry3d;
    using Tekla.Structures.Model;
    using Part = Tekla.Structures.Model.Part;

    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())
                {
                if (MyModel.GetConnectionStatus())
                {
                    ModelObjectEnumerator.AutoFetch = true;
                    var beams = MyModel.GetModelObjectSelector().GetAllObjectsWithType(new Type[] { typeof(Beam) });

                    int i = 0;
                    while (beams.MoveNext())
                    {
                        var beam = beams.Current as Beam;

                        Console.WriteLine("Beam: ");
                        Console.WriteLine(beam.Name);
                        Console.WriteLine(beam.Profile.ProfileString);
                        Console.WriteLine(beam.StartPoint);
                        Console.WriteLine($"AssemblyNumber:{beam.AssemblyNumber.Prefix}-{beam.AssemblyNumber.StartNumber}");
                        Console.WriteLine();
                        i++;
                        if (i == 5) break;
                    }
                }
            }
        }
    }

  • 相关阅读:
    做交互设计都有哪些需要掌握的思维方式
    煤矿皮带跑偏监测识别系统
    体验提升-一个“小技巧”彻底解决锦礼商品可见不可售
    关于torch.cat()和torch.stack()的区别
    AI 换装之OOTDiffusion
    【Rust】002-基础语法:函数
    Polygon zkEVM中的子约束系统
    css实现倾斜按钮(radial-gradient)
    【牛客刷题】带你在牛客刷题第四弹(C/C++语言基础)
    JAVA集合07_关于sorted如何排序、实战三级分类树状展示
  • 原文地址:https://blog.csdn.net/qq_16215957/article/details/126896537