[求助]vb与cad的问题
<P><FONT size=2>求助:vb与cad的问题<BR><BR></FONT>我可以在caD中画直线,但不能用样条曲线,请问,如何解决?<BR>具体如下:<BR> Set splineobj = AcadDoc.ModelSpace.AddLine(pt1, pt2) 可以画直线,</P><P>将其改为<BR> Set splineobj = AcadDoc.ModelSpace.AddSpLine(pt1, pt2) </P>
<P> 提示“ .AddSpLine ”参数不可选。我真不知道怎么回事?请知道的朋友赐教,谢谢!!! </P>
<P>具体是: </P>
<P>For i = 1 To n - 1<BR> pt1(0) = x(i): pt1(1) = y(i): pt1(2) = 0 '第一点的X、Y、Z<BR> pt2(0) = x(i + 1): pt2(1) = y(i + 1): pt2(2) = 0 '第二点的X、Y、Z<BR> Set splineobj = AcadDoc.ModelSpace.AddSpline(pt1, pt2)<BR> Next <BR></P> <P>addspline用法:</P>
<P class=Heading-2>Signature
<P class=syntax>RetVal = object.AddSpline(PointsArray, StartTangent, EndTangent)
<P class=element>Object</P>
<P class=element-desc><A href="mk:@MSITStore:C:\Program%20Files\MDT6\HELP\ACADAUTO.CHM::/idh_modelspace_collection.htm" target="_blank" >ModelSpace Collection</A>, <A href="mk:@MSITStore:C:\Program%20Files\MDT6\HELP\ACADAUTO.CHM::/idh_paperspace_collection.htm" target="_blank" >PaperSpace Collection</A>, <A href="mk:@MSITStore:C:\Program%20Files\MDT6\HELP\ACADAUTO.CHM::/idh_block_object.htm" target="_blank" >Block</A><BR>The object or objects this method applies to.
<P class=element>PointsArray</P>
<P class=element-desc>Variant (array of doubles); input-only<BR>An array of 3D WCS coordinates defining the spline curve. At least two points (six elements) are required for constructing a Spline object. The array size must be in multiples of three.
<P class=element>StartTangent</P>
<P class=element-desc>Variant (three-element array of doubles); input-only<BR>A 3D vector specifying the tangency of the spline curve at the first point.
<P class=element>EndTangent</P>
<P class=element-desc>Variant (three-element array of doubles); input-only<BR>A 3D vector specifying the tangency of the spline curve at the last point.
<P class=element>RetVal</P>
<P class=element-desc><A href="mk:@MSITStore:C:\Program%20Files\MDT6\HELP\ACADAUTO.CHM::/idh_spline_object.htm" target="_blank" >Spline</A> object<BR>The newly created Spline object. </P>
<P class=element-desc> </P>
<P class=element-desc>例子如下:</P>
<P class=element-desc>Dim splineObj As AcadSpline<BR> Dim startTan(0 To 2) As Double<BR> Dim endTan(0 To 2) As Double<BR> Dim fitPoints(0 To 8) As Double<BR> <BR> startTan(0) = 0.5: startTan(1) = 0.5: startTan(2) = 0<BR> endTan(0) = 0.5: endTan(1) = 0.5: endTan(2) = 0<BR> fitPoints(0) = 1: fitPoints(1) = 1: fitPoints(2) = 0<BR> fitPoints(3) = 5: fitPoints(4) = 5: fitPoints(5) = 0<BR> fitPoints(6) = 10: fitPoints(7) = 0: fitPoints(8) = 0<BR> Set splineObj = ThisDrawing.ModelSpace.AddSpline(fitPoints, startTan, endTan)<BR> ZoomAll<BR></P> <P>谢谢!!!</P>
<P>请问:fitPoints 指什么?</P> 就是PLine上所有的节点(拐点)
页:
[1]