Dim acadapp As Object Dim acaddoc As Object Dim mospace As Object Dim paspace As Object Dim lineobj, txtobj As Object '实体定义 Dim stp(2), endp(2) As Double '点定义 Dim insp As Variant 'On Error Resume Next Set acadapp = GetObject(, "AutoCAD.Application.16") If Err Then Set acadapp = CreateObject("AutoCAD.Application.16") If Err Then MsgBox Err.Description Exit Sub End If End If Set acaddoc = acadapp.ActiveDocument Set mospace = acaddoc.ModelSpace Set paspace = acaddoc.PaperSpace Set acadut = acaddoc.Utility acadapp.Visible = True stp(0) = 0#: stp(1) = 0#: stp(2) = 0#: endp(0) = 0#: endp(1) = 100#: endp(2) = 0# Set lineobj = mospace.AddLine(stp, endp) 上面这些语句生成一条直线为什么总提示”错误的过程调用或参数“,如果在屏幕上点取两个点可以画出直线,但这样应该没错啊,请各位指点一下 是stp和endp定义不对吗,导致参数错误吗? |