Author Topic: Diesel expressions for layers on?  (Read 2843 times)

0 Members and 1 Guest are viewing this topic.

hardwired

  • Guest
Diesel expressions for layers on?
« on: November 12, 2009, 02:55:03 AM »
Hi,

Could someone help me out with a diesel expression i can use for a button macro? I want to toggle a layer on or off, nothing more than that but i don't know much diesel..

The layer is LSC-WATERMARK, so its only gonna be like:
If LSC-WATERMARK is ON then, turn OFF LSC-WATERMARK and vice versa (obvious i know)..

It would also helpful if someone could show me how to do the same expression in VBA and AutoLISP, just so i can see how they are constructed (i will post in the VBA forum too)..

Thanks in advance,


m4rdy

  • Newt
  • Posts: 62
Re: Diesel expressions for layers on?
« Reply #1 on: November 12, 2009, 10:39:49 AM »
Autocad 2007, Windows XP

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Diesel expressions for layers on?
« Reply #2 on: November 12, 2009, 10:44:48 AM »
The same question .....  :-D :-D

http://www.cadtutor.net/forum/showthread.php?p=282716#post282716

LoL
Nothing wrong with a little persistence.  :mrgreen: Why is this called mrgreen?
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Diesel expressions for layers on?
« Reply #3 on: November 12, 2009, 10:48:33 AM »
The same question .....  :-D :-D

http://www.cadtutor.net/forum/showthread.php?p=282716#post282716
I've been guilty of doing the same (did it yesterday actually).  Nothing wrong with getting multiple responses/points of view.  Personally, I never would have known since I don't venture over there. <side note>What is the deal with the fish?</side note>
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Diesel expressions for layers on?
« Reply #4 on: November 12, 2009, 10:51:05 AM »
The same question .....  :-D :-D

http://www.cadtutor.net/forum/showthread.php?p=282716#post282716
I've been guilty of doing the same (did it yesterday actually).  Nothing wrong with getting multiple responses/points of view.  Personally, I never would have known since I don't venture over there. <side note>What is the deal with the fish?</side note>
I think it alludes to the teach a man to fish expression.
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

Matt__W

  • Seagull
  • Posts: 12955
  • I like my water diluted.
Re: Diesel expressions for layers on?
« Reply #5 on: November 12, 2009, 10:57:43 AM »
The same question .....  :-D :-D

http://www.cadtutor.net/forum/showthread.php?p=282716#post282716
I've been guilty of doing the same (did it yesterday actually).  Nothing wrong with getting multiple responses/points of view.  Personally, I never would have known since I don't venture over there. <side note>What is the deal with the fish?</side note>
I think it alludes to the teach a man to fish expression.
"I see", said the blind carpenter as he picked up his hammer and saw.
Autodesk Expert Elite
Revit Subject Matter Expert (SME)
Owner/FAA sUAS Pilot @ http://skyviz.io

alanjt

  • Needs a day job
  • Posts: 5352
  • Standby for witty remark...
Re: Diesel expressions for layers on?
« Reply #6 on: November 12, 2009, 11:05:57 AM »
The same question .....  :-D :-D

http://www.cadtutor.net/forum/showthread.php?p=282716#post282716
I've been guilty of doing the same (did it yesterday actually).  Nothing wrong with getting multiple responses/points of view.  Personally, I never would have known since I don't venture over there. <side note>What is the deal with the fish?</side note>
I think it alludes to the teach a man to fish expression.
"I see", said the blind carpenter as he picked up his hammer and saw.

Must have been a magic hammer. LoL
Civil 3D 2019 ~ Windohz 7 64bit
Dropbox

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Diesel expressions for layers on?
« Reply #7 on: November 12, 2009, 11:27:04 AM »
>-=((((°>
Code: [Select]
;;toggle layer LSC-WATERMARK on/off
(defun c:ToggleWML (/ entList)
  (and
    (or (setq entList (tblobjname "LAYER" "LSC-WATERMARK"))
        (prompt "\nNo layer to toggle."))
    (setq entList (entget entList))
    (entmod (subst (cons 62 (- (cdr (assoc 62 entList))))
                   (assoc 62 entList) entList))
    (princ "\nLayer toggled.")
  )
  (princ)
)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.

Mark

  • Custom Title
  • Seagull
  • Posts: 28762
Re: Diesel expressions for layers on?
« Reply #8 on: November 12, 2009, 12:01:38 PM »
>-=((((°>
That one made me laugh out load CAB, thanks! 8-)
TheSwamp.org  (serving the CAD community since 2003)

m4rdy

  • Newt
  • Posts: 62
Re: Diesel expressions for layers on?
« Reply #9 on: November 12, 2009, 12:02:52 PM »

I've been guilty of doing the same (did it yesterday actually).  Nothing wrong with getting multiple responses/points of view.  Personally, I never would have known since I don't venture over there. <side note>What is the deal with the fish?</side note>
[/quote]

Me too ...sorry  :cry: :cry: :cry: :cry:
Autocad 2007, Windows XP