menu customisation

Hi All,
I am customizing a menu to find current layer, insert door on appropriate layer, ability to rotate door to user requirements and return user to the
previous current layer.
I have achieved all the above except to allow the user to rotate the door upon insertion. When I remove a semi colon the user is prompted to rotate but the current layer isn't returned to the previous before command was invoked.
[Doorslides(DD-1840-64wall,DD-1840-64wall)]^C^C^P(setq orig-lay(getvar "clayer"))(prin1);attdia;1;-layer m D-DOOR;c;2;;;-insert "K:/Ref/AutoCAD Customisation/Library/Doors/DD-1840-64wall.dwg";\1;1;0;-layer s !orig-lay;;;;
I would really appreciate some help to achieve my goal.
Thanks,
Phil
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Use a "\" at the rotation angle. You already use it ay the insert point.
Jan

Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Hi Jan,
I have tried that and yes it allows the user to rotate the door but doesn't return you to the current layer before the command was executed.
Thanks, Phil

appropriate
the
door
rotate
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Strange, in my command sequence it does return to the desired layer. I use this: ^c^c-LAYER;M;INSDET;C;7;insdet;;-insert;(strcat pad3 "dsn_leid");\;;\-LAYER;set;pen1;; works perfect. I'll try your sequence, see how that works.
Jan

was
"K:/Ref/AutoCAD
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload
Back again. Tried your menu line, it works! This is it: ^C^C^P(setq orig-lay(getvar"clayer"))(prin1);attdia;1;-layer;m;D-DOOR;c;2;;;-insert (strcat pad3 "dsn_leid");\1;1;\-layer;s;!orig-lay;;;;
Replace the '(strcat pad3 "dsn_leid")' with your block name. Let me know if it works for you.
Jan

was
"K:/Ref/AutoCAD
Add pictures here
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Add image file
Upload

Polytechforum.com is a website by engineers for engineers. It is not affiliated with any of manufacturers or vendors discussed here. All logos and trade names are the property of their respective owners.