乐筑天下

搜索
欢迎各位开发者和用户入驻本平台 尊重版权,从我做起,拒绝盗版,拒绝倒卖 签到、发布资源、邀请好友注册,可以获得银币 请注意保管好自己的密码,避免账户资金被盗
查看: 38|回复: 2

AcadDimRotated的起点和终点

[复制链接]

34

主题

118

帖子

1

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
254
发表于 2007-5-29 09:24:31 | 显示全部楼层 |阅读模式
如何获取 AcadDimRotated 的起始点
和端点,以及如何分解 AcadDimension

本帖以下内容被隐藏保护;需要你回复后,才能看到!

游客,如果您要查看本帖隐藏内容请回复
回复

使用道具 举报

170

主题

1424

帖子

8

银币

顶梁支柱

Rank: 50Rank: 50

铜币
2119
发表于 2007-5-29 10:47:32 | 显示全部楼层
基本上通过使用lisp dxf代码13,14
把它放在你的子
varTest = vbAssoc(objDim, 13)
StartPt = ParseDxfPoint(varTest)

varTest = vbAssoc(objDim, 14)
EndPt = ParseDxfPoint(varTest)
  1. Function ParseDxfPoint(DxfPoint)
  2.     Dim Pt(2) As Double
  3.     Dim Gap1, Gap2
  4.     Gap1 = InStr(2, DxfPoint, " ", vbTextCompare)
  5.     Pt(0) = Mid(DxfPoint, 2, Gap1 - 1)
  6.     Gap2 = InStr(Gap1 + 1, DxfPoint, " ", vbTextCompare)
  7.     Pt(1) = Mid(DxfPoint, Gap1 + 1, Gap2 - (Gap1 + 1))
  8.     Pt(2) = Mid(DxfPoint, Gap2 + 1, Len(DxfPoint) - (Gap2 + 1))
  9.     ParseDxfPoint = Pt
  10.    
  11. End Function
  12. 'SomeCallMeDave
  13. 'http://www.vbdesign.net/expresso/showthread.php?postid=83887#post83887
  14. 'Changed pAcadObj As AcadObject to pAcadObj As Object to access imagedef as well
  15. 'Modified by Jeff Mishler, March 2006, to get the Block table object, not Block_Record table object
  16. Public Function vbAssoc2(pAcadObj, pDXFCode As Integer) As Variant
  17. Dim VLisp As Object
  18. Dim VLispFunc As Object
  19. Dim varRetVal As Variant
  20. Dim obj1 As Object
  21. Dim obj2 As Object
  22. Dim strHnd As String
  23. Dim strVer As String
  24. Dim lngCount As Long
  25. Dim i As Long
  26. Dim J As Long
  27. On Error GoTo vbAssocError
  28.    
  29. If Left(ThisDrawing.Application.Version, 2) = "16" Then
  30.   Set VLisp = ThisDrawing.Application.GetInterfaceObject("VL.Application.16")
  31. Else
  32.   Set VLisp = ThisDrawing.Application.GetInterfaceObject("VL.Application.1")
  33. End If
  34. Set VLispFunc = VLisp.ActiveDocument.Functions
  35. strHnd = pAcadObj.Handle
  36. If TypeOf pAcadObj Is AcadBlock Then
  37.     strHnd = Hex(1 + Val("&H" & strHnd))
  38. End If
  39. Set obj1 = VLispFunc.Item("read").Funcall("pDXF")
  40.   varRetVal = VLispFunc.Item("set").Funcall(obj1, pDXFCode)
  41. Set obj1 = VLispFunc.Item("read").Funcall("pHandle")
  42.   varRetVal = VLispFunc.Item("set").Funcall(obj1, strHnd)
  43. Set obj1 = VLispFunc.Item("read").Funcall("(vl-princ-to-string (cdr (assoc pDXF (entget (handent pHandle)))))")
  44.   varRetVal = VLispFunc.Item("eval").Funcall(obj1)
  45. vbAssoc2 = varRetVal
  46. 'clean up the newly created LISP symbols
  47. Set obj1 = VLispFunc.Item("read").Funcall("(setq pDXF nil)")
  48.   varRetVal = VLispFunc.Item("eval").Funcall(obj1)
  49. Set obj1 = VLispFunc.Item("read").Funcall("(setq pHandle nil)")
  50.   varRetVal = VLispFunc.Item("eval").Funcall(obj1)
  51. 'release the objects or Autocad gets squirrely (no offense RR)
  52. Set obj2 = Nothing
  53. Set obj1 = Nothing
  54. Set VLispFunc = Nothing
  55. Set VLisp = Nothing
  56. Exit Function

回复

使用道具 举报

34

主题

118

帖子

1

银币

后起之秀

Rank: 20Rank: 20Rank: 20Rank: 20

铜币
254
发表于 2007-5-29 10:50:34 | 显示全部楼层
谢啦
回复

使用道具 举报

发表回复

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

本版积分规则

  • 微信公众平台

  • 扫描访问手机版

  • 点击图片下载手机App

QQ|关于我们|小黑屋|乐筑天下 繁体中文

GMT+8, 2025-7-7 22:28 , Processed in 0.254983 second(s), 59 queries .

© 2020-2025 乐筑天下

联系客服 关注微信 帮助中心 下载APP 返回顶部 返回列表