雪山飞狐_lzh 发表于 2004-5-4 22:01:00

SendCommand( "UCS " & VBCR & "S" & VBCR & "Test" & VBCR)


将当前UCS保存就可以设置当前UCS为ActiveUCS


用ThisDrawing.UserCoordinateSystems ("Test")返回名为Test的UCS<BR>

ahlzl 发表于 2004-5-4 22:59:00

lzh741206发表于2004-5-4 22:01:00static/image/common/back.gifSendCommand( \"UCS \" &amp; VBCR &amp; \"S\" &amp; VBCR &amp; \"Test\" &amp; VBCR)



将当前UCS保存就可以设置当前UCS为ActiveUCS


用ThisDrawing.UserCoordin...


<BR>哎呀,我怎么没想到啊!笨死了!!


这个论坛现在就两个人,一个是优秀教师lzh741206,另一个是笨学生ahlzl!

雪山飞狐_lzh 发表于 2004-5-4 23:02:00

哈哈,没关系,每个人都有这个过程的,关键要多看看帮助

ahlzl 发表于 2004-5-5 08:43:00

我写了VBA代码(学校电脑上没.NET)Sub abc()Dim ucsObj As AcadUCS
ThisDrawing.SendCommand ("UCS S" & vbCr & "Test" & vbCr)
Set ucsObj = ThisDrawing.UserCoordinateSystems("test")
ThisDrawing.SendCommand ("n ")Dim WCSPnt As Variant
Dim UCSPnt As VariantWCSPnt = ThisDrawing.Utility.GetPoint(, "Enter a point: ")
UCSPnt = ThisDrawing.Utility.TranslateCoordinates(WCSPnt, acWorld, acUCS, False)
   
Dim cc As AcadCircle
Dim r As Double
r = 100
Set cc = ThisDrawing.ModelSpace.AddCircle(WCSPnt, r)End Sub红色的代码看的不爽,lzh741206兄请给改一下.

雪山飞狐_lzh 发表于 2004-5-5 09:08:00

On Error Resume Next
Dim ucsObj As AcadUCS
Set ucsObj = ThisDrawing.UserCoordinateSystems("test")
If Err Then
Err.Clear
ThisDrawing.SendCommand ("UCS S" & vbCr & "Test" & vbCr)Set ucsObj = ThisDrawing.UserCoordinateSystems("test")

End If
页: 1 [2]
查看完整版本: 关于.NET调试等的一些问题