将当前UCS保存就可以设置当前UCS为ActiveUCS
用ThisDrawing.UserCoordinateSystems ("Test")返回名为Test的UCS<BR> lzh741206发表于2004-5-4 22:01:00static/image/common/back.gifSendCommand( \"UCS \" & VBCR & \"S\" & VBCR & \"Test\" & VBCR)
将当前UCS保存就可以设置当前UCS为ActiveUCS
用ThisDrawing.UserCoordin...
<BR>哎呀,我怎么没想到啊!笨死了!!
这个论坛现在就两个人,一个是优秀教师lzh741206,另一个是笨学生ahlzl! 哈哈,没关系,每个人都有这个过程的,关键要多看看帮助 我写了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兄请给改一下. 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]