|
发表于 2011-11-13 17:28:00
|
显示全部楼层
'自定义函数 返回顺着曲线长度方向任一点的距离
Public Function GetDistanceAtPoint(ByVal mvarEntity As AcadEntity, ByVal Point As Object) As Double
Dim objVLAX As New vlax, retval As Object
objVLAX.SetLispSymbol("d", Point)
objVLAX.EvalLispExpression("(setq ent (handent " & Chr(34) & mvarEntity.Handle & Chr(34) & "))")
objVLAX.EvalLispExpression("(setq pt (vlax-curve-getDistAtPoint ent d))")
retval = objVLAX.GetLispList("pt")
objVLAX.NullifySymbol("ent", "d", "pt")
MsgBox(retval)
GetDistanceAtPoint = retval
objVLAX = Nothing
End Function
返回结果为空值 |
|