ybhfau 发表于 2006-2-23 18:08:00

关于使用addline的方法出现的奇怪错误???!

<P>我需要使用addline的方法创建一条直线,但是,我发现每次运行都出现错误,困扰了我好久,我虽然使用AddLightWeightPolyline已经实现了目标,但是,我想addline不是更加的简单嘛?因此,结果却出现了错误,我水平有限,检查不出来,请各位大侠帮我看看好嘛?多谢了!主要代码如下:<BR>Dim zgstarpoint(0 To 1) As Double<BR>Dim zgendpoint(0 To 1) As Double<BR>&nbsp;'提醒选择相交边<BR>&nbsp;&nbsp; MsgBox ("为了确定主干管的位置,请选择与主干管相交的第一条边!")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Dim PtPick1, ptpick2 As Variant<BR>&nbsp;&nbsp;&nbsp; sgg.Hide<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; PtPick1 = ThisDrawing.Utility.GetPoint(, "选择点")<BR>&nbsp;&nbsp;&nbsp; 'txtInsertX.Text = PtPick(0): txtInsertY.Text = PtPick(1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox ("第一个选择的点的x坐标,y坐标为:" &amp; PtPick1(0) &amp; PtPick1(1))<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zgstarpoint(0) = PtPick1(0) + 10: zgstarpoint(1) = PtPick1(1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 'zgstarpoint(1) = PtPick(1)<BR>&nbsp;&nbsp; MsgBox "为了确定主干管的位置,请选择与主干管相交的第二条边!"<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ptpick2 = ThisDrawing.Utility.GetPoint(, "选择点")<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MsgBox ("第二个选择的点的x坐标,y坐标为:") &amp; ptpick2(0) &amp; ptpick2(1)<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; zgendpoint(0) = ptpick2(0) + 10: zgendpoint(1) = ptpick2(1)<BR>&nbsp;&nbsp;&nbsp; Set zgline = ThisDrawing.ModelSpace.AddLine(zgstarpoint, zgendpoint)</P>

ybhfau 发表于 2006-2-23 18:37:00

<P>我已经弄明白了,原来addline必须使用3维坐标,而我却使用了2维,因此,发生了错误,真的不好意思,这样简单的问题居然拿了出来献丑!</P>
<P>大家别介意!</P>
页: [1]
查看完整版本: 关于使用addline的方法出现的奇怪错误???!