请教斑竹VLAX问题
<P>Sub getlength()<BR> <BR> Dim obj As AcadEntity<BR> Dim pnt As Variant<BR> ThisDrawing.Utility.GetEntity obj, pnt, "请选择道路中线:"<BR> Dim leng As Double<BR> leng = getcurvelength(obj)<BR> MsgBox "所选曲线的长度为" & leng, , "acad2000x"</P><P>End Sub</P>
<P><BR>'2005.0816调试未成功<BR>Public Function getcurvelength(curve As AcadEntity) As Double<BR> Dim obj As VLAX, retval<BR> Set obj = New VLAX<BR> <BR> obj.EvalLispExpression "(setq curve(handent " & Chr(34) & curve.Handle & Chr(34) & "))"<BR> obj.EvalLispExpression "(setq curvelength(vlax-curve-getDistAtParam curve " & -" (vlax-curve-getEndParam curve)))"<BR> retval = obj.GetLispSymbol("curvelength")<BR> obj.NullifySymbol "curve", "curvelength"<BR> Set obj = Nothing<BR> getcurvelength = CDbl(retval)<BR> <BR>End Function</P>
<P>我想获得曲线的长度,使用你的vals类和上面的程序进行调试时,提示类型不一致,请</P>
<P>赐教,谢谢了</P>
页:
[1]