Draw line
Change layer to S-3
Offset .33
(pick the side to offset)
Change layer to S-1
Offset (last) .33
(offset to same side)
Change layer to S-3
This is what I have so far:
^C^C-layer;s;S-1;;_line;\\;select;last;;offset;.33;m;\\;;-chprop;p;l;;la;S-3;;
At the first offset command, I get:
Select object to offset or [Exit/Undo] <Exit>:
In order for the macro routine to work, I need to select the "LAST" object. However, Autocad is not recognizing the "LAST" object to be selected. This works when I go step by step, but not as strung together in a macro.
I also have to pick the side to offset twice - is there a way to combine these into one pick?
I found that if I draw the line on the desired layer for the middle object, then CHPROP; previous; last;; this selects the outer two lines (the one originally drawn and the last one offset) and allows me to change the layers.
see the attached .Jpeg for desired results. (Layer S-3 is green, S-1 is red, these layers already exist in the drawing)
Thank you
P.S. I need a macro, not lisp
Solved! Go to Solution.
Solved by m_rogoff. Go to Solution.
Hi m_rogoff,
if your AutoCAD version is not too old, you may also explore the 'Layer' option at OFFSET command...
Try
^C^C-layer;s;S-1;;_line;\\;_OFFSET;.33;@;\;_CHPROP;L;;LA;S-3;;
Hope that helps
Henrique
Henrique,
This is what I came up with. When I used the (Layer) and (Multiple) options within the OFFSET command, it would not select the line drawn as the current object. I have to manually select the line twice ( \\;) at the end of the routine, which is not ideal, but still adequate.
Ultimate goal is 3 lines, outside 2 are layer S-3, middle is layer S-1
^C^C-layer;s;S-3;;_line;\\;_OFFSET;.33;@;\;_CHPROP;L;;LA;S-1;;_OFFSET;L;C;.33;@;\\;
The lisp function vla-Offset should help it offsets to both sides. All you need to select is the middle line.
@TomBeauford wrote:
The lisp function vla-Offset should help ....
... except that they have some Users who use AutoCAD LT and can't do Lisp functions [there's another thread where AutoLISP solutions were suggested, in which we learned that], which is the reason they're aiming for a purely-macro approach [see the end of the first message here].
m_rogoff wrote:
Ultimate goal is 3 lines, outside 2 are layer S-3, middle is layer S-1
Perhaps something like this
^C^C-layer;_S;S-3;;_line;\\;-layer;_S;S-1;;_OFFSET;_L;_C;;;;.33;@;_M;\\;^C^C_OFFSET;_L;_S;;;
Hope that helps
Henrique
Or
^C^C-layer;_S;S-3;;_line;\\;-layer;_S;S-1;;_OFFSET;_L;_C;;;;.33;@;_M;\\;^C^C_OFFSET;_L;_S;;;_layerp;_layerp;
to restore also the current layer
Henrique
Wrong layer order...
^C^C-layer;_S;S-1;;_line;\\;-layer;_S;S-3;;_OFFSET;_L;_C;;;;.33;@;_M;\\;^C^C_OFFSET;_L;_S;;;_layerp;_layerp;
Henrique
Henrique,
The code was offsetting the middle line on the source layer, so the middle and outside lines were on the same layer. I modified the end to change prop of the last object to the correct layer instead. Thank you for your help, I couldn't have gotten this without your help.
^C^C-layer;_S;S-3;;_line;\\;-layer;_S;S-1;;_OFFSET;_L;_C;;;;.33;@;_M;\\;^C^C_OFFSET;;;_layerp;_layerp;_Chprop;L;;LA;S-3;;
One more quick question on a very similar macro
^C^C-layer;_S;S-SHR;;_line;\\;_OFFSET;3;@;\\;^C^C_erase;L;;_layerp;_layerp;;^C^C
At the end of the macro, I get a message:
Select object to offset or [Exit/Undo] <Exit>: *Cancel*
I have to manually hit escape to exit out of the command. It also won't delete the first line drawn. Suggestions? Thanks!
@m_rogoff wrote:
Henrique,
The code was offsetting the middle line on the source layer, so the middle and outside lines were on the same layer.
Weird, I have tested the code on AC2012 and AC2014, without any problem.
The las command was '-layerp', if user press enter, will call the last command, and change the last two lines to the source layer.
Do this code work ok on your system?
^C^C-layer;_S;S-1;;_line;\\;-layer;_S;S-3;;_OFFSET;_L;_C;;;;.33;@;_M;\\;^C^C_layerp;_layerp;_OFFSET;_L;_S;;;
For the other macro, I'll see what I can do... (I don't have AutoCAD on this laptop)
Henrique
@m_rogoff wrote:
^C^C-layer;_S;S-SHR;;_line;\\;_OFFSET;3;@;\\;^C^C_erase;L;;_layerp;_layerp;;^C^C
At the end of the macro, I get a message:
Select object to offset or [Exit/Undo] <Exit>: *Cancel*
I have to manually hit escape to exit out of the command. It also won't delete the first line drawn. Suggestions? Thanks!
Can you explain in words what are you trying to do.
You are setting the layer S-SHR as current, draw a line, offset the line 3 units, pause twice? erase the 'offsetted' line? call 'layerp' command twice? and cancel...
Henrique
For this routine, I want to draw a line on layer S-SHR, offset 3" (user pick side) then delete the original line. You are left with 1 line, 3" from where it was drawn. I got it to do everything correct but deletes the offset object, not the line drawn. Selecting LAST Object (L) does not work.
^C^C-layer;_S;S-SHR;;_line;\\;_OFFSET;3;@;\;_erase;L;;_layerp;;
Thanks for your help