PDA

View Full Version : lisp problem


Pete
06-25-2003, 08:49 AM
I have:
(setq ssl (ssget "X" '((0 . "INSERT"))))

I get:
a selection set of all blocks in the drawing.

My problem:
If I put this lisp line after the one above:
(command "explode" "p" "")
I get an error: *Invalid Selection* Expects a point or Last/All/Group

However, if I type the following on the command line after executing the
first lisp line (ssget):
explode <enter> p <enter><enter>
The set of all blocks is exploded.


Why does explode, previous, work on the command line and not in the lisp
code?

Pete
06-25-2003, 12:13 PM
What I meant to say is that the explode command has the selection option,
"previous" when used on the command line but when using it in lisp code, it
does not appear to have have that option (along with a few other options)

Anyway, thanks for the help. It works fine. I simplified the loop a bit:

(setq ssl (ssget "X" '((0 . "INSERT"))))
(setq cont 0)
(while (ssname ssl cont)
(command "_explode" (ssname ssl cont))
(setq cont (+ 1 cont))
)

Regards,
Pete


"Michel" <trottier.michel.c@hydro.qc.ca> wrote in message
news:3EF9F6BC.9DF4142C@hydro.qc.ca... It doesnt work on the command line either... Command: (setq ssl (ssget "X" '((0 . "INSERT")))) <Selection set: 9746> Command: (command "_explode" "p" "") *Invalid Selection* Attend un point ou Dernier/TOUT/Groupe ; erreur: Fonction annulée Sélectionnez un objet: Command: You need to make a loop (setq ssl (ssget "X" '((0 . "INSERT")))) (setq cont 0) (if (and ssl (> (sslength ssl) 0)) (repeat (sslength ssl) (command "_explode" (ssname ssl cont)) (setq cont (+ 1 cont)) ) ) Pete a écrit : I have: (setq ssl (ssget "X" '((0 . "INSERT")))) I get: a selection set of all blocks in the drawing. My problem: If I put this lisp line after the one above: (command "explode" "p" "") I get an error: *Invalid Selection* Expects a point or Last/All/Group However, if I type the following on the command line after executing the first lisp line (ssget): explode <enter> p <enter><enter> The set of all blocks is exploded. Why does explode, previous, work on the command line and not in the
lisp code?

Pete
06-25-2003, 12:16 PM
Thanks for the tip. It works fine now after I simplified the code a bit:

(setq ssl (ssget "X" '((0 . "INSERT"))))
(setq cont 0)
(while (ssname ssl cont)
(command "_explode" (ssname ssl cont))
(setq cont (+ 1 cont))
)

What I meant to say is that the explode command has "previous" for selection
option when used on the command line. When explode is used in lisp code,
the previous option does not function( along with a few other options also).

Regards,
Pete


"Michel" <trottier.michel.c@hydro.qc.ca> wrote in message
news:3EF9F6BC.9DF4142C@hydro.qc.ca... It doesnt work on the command line either... Command: (setq ssl (ssget "X" '((0 . "INSERT")))) <Selection set: 9746> Command: (command "_explode" "p" "") *Invalid Selection* Attend un point ou Dernier/TOUT/Groupe ; erreur: Fonction annulée Sélectionnez un objet: Command: You need to make a loop (setq ssl (ssget "X" '((0 . "INSERT")))) (setq cont 0) (if (and ssl (> (sslength ssl) 0)) (repeat (sslength ssl) (command "_explode" (ssname ssl cont)) (setq cont (+ 1 cont)) ) ) Pete a écrit : I have: (setq ssl (ssget "X" '((0 . "INSERT")))) I get: a selection set of all blocks in the drawing. My problem: If I put this lisp line after the one above: (command "explode" "p" "") I get an error: *Invalid Selection* Expects a point or Last/All/Group However, if I type the following on the command line after executing the first lisp line (ssget): explode <enter> p <enter><enter> The set of all blocks is exploded. Why does explode, previous, work on the command line and not in the
lisp code?

Paul Turvill
06-25-2003, 04:20 PM
The Previous selection works only for AutoCAD commands; (ssget ...) doesn't
set the previous option. In LISP, you can simply use the variable. For the
EXPLODE command to work on a selection set (multiple objects) in LISP,
however, the System Variable QAFLAGS needs to be set to 2:

(setvar "qaflags" 2)
(setq ssl (ssget "X" '((0 . "INSERT"))))
(command "_.explode" ssl "")
___

"Pete" <pruehle@sempck.com> wrote in message
news:QqnKa.3282$LG4.2679@newssvr16.news.prodigy.com... What I meant to say is that the explode command has "previous" for
selection option when used on the command line.

Pete
06-26-2003, 06:45 AM
Ok, this is typical Autodesk. Not only is QAFLAGS not documented anywhere
in the help files, it is not even listed when using * in the setvar command.
Yet there it is when I enter it on the command line. Anyone care to offer
an explanation of the function of this mystery variable?


"Paul Turvill" <nospam@turvill.com> wrote in message
news:vfkf1s1ruh2lc0@corp.supernews.com... The Previous selection works only for AutoCAD commands; (ssget ...)
doesn't set the previous option. In LISP, you can simply use the variable. For the EXPLODE command to work on a selection set (multiple objects) in LISP, however, the System Variable QAFLAGS needs to be set to 2: (setvar "qaflags" 2) (setq ssl (ssget "X" '((0 . "INSERT")))) (command "_.explode" ssl "") ___ "Pete" <pruehle@sempck.com> wrote in message news:QqnKa.3282$LG4.2679@newssvr16.news.prodigy.com... What I meant to say is that the explode command has "previous" for selection option when used on the command line.

Paul Turvill
06-26-2003, 07:09 AM
As its name implies (QA = Quality Assurance), I think it was created by
Autodesk's code cutters to provide themselves with some shortcuts that they
were (are) arrogant enough to assume wouldn't be wanted or needed by us
inferior users. There are a number of interesting things that can be done
with various settings of QAFLAGS.

For more on this and other undocumented features, check out the AutoCAD
Exposed document at
http://www.manusoft.com

___

"Pete" <pruehle@sempck.com> wrote in message
news:EGDKa.456$RV2.77@newssvr31.news.prodigy.com... Ok, this is typical Autodesk. Not only is QAFLAGS not documented anywhere in the help files, it is not even listed when using * in the setvar
command. Yet there it is when I enter it on the command line. Anyone care to offer an explanation of the function of this mystery variable?

=?iso-8859-1?Q?J=FCrgen?= Palme
06-26-2003, 08:27 AM
But be careful using the QAFLAGS system variable - if it is not set to 0
it causes some errors.

Juergen


Paul Turvill schrieb: For more on this and other undocumented features, check out the AutoCAD Exposed document at http://www.manusoft.com


MyLounge.com Site Map
Forum: Cars, Cell Phone, Database, Games, Home Improvement, IT, Music, School, Sports, Web Design, Web Server, Weight Loss

The MyLounge.com forum is intended for informational use only and should not be relied upon and is not a substitute for any advice. The information contained on MyLounge.com are opinions and suggestions of members and is not a representation of the opinions of MyLounge.com. MyLounge.com does not warrant or vouch for the accuracy, completeness or usefulness of any postings or the qualifications of any person responding. Please consult a expert or seek the services of an attorney in your area for more accuracy on your specific situation. Please note that our forums also serve as mirrors to Usenet newsgroups. Many posts you see on our forums are made by newsgroup users who may not be members of MyLounge.com Term of Service