明经CAD社区

 找回密码
 注册

QQ登录

只需一步,快速开始

搜索
12
返回列表 发新帖
楼主: ahlzl

关于.NET调试等的一些问题

  [复制链接]
发表于 2004-5-4 22:01 | 显示全部楼层
SendCommand( "UCS " & VBCR & "S" & VBCR & "Test" & VBCR) 将当前UCS保存就可以设置当前UCS为ActiveUCS 用ThisDrawing.UserCoordinateSystems ("Test")返回名为Test的UCS
 楼主| 发表于 2004-5-4 22:59 | 显示全部楼层
lzh741206发表于2004-5-4 22:01:00SendCommand( \"UCS \" & VBCR & \"S\" & VBCR & \"Test\" & VBCR) 将当前UCS保存就可以设置当前UCS为ActiveUCS 用ThisDrawing.UserCoordin...

哎呀,我怎么没想到啊!笨死了!! 这个论坛现在就两个人,一个是优秀教师lzh741206,另一个是笨学生ahlzl!
发表于 2004-5-4 23:02 | 显示全部楼层
哈哈,没关系,每个人都有这个过程的,关键要多看看帮助
 楼主| 发表于 2004-5-5 08:43 | 显示全部楼层
我写了VBA代码(学校电脑上没.NET)
  1. Sub abc()Dim ucsObj As AcadUCS
  2. ThisDrawing.SendCommand ("UCS S" & vbCr & "Test" & vbCr)
  3. Set ucsObj = ThisDrawing.UserCoordinateSystems("test")
  4. [color=red]ThisDrawing.SendCommand ("n ")[/color]Dim WCSPnt As Variant
  5. Dim UCSPnt As VariantWCSPnt = ThisDrawing.Utility.GetPoint(, "Enter a point: ")
  6. UCSPnt = ThisDrawing.Utility.TranslateCoordinates(WCSPnt, acWorld, acUCS, False)
  7.    
  8. Dim cc As AcadCircle
  9. Dim r As Double
  10. r = 100
  11. Set cc = ThisDrawing.ModelSpace.AddCircle(WCSPnt, r)End Sub
红色的代码看的不爽,lzh741206兄请给改一下.
发表于 2004-5-5 09:08 | 显示全部楼层
  1. On Error Resume Next
  2. Dim ucsObj As AcadUCS
  3. Set ucsObj = ThisDrawing.UserCoordinateSystems("test")
  4. If Err Then
  5. Err.Clear
  6. ThisDrawing.SendCommand ("UCS S" & vbCr & "Test" & vbCr)Set ucsObj = ThisDrawing.UserCoordinateSystems("test")
  7. End If
您需要登录后才可以回帖 登录 | 注册

本版积分规则

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

GMT+8, 2024-4-20 00:28 , Processed in 0.254788 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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