在用VB开发AutoCAD时候,
在图形区域内创建一个实体的时候,在执行程序时经常出现这样的错误,例如我要在实体空间范围内画一条直线,代码如下:
Private Sub Command2_Click()“点击按钮后话一条直线。AcadApp已经定义并创建了” Dim lineObj As AcadLine Dim startPoint(0 To 2) As Double Dim endPoint(0 To 2) As Double startPoint(0) = 0: startPoint(1) = 0: startPoint(2) = 0 endPoint(0) = 2: endPoint(1) = 2: endPoint(2) = 0
Set lineObj = AcadApp.ActiveDocument.ModelSpace.AddLine(startPoint, endPoint) End Sub
程序执行后 提示:
实时错误‘91’
对象变量或with块变量未设置
能不能帮忙给看一下,急,谢谢!