How to run multiple commands at once.

How to run multiple commands at once.

setiplex
Explorer Explorer
5,757 Views
6 Replies
Message 1 of 7

How to run multiple commands at once.

setiplex
Explorer
Explorer

One of my signs can have many parts. And, I have hundreds of signs. I found to have a specific order of commands to make my parts cleaned for the laser cutter. And I need them in a specific order as errors may happen if not completed in order. 

1) Explode > ‘a’ (for all)> ‘Enter’

2) Overkill > ‘all’ > ‘Enter’ > ‘Enter’ as parameters are already set.

3) Pedit > m (multiple) > Select Objects > Enter (For 'y') > 'j' (for join) > 'Enter' > 'Enter' (for 0.000 Fuzz) > 'c' (for close) > Enter > Enter again (for close pedit)

4) Purge > ‘a’>’Enter’ >  ‘a’ > ‘Enter’

I'm don't even know where to start with creating this. I would like to run a script or whatever, so I don't have to recursively run those 4 commands for every 'part.'

0 Likes
5,758 Views
6 Replies
Replies (6)
Message 2 of 7

cadffm
Consultant
Consultant
0 Likes
Message 3 of 7

setiplex
Explorer
Explorer

Is there any other way..like in a lisp. Mine crashes when running ACTMANGER. It's an old 2012.

0 Likes
Message 4 of 7

cadffm
Consultant
Consultant

@setiplex  schrieb:

Is there any other way..like in a lisp. Mine crashes when running ACTMANGER. It's an old 2012.


Sure, Macro Script Lisp VBA .NET C++

But i have no time to write that for you (and you can find a lot stuff in the forum what is near to what you need)

Visual LISP, AutoLISP and General Customization

 

I used a search engine for +autocad +explode +pedit +purge

This is one sample of the hits:

https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/lisp-to-explode-close-corners-overki...

 

Note: To use EXPLODE in commands well, you need to start (initcommandversion) before / the smart way of multiple solutions for "explode all"

 

(initcommandversion)

(command "_.EXPLODE" "_all" "") ;  destroys blockreferences, also MText and Polylines, Dimensions..

 

 

Sebastian

Message 5 of 7

Kent1Cooper
Consultant
Consultant

Try putting this command macro into a Tool Palette button:

^C^CExplode ALL -Overkill all ;;SELECT \Pedit m P ;j ;c ;-Purge a * n;

 

Some things needed tweaking [e.g. the hyphen prefixes on some command names, spelling out of ALL for the Explode selection, the * for all in the PURGE command] compared to the literal aspects of your description, so I hope it ends up doing what you need.

 

The SELECT command with one  backslash for user input can take any amount of selections and selection options [unlike other commands involving object selection that would need separate User-input backslashes for each selection], then the PEDIT command uses the Previous selection established by that.  Spaces are just like spaces or enters at the command line; semicolons are Enters.  [Many people like to use semicolons for all; I prefer spaces except when there is more than one together, in which case with all spaces it's harder to "read" how many there are.]  The ^C^C at the front is a double cancel, to ensure you get out of any command that may be running when you pick the macro.

 

Note that the (initcommandversion) business described by @cadffm is needed only if you do the Exploding in an AutoLisp (command) function, which can Explode only one thing at a time unless you do that or use other ways to handle that limitation.  It is not needed in a direct command-line Explode command such as in a macro.

 

[You can shorten it by one character if you set the PEDITACCEPT System Variable to not ask whether you want to convert Lines and Arcs.]

Kent Cooper, AIA
Message 6 of 7

cadffm
Consultant
Consultant

@Kent1Cooper  schrieb:

 

Note that the (initcommandversion) business described by @cadffm is needed only if you do the Exploding in an AutoLisp (command) function, which can Explode only one thing at a time unless you do that or use other ways to handle that limitation.  It is not needed in a direct command-line Explode command such as in a macro.

 


That part is not correct, you have to  handle this limitation alwas by using EXPLODE inside automations,

so you have to think about it in commands, sendcommands and also in Script or Menumacros!

 

For menumacros you have the equivalent in the special character for menumacros: ^R

 

For LT-Scripts, where you can not use the ^R and no (initcommandversion), you have to handle with undocumented variable qaflags(1).

Sebastian

Message 7 of 7

maic_bigfoot
Explorer
Explorer

Try the macros as attached for illustration

0 Likes