Anuncios

The Autodesk Community Forums has a new look. Read more about what's changed on the Community Announcements board.

Kent1Cooper
en respuesta a: krishravi2000

For some things, that is already available [read about the DIMLAYER and HPLAYER System Variables].

 

For others, you can undefine and redefine the command name:

 

(command "_.undefine" "XLINE")

(defun C:XLINE ()

  (setvar 'clayer "YourPreferredXlineLayer")

  (command "_.XLINE")

)

 

You could also have it return the current Layer to what it was before, after you finish the XLINE command:

 

(command "_.undefine" "XLINE")

(defun C:XLINE (/ lay)

  (setq lay (getvar 'clayer))

  (setvar 'clayer "YourPreferredXlineLayer")

  (command-s "_.XLINE")

  (setvar 'clayer lay)

)

 

If you sometimes have reason to draw XLINEs not on that Layer, type in the command with a period prefix:

.XLINE

to force use of the native command, not your redefinition.

Kent Cooper, AIA