拉伸曲线
ptList=List[Point]() #定义一个点的列表
ptList.Add(Point.Create(MM(11),MM(-14),MM(0))) #创建点,并放入列表当中
ptList.Add(Point.Create(MM(22),MM(2),MM(0))) #创建点,并放入列表当中
ptList.Add(Point.Create(MM(20), MM(25),MM(0))) #创建点,并放入列表当中
ptList.Add(Point.Create(MM(24), MM(41),MM(0))) #创建点,并放入列表当中
ncurve = NurbsCurve.CreateThroughPoints(False, ptList, 0.0001) #创建一个样条曲线穿过所有创建的点
curveSegment = CurveSegment.Create(ncurve) #创建一个有限线段对象
designCurve = DesignCurve.Create(GetRootPart(),curveSegment) #创建DesignCurve对象
selection = Selection.Create(designCurve) #将DesignCurve对象选入
options = ExtrudeEdgeOptions() #定义一个拉伸曲线的选项,后面传入拉伸选项当中
options.PullSymmetric = False #是否双向拉伸
options.Copy = False #是否拷贝拉伸的曲线到最终位置
options.ExtrudeType = ExtrudeType.None #拉伸的类型
result = ExtrudeEdges.Execute(selection, Point.Create(MM(0), MM(0), MM(0)), Direction.Create(0, 0, 1), MM(20), options) #拉伸,该函数一共有两个重载函数
导圆角(导直角还无法实现)
result=BlockBody.Create(Point.Create(MM(-10), MM(-10), MM(-10)), Point.Create(MM(10), MM(10), MM(10))) #创建一个正方体
selection = Selection.Create(result.CreatedBody.Edges) #选中正方体的所有边
result = ConstantRound.Execute(selection, MM(2)) #倒角,该函数一共有两个重载函数,这里用到的函数,第一个参数为倒角的边,第二个参数为倒角的半径,第三个参数为默认参数,默认参数为null
偏移边
ptList=List[Point]() #定义一个点的列表
ptList.Add(Point.Create(MM(11),MM(-14),MM(0))) #创建点,并放入列表当中