Author Topic: lisp ssget on script not working  (Read 1255 times)

0 Members and 1 Guest are viewing this topic.

MarioR

  • Newt
  • Posts: 66
lisp ssget on script not working
« on: June 14, 2024, 02:49:25 AM »
Hello,

i will use an lisp "ssget" for script ('#' == space on lineend):
Code: [Select]
_explode (ssget "_X" '((0 . "INSERT")))#
On normal commandline it works, but in script is not working.

why?

regards Mario

berger@archtools.de

  • Mosquito
  • Posts: 12
Re: lisp ssget on script not working
« Reply #1 on: June 19, 2024, 06:09:00 PM »
Hello,

i will use an lisp "ssget" for script ('#' == space on lineend):
Code: [Select]
_explode (ssget "_X" '((0 . "INSERT")))#

Explode one Insert-Entity after the other.  Use the ss->list function below and enter the following line in your script:

(mapcar '(lambda (en) (command "._explode" en)) (ss->list  (ssget "_X" '((0 . "INSERT")))))

(defun ss->list (sset / eset counter)
  (setq counter 0)
  (if (= 'PICKSET (type sset))
    (repeat (sslength sset)
      (setq eset (cons (ssname sset counter) eset)
            counter (1+ counter)
      )
    )
 

dexus

  • Bull Frog
  • Posts: 232
Re: lisp ssget on script not working
« Reply #2 on: June 20, 2024, 02:13:59 AM »
Could you try this:
Code - Auto/Visual Lisp: [Select]
  1. (command "_explode" (ssget "_X" '((0 . "INSERT"))))

Lee Mac

  • Seagull
  • Posts: 12939
  • London, England
Re: lisp ssget on script not working
« Reply #3 on: June 20, 2024, 06:03:31 AM »
The behaviour of the EXPLODE command when supplied with a selection set in unattended mode will be determined by the setting of the undocumented QAFLAGS system variable, which uses the following bit codes:

Code: [Select]
0 - Commands work like normal
1 - ^C in menu cancels grips in they are active, simulating the ESCape key, allows selection sets in explode when used in AutoLISP.
2 - No pauses during the List command
4 - No Alert boxes displayed
8 - Unknown
16 - Unknown
32 - Unknown
64 - Unknown
128 - Allows for the use of Noun/Verb and Grips via. The AutoLISP command function (e.g., emulate user picks while AutoCAD is at the Command: prompt)
256 - Unknown
512 - Sets Bind type to insert in AutoCAD R14

Note the description of bit code 1 -
  • If bit code 1 is set, EXPLODE will expect a selection set to be supplied and will therefore require an additonal ENTER to submit the selection set to the selection prompt.
  • If bit code 1 is not set, EXPLODE will expect a single entity to be supplied and will proceed without requiring ENTER at the selection prompt.