Hi Chuck, You are correct. This thread got me to thinking and I did a
little testing to determine why I couldn't set the pickfirst ss. I figured
that it was because an acad command was running and as we know the pfss
can't be set when a command is active, so I tested for it:
Public Sub setPickFirst()
Dim lispCode As VLAX
Dim oEnt As AcadEntity, dPnt() As Double
Set lispCode = New VLAX
With ThisDrawing
MsgBox .GetVariable("cmdactive") & vbCr & .GetVariable("cmdnames")
End With
ThisDrawing.Utility.GetEntity oEnt, dPnt, "Select object: "
lispCode.EvalLispExpression "(setq ss (ssadd))"
lispCode.EvalLispExpression "(ssadd " & _
"(handent " & Chr(34) & oEnt.Handle &
Chr(34) & ")" & _
"ss" & _
")"
lispCode.EvalLispExpression "(sssetfirst nil ss)"
lispCode.EvalLispExpression "(setq ss nil)"
Set lispCode = Nothing
End Sub
I found out, the hard way 😉 ,that (vl-vbarun) actually runs the VBARUN
command. Also, when running a VBA macro an undocumented 6th bit is set in
the CMDACTIVE sysvar. At least up to a2ki it's undocumented...All in all,
this has been an extremely informative thread for me. Thanks Chuck and
Tony.
;;;Test 1
(vl-vbarun "testModule.setPickFirst")
CMDACTIVE = 33
CMDNAMES = -VBARUN
;;;Test 2
(vla-runmacro (vlax-get-acad-object) "setpickfirst")
CMDACTIVE = 32
CMDNAMES = ""
--
Bobby C. Jones
http://www.acadx.com