Author Topic: Changing XLINE appearance  (Read 3277 times)

0 Members and 1 Guest are viewing this topic.

gmyroup

  • Guest
Changing XLINE appearance
« on: June 10, 2010, 01:28:22 PM »
Is there any way to change the appearance of an XLINE (contruction Line)?  I'd like to change the color and linetype to make construction lines more obvious.

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16899
  • Superior Stupidity at its best
Re: Changing XLINE appearance
« Reply #1 on: June 10, 2010, 02:00:55 PM »
different layer?
a reactor to change them?

what are your constraints?
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Find me on https://parler.com @kblackie

TimSpangler

  • Water Moccasin
  • Posts: 2010
  • CAD Naked!!
Re: Changing XLINE appearance
« Reply #2 on: June 10, 2010, 03:18:22 PM »
I have mine come in on a non-plotting layer that is Magenta.
ACA 2015 - Windows 7 Pro
All Comments and Content by TimSpangler, Copyright © 2016

JCTER

  • Guest
Re: Changing XLINE appearance
« Reply #3 on: June 10, 2010, 03:31:31 PM »
You change 'em like you do any other object.

You can select all the xlines in the drawing using QSELECT, if they need put on a different layer after the fact.

Krushert

  • Seagull
  • Posts: 13679
  • FREE BEER Tomorrow!!
Re: Changing XLINE appearance
« Reply #4 on: June 11, 2010, 09:34:35 AM »
Are you talking construction lines for a vertical?   :|
I + XI = X is true ...  ... if you change your perspective.

I no longer CAD or Model, I just hang out here picking up the empties beer cans

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Changing XLINE appearance
« Reply #5 on: June 11, 2010, 11:01:05 AM »
there's mine...

maybe it could help..

Code: [Select]
;; XLINES and RAY on DEFPOINTS LAYER
;; By: Andrea Andreetti 2008-08-20


(vl-load-com)
; (getLayers t)  = All Layers included XREF Layers
; (getLayers nil)  = All Layers EXCLUDED XREF Layers
(defun getlayers (xref / bav doc blk)
  (setq bav nil)
  (setq doc (vla-get-activedocument (vlax-get-acad-object)))
  (vlax-for blk (vla-get-layers doc)
    (if xref
      (setq bav (append bav (list (strcase (vla-get-name blk)))))
      (if (not (vl-string-search "|" (vla-get-name blk)))
        (setq bav (append bav (list (strcase (vla-get-name blk)))))
      )
    )
  )
  bav
)





(defun *XlineReactor_S* (call-reactor sci / layers Lname adoc Layers Nlayer xline)
(setq curLayer (getvar "CLAYER"))
(setq Lname "DEFPOINTS")
(setq adoc (vla-get-activedocument (vlax-get-acad-object)))
  (if (member (strcase (car sci)) '("XLINE" "RAY"))
    (progn
(if (not (member Lname (getlayers nil)))
  (progn
    (setq Layers (vla-get-layers adoc))
    (setq Nlayer (vla-add Layers Lname))
    ;(vla-put-color Nlayer 5)
    ;(vla-put-linetype Nlayer "Dashed2")
    ;.....etc..
  )
)
(setq xline (vla-item (vla-get-layers adoc) Lname))
(vla-put-activelayer adoc xline)
)))
 






(defun *XlineReactor_E* (call-reactor sci / adoc clayer vlclayer)
(setq adoc (vla-get-activedocument (vlax-get-acad-object)))
  (if (member (strcase (car sci)) '("XLINE" "RAY"))
    (progn
      (setq vlclayer (vla-item (vla-get-layers adoc) curLayer))
      (vla-put-activelayer adoc vlclayer)
    )
  )
)






;;REACTOR SECTION
(if XlineReactor_S
    (progn (vlr-remove XlineReactor_S)
           (setq XlineReacto_S nil)
    )
  )
  (setq XlineReactor_S
         (vlr-command-reactor nil
                              '((:vlr-commandWillStart . *XlineReactor_S*))
         )
  )


(if XlineReactor_E
    (progn (vlr-remove XlineReactor_E)
           (setq XlineReacto_E nil)
    )
  )
  (setq XlineReactor_E
         (vlr-command-reactor nil
                              '((:vlr-commandEnded . *XlineReactor_E*))
         )
  )

(if XlineReactor_C
    (progn (vlr-remove XlineReactor_C)
           (setq XlineReacto_C nil)
    )
  )
  (setq XlineReactor_C
         (vlr-command-reactor nil
                              '((:vlr-commandCancelled . *XlineReactor_E*))
         )
  )



Keep smile...

Lee Mac

  • Seagull
  • Posts: 12926
  • London, England
Re: Changing XLINE appearance
« Reply #6 on: June 11, 2010, 01:41:03 PM »
Another (a reactor toggle  :-) )

Code: [Select]
(defun c:XLR nil
  ;; © Lee Mac  ~  11.06.10
  (vl-load-com)

  (  (lambda ( data foo1 foo2 / react )       
       (if (setq react
             (vl-some
               (function
                 (lambda ( reactor )
                   (if (eq data (vlr-data reactor)) reactor)
                 )
               )
               (cdar
                 (vlr-reactors :vlr-command-reactor)
               )
             )
           )
         (if (vlr-added-p react)
           (vlr-remove react)
           (vlr-add react)
         )
         (setq react
           (vlr-command-reactor data
             (list
               (cons :vlr-CommandWillStart foo1)
               (cons :vlr-CommandEnded     foo2)
               (cons :vlr-CommandCancelled foo2)
             )
           )
         )
       )
       (princ
         (if (vlr-added-p react)
           "\n** Reactor Activated **"
           "\n** Reactor Deactivated **"
         )
       )
       react
     )
    "XLine-Reactor"
    'XLR:WillStart
    'XLR:Cancelled
  )

  (princ)
)

(defun XLR:WillStart ( reactor args )

  ;;---------------------------------------------------------------;;

  (setq XLineLayer "XLineLayer") ;; <--<< Change this if necessary

  ;;---------------------------------------------------------------;;

  (if (wcmatch (strcase (car args)) "XLINE,RAY")
    (progn
      (setq *clayer* (getvar 'CLAYER))

      (or (tblsearch "LAYER" XLineLayer)
          (entmake (list (cons 0 "LAYER")
                         (cons 100 "AcDbSymbolTableRecord")
                         (cons 100 "AcDbLayerTableRecord")
                         (cons 2 XLineLayer)
                         (cons 70 0))))

      (setvar 'CLAYER XLineLayer)
    )
  )
  (princ)
)

(defun XLR:Cancelled ( reactor args )
  (if (and *clayer* (wcmatch (strcase (car args)) "XLINE,RAY"))
    (progn
      (setvar 'CLAYER *clayer*)
      (setq *clayer* nil)
    )
  )
  (princ)
)

Type 'XLR' to activate the reactor (only once), then 'XLR' again to deactivate  :wink: