您可以使用 AutoCAD 创建各种曲线对象,包括样条曲线、圆形、圆弧和椭圆。 所有曲线都是在当前 WCS 的 XY 平面上创建的。 若要创建曲线,请使用下列方法之一:
创建样条对象此示例使用三个点 (0, 0, 0)、(5, 5, 0) 和 (10, 0, 0) 在模型空间中创建样条曲线。样条的起点和终点切线为 (0.5, 0.5, 0.0)。 Sub Ch4_CreateSpline() ' This example creates a spline object in model space. ' Declare the variables needed Dim splineObj As AcadSpline Dim startTan(0 To 2) As Double Dim endTan(0 To 2) As Double Dim fitPoints(0 To 8) As Double ' Define the variables startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0 endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0 fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0 fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0 fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0 ' Create the spline Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan) ZoomAll End Sub 父主题: |
|Archiver|CAD开发者社区 ( 苏ICP备2022047690号-1 苏公网安备32011402011833)
GMT+8, 2025-1-8 19:49
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.