f700es Posted August 2, 2007 Share Posted August 2, 2007 I need a LISP to draw an Xline on a specific layer when I envoke the XL command. I am a total noob on this but is there a way to do this? TIA Sean Quote Link to comment Share on other sites More sharing options...
f700es Posted August 2, 2007 Author Share Posted August 2, 2007 Ok, maybe help me write one. I know I will use.. (command "xline") somewhere. I will also set the layer somewhere in the code. Just not sure how or in what order. Quote Link to comment Share on other sites More sharing options...
mdbdesign Posted August 2, 2007 Share Posted August 2, 2007 ^C^C-la;set;enter layer name;;_xline Quote Link to comment Share on other sites More sharing options...
f700es Posted August 2, 2007 Author Share Posted August 2, 2007 ^C^C-la;set;enter layer name;;_xline Sweet! Now can this be envoked from a command or a button? I prefer just typing in a few keys like "XL" and hitting enter. Thanks Quote Link to comment Share on other sites More sharing options...
lpseifert Posted August 2, 2007 Share Posted August 2, 2007 Put this in your acaddoc.lsp file (defun c:xl () (command "-layer" "s" "LAYERNAME" "") (command "xline") );defun This will return you to the original layer (xline behaves a little different) (defun c:xl (/ p1 p2) (setq cl (getvar "clayer")) (command "-layer" "s" "LAYERNAME" "") (setq p1 (getpoint "Specify a point: ") p2 (getpoint "Specify through point: " p1)) (command "xline" p1 p2 "") (setvar "clayer" cl) );defun Quote Link to comment Share on other sites More sharing options...
f700es Posted August 2, 2007 Author Share Posted August 2, 2007 Sweet, thanks guys Quote Link to comment Share on other sites More sharing options...
fart_plume Posted June 11, 2010 Share Posted June 11, 2010 I know this is an old thread, but I'm wanting some very similar. An addition to the code to specify the layer according by the axis plane in 3d. This way each of my xl lines are a given color in the given plane Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.