Had not seen Tharwat's post when I chose this solution:
- (initget "Set Not") (setq ans (cond ( (getkword "\nSet planting area in name tag? [set/do Not set] : ")) ("Set"))) (if (= ans "Set") (progn (command "-vbarun" "SetPlantingArea")(princ) ) )
The 'setplantingarea' vba routine does not expect any arguments. The line
(command "-vbarun" "setplantingarea") runs in isolation without returning any error. However, when run as part of the code snippet I get:
Set planting area in tag? [set/do Not set] : s
Set planting area in tag? [set/do Not set] :
*Invalid selection*
Expects a point or Last
*Invalid selection*
Expects a point or Last
Function cancelledSelect area object:
Command: Select destination tag:
I have no idea what is generating the 'invalid selection' error! The SetPlantingArea routine works perfectly despite the error on the command line. |