如何利用Grasshopper中的C#制作一个简单的Tekla18.1折梁创建电池(二)

上一篇内容已经详细地列出了准备工作,所以这一次直接贴出代码,自行粘贴使用

Model myModel = new Model(); //实例化模型
    Rhino.Geometry.Polyline line = null;
    x.TryGetPolyline(out line); //将CURVE类型转换成polyline
    Point3dList.XAccess pointX = line.X; //获取犀牛中线控制点的X值
    Point3dList.YAccess pointY = line.Y; //获取犀牛中线控制点的Y值
    Point3dList.ZAccess pointZ = line.Z; //获取犀牛中线控制点的Z值
    Contour pointList = new Contour();
    for (int i = 0; i < line.Count; i++)
    {

      pointList.ContourPoints.Add(new Tekla.Structures.Geometry3d.Point(pointX[i], pointY[i], pointZ[i]));
    }


    if (line.Count > 2)//如果点的数量大于2,该梁为折梁
    {
      PolyBeam polyBeam = new PolyBeam();
      foreach (Tekla.Structures.Geometry3d.Point item in pointList.ContourPoints)
      {

        Tekla.Structures.Model.ContourPoint pop = new Tekla.Structures.Model.ContourPoint(new Tekla.Structures.Geometry3d.Point(item.X, item.Y, item.Z), null);//将犀牛中的点转换为t
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 5
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 5
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值