明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 1695|回复: 0

请教斑竹VLAX问题

[复制链接]
发表于 2005-8-16 19:39:00 | 显示全部楼层 |阅读模式

Sub getlength()
 
  Dim obj As AcadEntity
  Dim pnt As Variant
  ThisDrawing.Utility.GetEntity obj, pnt, "请选择道路中线:"
  Dim leng As Double
  leng = getcurvelength(obj)
  MsgBox "所选曲线的长度为" & leng, , "acad2000x"

End Sub


'2005.0816调试未成功
Public Function getcurvelength(curve As AcadEntity) As Double
  Dim obj As VLAX, retval
  Set obj = New VLAX
 
  obj.EvalLispExpression "(setq curve(handent " & Chr(34) & curve.Handle & Chr(34) & "))"
  obj.EvalLispExpression "(setq curvelength(vlax-curve-getDistAtParam  curve " & -" (vlax-curve-getEndParam  curve)))"
  retval = obj.GetLispSymbol("curvelength")
  obj.NullifySymbol "curve", "curvelength"
  Set obj = Nothing
  getcurvelength = CDbl(retval)
 
End Function

我想获得曲线的长度,使用你的vals类和上面的程序进行调试时,提示类型不一致,请

赐教,谢谢了

您需要登录后才可以回帖 登录 | 注册

本版积分规则

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-11-27 12:45 , Processed in 0.154747 second(s), 23 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表