Hi Guys,
I have an issue with the pickfirst selection in my VBA Routine.
If i run my VBA routine using the visual basic editor Run->Run, ThisDrawing.PickfirstSelectionSet.Count works correctly and display the number of the current selected objects in Autocad.
But...
Now if i run this VBA routine using a command via Lisp OR using a Custom button, ThisDrawing.PickfirstSelectionSet.Count ALWAYS shows "0".
Someone did already experience this issue?!
The List function to start the vba routine is:
--------------------------------------------------------
(defun C:rotobj ()
(vl-load-com)
(vl-vbarun "acad.dvb!RotateObjects")
)
Alternatively, the command behind the Custom button is:
-----------------------------------
-vbarun;RotateObjects
-----------------------------------
regards
Solved! Go to Solution.
Solved by remy.baud. Go to Solution.
Accordind to this post:
http://forums.autodesk.com/t5/Visual-Basic-Customization/Pickfirst-selection-set/td-p/300452
We should use instead of "vbarun" the "vla-RunMacro" function, because vbarun clears the pick first selection set.
(defun C:MyCommand ()
(vl-load-com)
(setq applic (vlax-get-acad-object))
(vla-RunMacro applic "acad.dvb!MyCommandMacro")
(princ)
)
and it works fine form me