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