aini86841210 发表于 2010-6-20 15:14:00

求救关于CAD二次开发的问题

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

aini86841210 发表于 2010-6-21 11:54:00

怎么没人回答啊?

yg545france 发表于 2011-12-18 23:48:08

本帖最后由 yg545france 于 2011-12-18 23:50 编辑

http://www.mjtd.com/object/acad2004/ex_ucss.htm

http://bbs.mjtd.com/forum.php?mod=viewthread&tid=76991

Mitsu老张 发表于 2012-6-16 17:07:01

学习,看看而已
页: [1]
查看完整版本: 求救关于CAD二次开发的问题