Jump to content

explode "all" doesn't work!!!!


alijahed

Recommended Posts

Hi All,

 

Seriously confused!!

 

I wrote this:

 

moz-screenshot-4.pngmoz-screenshot-5.png(defun c:test ()

(command "purge" "_all" "" "_no")

;Insert the first Block

 

(setq blk "circle")

(setq cord (list 50. 0. 0.))

(command "_insert" blk cord 1. 1. 0.)

 

;Insert the second Block

(setq blk "rectangle")

(setq cord (list 0. 0. 0.))

(command "_insert" blk cord 1. 1. 0.)

 

(command "explode" "_all")

 

)

 

But surprisingly the explode "all" just explode the first item!!!

by using the "explode" command on the command line you can explode the rectangle later manually!

How can I fix this problem?!

 

 

Cheers

 

Ali

untitled.jpg

Link to comment
Share on other sites

For compatibility with old AutoCAD releases, the EXPLODE command accept only one item when used trough AutoLISP - set QAFLAGS system variable to 1 to force it to accept more than on item. Regarding "_all" option try to use SSGET statement instead.

 

(setvar "QAFLAGS" 1)
(command "._EXPLODE" (ssget "_X") "")
(setvar "QAFLAGS" 0)

 

Regards,

Link to comment
Share on other sites

 

[color="Red"](setvar "QAFLAGS" 1)[/color]
(command "._EXPLODE" (ssget "_X") "")
(setvar "QAFLAGS" 0)

 

Regards,

 

Hello Mr. msasu,

May I ask you about the meaning of the above variable you used

earlier ..... Please ?

I looked for it with Autocad help but with no result ...

 

Regards,

Tharwat

Link to comment
Share on other sites

The QAFLAGS is one undocumented system variable of AutoCAD; below you can find a definition of it:

 

"QAFLAGS system variable controls internal functions, it accepts a value between 0 and 32767 (sum of values):

bit 0 (1): ^C in menu macro cancels grips (acts like keyboard ).

bit 1 (2): no pause during text screen listings.

bit 2 (4): no "alert" dialogs (text display instead).

bit 7 (128): accepts "screen picks" (point lists) via (command) function."

 

I suggest you to ensure that it is always keept as 0.

 

Regards,

Link to comment
Share on other sites

 

bit 0 (1): ^C in menu macro cancels grips (acts like keyboard ).

 

 

Thats wonderful Mr.msasu.

 

And as I noticed that the value of (1) would behave in behalf of Cancel in

Macros. But in Macro used twice .

 

And it used one time with the 'setvar' and as you know some Autocad command sometimes need to press tow times to escape .

 

Are they behaving the same as a double of escapes . . . ?

 

Thanks for your great cooperation ..

Best Regards.

 

Tharwat

Link to comment
Share on other sites

@tharwat313: Not sure what you mean, but I presume that is about the way QAFLAGS system variable is interacting with EXPLODE command. Sincerely, I don’t know the mechanism; all that I know is that by setting it on 0 will force the command to accept multiple entities.

 

Regards,

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...