(Tekla Structures二次开发)beam属性赋值

回复某同学私信,关于beam属性赋值,代码如下:

            TSM.Beam beam = new Beam();
            beam.Name = "Beam";//名称
            beam.Profile.ProfileString = "HN400*200*8*13";//截面型材
            beam.Material.MaterialString = "Q235B";//材质
            beam.Finish = "Galv.";//抛光
            beam.Class = "14";//等级
            beam.PartNumber.Prefix = "P";//零件前缀
            beam.PartNumber.StartNumber = 1;//零件开始编号
            beam.AssemblyNumber.Prefix = "A";//构件前缀
            beam.AssemblyNumber.StartNumber = 1;//构件开始编号
            beam.Position.Plane = Position.PlaneEnum.MIDDLE;//位置,在平面上
            beam.Position.PlaneOffset = 0.0;
            beam.Position.Rotation = Position.RotationEnum.TOP;//位置,旋转
            beam.Position.RotationOffset = 0.0;
            beam.Position.Depth = Position.DepthEnum.MIDDLE;//位置,在深度
            beam.Position.DepthOffset = 0.0;
            beam.StartPointOffset.Dx = 0.0;//末端偏移,开始
            beam.StartPointOffset.Dy = 0.0;
            beam.StartPointOffset.Dz = 0.0;
            beam.EndPointOffset.Dx = 0.0;//末端偏移,末端
            beam.EndPointOffset.Dy = 0.0;
            beam.EndPointOffset.Dz = 0.0;
            beam.SetUserProperty("comment","1");//设置用户定义属性
            string comment="";
            beam.GetUserProperty("comment", ref comment);//获取用户定义属性

关于用户定义属性,请参见object.ini文件,常用参考如下图:
(Tekla Structures二次开发)beam属性赋值_第1张图片

你可能感兴趣的:(Tekla)