Jump to content

Recommended Posts

Posted

how can I set the construction lines to always come out as red. what do I need to enter in the macro in the CUI to do this?

Posted

You would have to put your construction lines on a layer (Construction?) that has its layer color set to red as the default.

Posted
You would have to put your construction lines on a layer (Construction?) that has its layer color set to red as the default.

 

 

how do I do that?

Posted

You could always use a reactor to automatically switch to the correct layer when you use xline command:

 

(vl-load-com)
(if (not layer:reactor)
 (setq layer:reactor
        (vlr-command-reactor
          nil
          '((:vlr-commandWillstart . sCom)
            (:vlr-commandEnded . eCom)
            (:vlr-commandCancelled . cCom)))))

(or (tblsearch "LAYER" "CONSTRUCTION")
   (vla-put-Color
     (vla-add (vla-get-Layers
                (vla-get-ActiveDocument
                  (vlax-get-acad-object))) "CONSTRUCTION") acRed))

(defun sCom  (Reac Args)
 (setq oldlay (getvar 'CLAYER))
 (if (eq "XLINE" (car Args))
   (setvar 'CLAYER "CONSTRUCTION"))
 (princ))

(defun eCom  (Reac Args)
 (if (eq "XLINE" (car Args))
   (setvar 'CLAYER oldlay))
 (princ))

(defun cCom  (Reac Args)
 (if (eq "XLINE" (car Args))
   (setvar 'CLAYER oldlay))
 (princ))

 

Just put this in your ACADDOC.lsp or Start-up Suite :thumbsup:

 

HTH

 

Lee

  • Like 1
Posted

Or, a simpler version to be used - perhaps in a macro button:

 

(or (not (tblsearch "LAYER" "CONSTRUCTION"))
   (setvar "CLAYER" "CONSTRUCTION"))
(command "_xline")
(while (> (getvar "CMDACTIVE") 0)
 (command pause))

Posted

Something like this, assuming you use a layer called "CONSTRUCTION"

 

^C^C-LAYER M CONSTRUCTION C 1;  ;  ;  XLINE 

Posted

this worked just perfect thanks

 

 

You could always use a reactor to automatically switch to the correct layer when you use xline command:

 

(vl-load-com)
(if (not layer:reactor)
 (setq layer:reactor
        (vlr-command-reactor
          nil
          '((:vlr-commandWillstart . sCom)
            (:vlr-commandEnded . eCom)
            (:vlr-commandCancelled . cCom)))))

(or (tblsearch "LAYER" "CONSTRUCTION")
   (vla-put-Color
     (vla-add (vla-get-Layers
                (vla-get-ActiveDocument
                  (vlax-get-acad-object))) "CONSTRUCTION") acRed))

(defun sCom  (Reac Args)
 (setq oldlay (getvar 'CLAYER))
 (if (eq "XLINE" (car Args))
   (setvar 'CLAYER "CONSTRUCTION"))
 (princ))

(defun eCom  (Reac Args)
 (if (eq "XLINE" (car Args))
   (setvar 'CLAYER oldlay))
 (princ))

(defun cCom  (Reac Args)
 (if (eq "XLINE" (car Args))
   (setvar 'CLAYER oldlay))
 (princ))

Just put this in your ACADDOC.lsp or Start-up Suite :thumbsup:

 

HTH

 

Lee

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...