《tekla二次开发代码(共3页).docx》由会员分享,可在线阅读,更多相关《tekla二次开发代码(共3页).docx(3页珍藏版)》请在得力文库 - 分享文档赚钱的网站上搜索。
1、精选优质文档-倾情为你奉上在Tekla的安装目录(D:TeklaStructures13.0ntbinplugins)中为我们提供了.Net API接口,利用这些接口,可以实现对Tekla模型的控制和修改操作。本贴将讲述一个最简单的在Tekla中创建梁对象的示例,通过一个按钮在运行的Tekla进程中快速创建模型。需要注意的是,运行此示例程序时Tekla程度需要打开一个模型。要连接Tekla模型数据库,需要在C#中添加“Tekla.Structures.Model”的引用,按钮下代码如下(C#):privatevoidbutton1_Click(objectsender,EventArgse)M
2、odelM=newModel();if(M.GetConnectionStatus()/判断是否获取了Tekla进程Tekla.Structures.PointPt1=newTekla.Structures.Point(0,0,0);Tekla.Structures.PointPt2=newTekla.Structures.Point(6000,0,0);Tekla.Structures.PointPt3=newTekla.Structures.Point(6000,3000,0);Tekla.Structures.PointPt4=newTekla.Structures.Point(0,30
3、00,0);Tekla.Structures.PointPt5=newTekla.Structures.Point(0,0,3000);Tekla.Structures.PointPt6=newTekla.Structures.Point(6000,0,3000);Tekla.Structures.PointPt7=newTekla.Structures.Point(6000,3000,3000);Tekla.Structures.PointPt8=newTekla.Structures.Point(0,3000,3000);BeamC1=newBeam(Pt1,Pt5);BeamC2=new
4、Beam(Pt2,Pt6);BeamC3=newBeam(Pt3,Pt7);BeamC4=newBeam(Pt4,Pt8);C1.Profile.ProfileString=HM440*300*11*18;C2.Profile.ProfileString=HM440*300*11*18;C3.Profile.ProfileString=HM440*300*11*18;C4.Profile.ProfileString=HM440*300*11*18;C1.Material.MaterialString=Q235B;C2.Material.MaterialString=Q235B;C3.Mater
5、ial.MaterialString=Q235B;C4.Material.MaterialString=Q235B;C1.Name=Column;C2.Name=Column;C3.Name=Column;C4.Name=Column;C1.Position.Depth=Position.DepthEnum.MIDDLE;C2.Position.Depth=Position.DepthEnum.MIDDLE;C3.Position.Depth=Position.DepthEnum.MIDDLE;C4.Position.Depth=Position.DepthEnum.MIDDLE;BeamB1
6、=newBeam(Pt5,Pt6);BeamB2=newBeam(Pt6,Pt7);BeamB3=newBeam(Pt7,Pt8);BeamB4=newBeam(Pt8,Pt5);B1.Profile.ProfileString=HN400*200*8*13;B2.Profile.ProfileString=HN400*200*8*13;B3.Profile.ProfileString=HN400*200*8*13;B4.Profile.ProfileString=HN400*200*8*13;B1.Material.MaterialString=Q235B;B2.Material.MaterialString=Q235B;B3.Material.MaterialString=Q235B;B4.Material.MaterialString=Q235B;B1.Name=Beam;B2.Name=Beam;B3.Name=Beam;B4.Name=Beam;C1.Insert();/插入梁到模型数据库C2.Insert();C3.Insert();C4.Insert();B1.Insert();B2.Insert();B3.Insert();B4.Insert();M.CommitChanges();专心-专注-专业