在一篇论文中看到一个关于坐标系转换的程序,但是该程序在运行时,却提示“参数不可选”!是怎么回事啊?提示出错的就是下面加粗的那一行
Dim origin(0 To 2) As Double Dim xAxisPnt(0 To 2) As Double Dim yAxisPnt(0 To 2) As Double Dim org As Variant Dim xAxisp As Variant Dim yAXISP As Variant If ThisDrawing.GetVariable("UCSNAME") = "" Then
With ThisDrawing '当前坐标系未保存则保存之 Set CUITUCS = .UserCoordinateSystems.Add(.GetVariable("UCSORG"), .Utility.TranslateCoordinates(.GetVariable("UCSXDIR"), acUCS, acWorld, 0).Utility.TranslateCoordinates(.GetVariable("UCSYDIR"), acUCS, acWorld, 0), "clucs")
End With Else Set CUITUCS = ThisDrawing.ActiveUCS '保存当前坐标系
End If '创建误差预计坐标系 MsgBox "创建误差预计坐标系""" org = ThisDrawing.Utility.GetPoint(, "输入原点") origin(0) = org(0): origin(1) = org(1): origin(2) = org(2) xAxisp = ThisDrawing.Utility.GetPoint(, "x正方向上一点") xAxisPnt(0) = xAxisp(0): xAxisPnt(1) = xAxisp(1): xAxisPnt(2) = xAxisp(2) yAXISP = ThisDrawing.Utility.GetPoint(, "Y正方向上一点") yAxisPnt(0) = yAXISP(0): yAxisPnt(1) = yAXISP(1): yAxisPnt(2) = yAXISP(2) '创建预计坐标系为当前坐标系 Set ucsObj = ThisDrawing.UserCoordinateSystems.Add(origin, xAxisPnt, yAxisPnt, "yj-UCS") ThisDrawing.ActiveUCS = ucsObj '将新建坐标系置为当前
End Sub |