need macro to offset change layers & trim/extend what was offset

need macro to offset change layers & trim/extend what was offset

Anonymous
Not applicable
882 Views
3 Replies
Message 1 of 4

need macro to offset change layers & trim/extend what was offset

Anonymous
Not applicable

I need a macro/script to offset a rectangle (by .0625") twice & then change layer of the 2 new objects & do a little trimming/extending. can this all be done in one macro/script/tool button? (i am trying to create a tool palette button to do all of this) below is an example of what i need the finished product to look like. using autocad 2021top rectangle has desired offset linestop rectangle has desired offset lines

..i am aware the offset command has a layer option...here is what I've come up with so far... [^C^C_chprop;\;ltscale;1;;_LAYER;set;hidden;;Offset;l;current;.0625;\\\\;^C^C_chprop;l;\LA;LTLINES;;Offset;L;S;;;X;\;X;\;^C^C_EX;;\ ] it does most of what i want until it gets to the extend function & it just quits.

0 Likes
Accepted solutions (1)
883 Views
3 Replies
Replies (3)
Message 2 of 4

steven-g
Mentor
Mentor
Accepted solution

It would make life a great deal easier if you also included a written description (or even a screencast with instructions/audio) on the steps that should be used with the macro. Having the drawing and the macro is great but how do we know where you are expecting users to pick on objects when the macro runs, I could probably work it out but a description would save so much guess work.

However looking at your macro it looks like the problem with the macro stopping is due to the unnecessary semicolons after the backslashes for the two explode commands towards the end of your macro shown here

X;\X;\^C^C_EX;;\

this should work better, but there are still a few spots where the exact sequence is a bit of guess work 

Message 3 of 4

Anonymous
Not applicable

my apologies:

after creating a tool button with this  [ ^C^C_chprop;\;ltscale;1;;_LAYER;set;hidden;;O;l;current;.0625;\\\\;^C^C_chprop;l;\LA;LTLINES;;O;L;S;;;X;\;X;\;^C^C_EX;;\ ]  as the command string.

 

description of how it works so far:

 

start tool command, pick rectangle, pick rectangle again (to offset), pick inside or rectangle, pick new rectangle (to offset), pick inside of new rectangle, press (enter) key (ends ch prop command changing layer of second new rectangle), pick a new rectangle, pick the other new rectangle (this explodes the rectangles so they can be extended) ...the command ends there...I can't figure out why it doesn't go through with the extend command...any clue?

0 Likes
Message 4 of 4

Anonymous
Not applicable

that did it. thank you!

0 Likes