关于使用addline的方法出现的奇怪错误???!
<P>我需要使用addline的方法创建一条直线,但是,我发现每次运行都出现错误,困扰了我好久,我虽然使用AddLightWeightPolyline已经实现了目标,但是,我想addline不是更加的简单嘛?因此,结果却出现了错误,我水平有限,检查不出来,请各位大侠帮我看看好嘛?多谢了!主要代码如下:<BR>Dim zgstarpoint(0 To 1) As Double<BR>Dim zgendpoint(0 To 1) As Double<BR> '提醒选择相交边<BR> MsgBox ("为了确定主干管的位置,请选择与主干管相交的第一条边!")<BR> Dim PtPick1, ptpick2 As Variant<BR> sgg.Hide<BR> PtPick1 = ThisDrawing.Utility.GetPoint(, "选择点")<BR> 'txtInsertX.Text = PtPick(0): txtInsertY.Text = PtPick(1)<BR> MsgBox ("第一个选择的点的x坐标,y坐标为:" & PtPick1(0) & PtPick1(1))<BR> zgstarpoint(0) = PtPick1(0) + 10: zgstarpoint(1) = PtPick1(1)<BR> 'zgstarpoint(1) = PtPick(1)<BR> MsgBox "为了确定主干管的位置,请选择与主干管相交的第二条边!"<BR> ptpick2 = ThisDrawing.Utility.GetPoint(, "选择点")<BR> MsgBox ("第二个选择的点的x坐标,y坐标为:") & ptpick2(0) & ptpick2(1)<BR> zgendpoint(0) = ptpick2(0) + 10: zgendpoint(1) = ptpick2(1)<BR> Set zgline = ThisDrawing.ModelSpace.AddLine(zgstarpoint, zgendpoint)</P> <P>我已经弄明白了,原来addline必须使用3维坐标,而我却使用了2维,因此,发生了错误,真的不好意思,这样简单的问题居然拿了出来献丑!</P><P>大家别介意!</P>
页:
[1]