请问我的宏为什么在VBA编辑器运行正常,用命令运行却不行?
我的代码如下:Sub test05()
Dim Ent As AcadEntity
Dim SS As AcadSelectionSet
Set SS = PickFirstSSet
For Each Ent In SS
Ent.color = acYellow
Next
End Sub
Function PickFirstSSet() As AcadSelectionSet
On Error Resume Next
ThisDrawing.SelectionSets("PICKFIRST").Delete
Set PickFirstSSet = ThisDrawing.PickfirstSelectionSet
If PickFirstSSet.Count = 0 Then
PickFirstSSet.SelectOnScreen
End If
End Function
我先在屏幕上点选了一个对象,例如一条直线,然后回到VBA 编辑器里点运行上面的代码,一切正常,直线如期变成了黄色,
但当我在LISP编辑器输入下面代码,并保存加载后,同样先在屏幕上点选了一个对象,例如一条直线,然后输入AAA,却要求我选择对象,也就是我在屏幕已选的直线先择被清除了,又要重新选。
(defun c:AAA()
(command"-vbarun" "test05")
(prin1)
)
好像是用(command "-vbarun " "test05") 就会把PICKFIRST选择集清掉
页:
[1]