Jump to content
lucatop

Macro explode all/chprop/purge all

Recommended Posts

lucatop

Hi I need a single macro that explode all, change all properties to color white, layer 0 and line type continuous. 

I have to be sure that all is exploded (also block in block) and poly line and also be sure that all is purged. 

 

Now I work launching many time command "A" and next many times command "B". (a random times each because I don't know what kinds of draw is evry). 

 

Command A

^C^C^C_ai_selall;_explode

 

Command B

^C^C^C_ai_selall;_chprop;color;7;linetype;continuous;layer;0;;-purge;all;*;n

 

 

 

 

 

 

If I try to write this don't work, there is a selection problem also because many time the second explode command doesn't finds anything to explode. 

^C^C^C_ai_selall;_explode;;_ai_selall;_explode;;_ai_selall;_explode;;_ai_selall;_chprop;color;7;linetype;continuous;layer;0;;-purge;all;*;n;;-purge;all;*;n;;-purge;all;*;n

 

Edited by lucatop

Share this post


Link to post
Share on other sites
BIGAL

I tried manually "explode all" it seemed to work. ai_selall asks for a point ?

Share this post


Link to post
Share on other sites
lucatop

Hi BIGAL

I try

^C^C^C_explode;all;;_explode;all;;

But is different like I digit de command

Esc Esc Esc

_explode enter All enter enter

_explode enterA ll enter enter

In the second way it work and explode a polyline inside a block... In the fist way don't work. 

 

Share this post


Link to post
Share on other sites
lucatop

Some ideas? 

Thanks

Share this post


Link to post
Share on other sites
maratovich

Why not Lisp?

Share this post


Link to post
Share on other sites
steven-g

I tried a few things with this, it looks like Autocad LT has some serious timing issues, probably the same problem in full,

If you run the following string of commands individually it works as expected. And will explode nested blocks and even handel not finding anything to explode.

_ai_selall
_explode
_ai_selall
_explode
_ai_selall
_explode
_ai_selall
_explode

If you copy and then paste all 8 lines into the commandline then that works as well.

But if you make it into a scr file and try to run that either from a macro or just drop it onto the program window then it fails, and again if you try that sequence in a macro

_ai_selall;_explode;_ai_selall;_explode;_ai_selall;_explode;_ai_selall;_explode;

It fails at the first explode command just a single sequence works and can be repeated multiple times

_ai_selall;_explode;

but add anything else and it fails again so

_ai_selall;_explode;_ai_selall;

The above fails as well prompting that a point is required as BIGAL pointed out. It is almost as though the commands are coming in too quickly for the program to handel or that the sequence is getting mixed up in the internal working of macros & scripts.

Share this post


Link to post
Share on other sites
tombu
On 7/22/2019 at 9:35 AM, lucatop said:

Hi I need a single macro that explode all, change all properties to color white, layer 0 and line type continuous. 

Like maratovich I gotta ask is lisp an option? 

Exploding blocks and polylines greatly increases file size and dumbs down a drawing.  Would simply changing all properties to color white, layer 0 and line type continuous including blocks be enough? 

Share this post


Link to post
Share on other sites
deano33

I have some standard macros for converting incoming architects drawings to xrefs and new drawings with the above as part. I use this to automate making the drawing to my standard before import. I addition I would like to add a macro that sets the drawing units to millimetres so it imports at the correct scale. Does anybody have the macro for this?

Share this post


Link to post
Share on other sites
BIGAL

I want mm (setvar 'insunits 4)

Share this post


Link to post
Share on other sites
tombu
On 8/22/2019 at 5:53 AM, steven-g said:

I tried a few things with this, it looks like Autocad LT has some serious timing issues.

Try using DELAY calls between them:

DELAY (Command)

Provides a timed pause within a script.

Specifies the duration of a pause. Entering delay 1000 in your script delays the start of execution of the next command for about one second. The longest delay available is 32767, which is slightly less than 33 seconds.

http://help.autodesk.com/view/ACD/2020/ENU/?guid=GUID-C352A9F4-0057-43AD-9642-9BAA881224F8

Share this post


Link to post
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
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  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...