Author Topic: Dim Mode !!?  (Read 11072 times)

0 Members and 1 Guest are viewing this topic.

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« on: February 21, 2005, 11:24:33 AM »
Hi all.

I'm trying to doing something like this...

Code: [Select]
(setq SDC_dimscale (getvar "dimscale")
        SDC_dimstyle (getvar "dimstyle")
        SDC_cecolor (getvar "cecolor")
        SDC_clayer (getvar "clayer")
)

(setvar "dimscale" 2)
(setvar "dimstyle" "standard1")
(setvar "cecolor" 4)
(setvar "clayer" "dim")  

(command "_dim1")

(setvar "dimscale" SDC_dimscale)
(command "_-dimstyle" "_R" SDC_dimstyle)
(setvar "cecolor" SDC_cecolor)
(setvar "clayer" SDC_clayer)

)


But..not working..
and i have no idea how to do something like this..

any idea ?

By the way....
I have the text screen avery time using this line..

(command "_-dimstyle" "_R" SDC_dimstyle)


?????
Keep smile...

sinc

  • Guest
Dim Mode !!?
« Reply #1 on: February 21, 2005, 11:47:33 AM »
Just to let you know, I'm using one of the other color schemes for this web site (the blue one, I forget what they called it).  It makes your blue code very hard to read.  Using the "Code" window instead of custom colors works much better for everyone trying to read your post...

sinc

  • Guest
Dim Mode !!?
« Reply #2 on: February 21, 2005, 11:48:46 AM »
Quote from: sinc
(the blue one, I forget what they called it)

I see at the bottom of the web page that I'm using the "Cobalt 2.0" theme...

CADaver

  • Guest
Re: Dim Mode !!?
« Reply #3 on: February 21, 2005, 11:53:52 AM »
Quote from: Andrea

Code: [Select]
(command "_dim1")
But..not working..
any idea ?
?????
Could be that "_dim1" is looking for a dim command to follow.

Andrea

  • Water Moccasin
  • Posts: 2372
Re: Dim Mode !!?
« Reply #4 on: February 21, 2005, 12:20:17 PM »
Quote from: CADaver
Quote from: Andrea

Code: [Select]
(command "_dim1")
But..not working..
any idea ?
?????
Could be that "_dim1" is looking for a dim command to follow.


I Know...
But i need to set variables before using DIM commands AND reset these variables when DIMMODE was ended.

any help ??
Keep smile...

nivuahc

  • Guest
Dim Mode !!?
« Reply #5 on: February 21, 2005, 12:24:37 PM »
In that instance, dimmode hasn't ended.

Even if you changed it to
Code: [Select]
(command "_dim1" "")
It would be doing something. As it is, it's waiting for a command at the point that you have it.

CADaver

  • Guest
Re: Dim Mode !!?
« Reply #6 on: February 21, 2005, 12:30:14 PM »
Quote from: Andrea


I Know...
But i need to set variables before using DIM commands AND reset these variables when DIMMODE was ended.

any help ??
You need to build what you need done with the dim1 command into the routine.

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #7 on: February 21, 2005, 12:36:28 PM »
So there is no solution ??

I can't believe..

even using reactors or something like that ?
Keep smile...

nivuahc

  • Guest
Dim Mode !!?
« Reply #8 on: February 21, 2005, 01:08:30 PM »
Andrea, pay attention...

The line that you have

Code: [Select]
(command "_dim1")

puts Autocad into Dim mode and waits for a command. You are not supplying a command.

You need to have something else, either end dim mode by pressing enter such as

Code: [Select]
(command "_dim1" "")

or whatever it is that you want to do while in dim mode.

Now, the only reason I can see that you are not getting what we are trying to say is that you want to have Autocad change those settings (what you did before the (command...) bit), then you want to be able to do whatever, and then you want Autocad to change your settings back when you're finished. If that is the case, and the whatever part is going to be different each time you run it, then you either need to buy the "clairvoyency" module for Autocad or you need to use a reactor.


[EDIT: And I moved your thread into the appropriate forum and deleted the duplicate you setup.]

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #9 on: February 21, 2005, 01:14:52 PM »
ok thanks..

so I do I use reactor for making this...?
Keep smile...

nivuahc

  • Guest
Dim Mode !!?
« Reply #10 on: February 21, 2005, 01:19:45 PM »
Well there is a great thread, right in this forum, that talks all about reactors.

You can find it by following this link

You might want to take note of who started that particular thread, if it's any help.

CADaver

  • Guest
Dim Mode !!?
« Reply #11 on: February 21, 2005, 01:23:13 PM »
Quote from: Andrea
ok thanks..

so I do I use reactor for making this...?
No not necessarily, just complete the lisp you've already started.  What is it you want dim1 to do? Code it in.

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #12 on: February 21, 2005, 01:33:46 PM »
Quote from: CADaver
Quote from: Andrea
ok thanks..

so I do I use reactor for making this...?
No not necessarily, just complete the lisp you've already started.  What is it you want dim1 to do? Code it in.


CADaver,

The LISP is for detecting the DIM mode....
Keep smile...

nivuahc

  • Guest
Dim Mode !!?
« Reply #13 on: February 21, 2005, 01:37:54 PM »
Quote from: CADaver
Quote from: Andrea
ok thanks..

so I do I use reactor for making this...?
No not necessarily, just complete the lisp you've already started.  What is it you want dim1 to do? Code it in.


I think what Andrea is trying to accomplish is

1. Make the changes to the Dim settings

2. Allow the user to do whatever, (not something specific, only something to do with Dimensioning, which is completely up to the user).

3. Change the settings back when the user is finished Dimensioning (whenever that may be).


Please correct me if I am wrong Andrea.

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #14 on: February 21, 2005, 02:06:07 PM »
exact nivuahc....

But i can't do-it............(for the moment)   :?
Keep smile...

nivuahc

  • Guest
Dim Mode !!?
« Reply #15 on: February 21, 2005, 02:35:14 PM »
Did you read the information in the original thread (linked above) that you started?

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #16 on: February 21, 2005, 03:28:50 PM »
Quote from: nivuahc
Did you read the information in the original thread (linked above) that you started?


Yes,...but I don't understand all reactor command and variable...
give me 2 or 3 day...   :oops:
Keep smile...

nivuahc

  • Guest
Dim Mode !!?
« Reply #17 on: February 21, 2005, 03:50:24 PM »
mmmkay

Tom

  • Guest
Dim Mode !!?
« Reply #18 on: February 21, 2005, 04:30:56 PM »
This is what we use might help
(defun c:dh  (/ dp1 dp2)
    (setvar "cmdecho" 0)
    (setq oldclayv (getvar "clayer")
     )
    (command "-dimstyle" "r" "wdt_linear001")
    (command "-layer" "s" "wdt-dim" "")
    (prompt "first extension line origin or return to select: ")
    (command "_dim1" "hor" pause pause pause)
    (setvar "clayer" oldclayv)
    (princ)
    )

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #19 on: February 21, 2005, 04:56:22 PM »
Quote from: Tom
This is what we use might help
(defun c:dh  (/ dp1 dp2)
    (setvar "cmdecho" 0)
    (setq oldclayv (getvar "clayer")
     )
    (command "-dimstyle" "r" "wdt_linear001")
    (command "-layer" "s" "wdt-dim" "")
    (prompt "first extension line origin or return to select: ")
    (command "_dim1" "hor" pause pause pause)
    (setvar "clayer" oldclayv)
    (princ)
    )


This is not to bad..but only work with Horizontal DIM...
is not exactly what i need..

Just something like...

(while (dimmode ON)
(do nothing)(otherwise reset variables)
)

see ?
Keep smile...

daron

  • Guest
Dim Mode !!?
« Reply #20 on: February 21, 2005, 05:46:37 PM »
Ah! Now if you look at your first post, it is far easier to read. As Sinc said, the text is difficult to read colored blue. At the same time, in Cobalt, red is hard on the eyes. I assume it's just as hard on the eyes in any theme. Andrea, just so you know, before you paste code into the text field, if you type [ code] before...paste code here...[ /code] and after your code, it goes in formatted and pure and no style gives the reader eye damage.

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #21 on: February 21, 2005, 06:06:57 PM »
Quote from: Andrea
Quote from: Tom
This is what we use might help
(defun c:dh  (/ dp1 dp2)
    (setvar "cmdecho" 0)
    (setq oldclayv (getvar "clayer")
     )
    (command "-dimstyle" "r" "wdt_linear001")
    (command "-layer" "s" "wdt-dim" "")
    (prompt "first extension line origin or return to select: ")
    (command "_dim1" "hor" pause pause pause)
    (setvar "clayer" oldclayv)
    (princ)
    )


This is not to bad..but only work with Horizontal DIM...
is not exactly what i need..

Just something like...

(while (dimmode ON)
(do nothing)(otherwise reset variables)
)

see ?


By the way....i have modified your routine...
Code: [Select]

(defun c:dh (/ pt1 oldclayv)
(setvar "cmdecho" 0)
(setq oldclayv (getvar "clayer"))

(command "_-dimstyle" "_r" "wdt_linear001")
(if (not (tblsearch "layer" "wdt-dim"))
(command "_-layer" "_n" "wdt-dim" "_c" "4" "wdt-dim" "")  
(command "_-layer" "_s" "wdt-dim" "")
)
(setq pt1 (getpoint  "first extension line origin or return to select: "))
(command "_dim1" "_hor" pt1 pause pause)
(setvar "clayer" oldclayv)

)


you can do similar with dimstyle....so if your dimstyle is not exist..
you can create one by default.
you can also add the linetype in your new layer if not created...
anyway...just for helping..

 8)
Keep smile...

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #22 on: February 21, 2005, 06:08:44 PM »
Quote from: Daron
Ah! Now if you look at your first post, it is far easier to read. As Sinc said, the text is difficult to read colored blue. At the same time, in Cobalt, red is hard on the eyes. I assume it's just as hard on the eyes in any theme. Andrea, just so you know, before you paste code into the text field, if you type [code] before...paste code here...[/code] and after your code, it goes in formatted and pure and no style gives the reader eye damage.


thanks, I'll try to remember....but this will not resoved my lisp problem

 :roll:
Keep smile...

nivuahc

  • Guest
Dim Mode !!?
« Reply #23 on: February 21, 2005, 06:11:09 PM »
Do you just want the answers, with no effort on your part whatsoever, Andrea? Is that what you're after?

daron

  • Guest
Dim Mode !!?
« Reply #24 on: February 21, 2005, 06:25:28 PM »
Quote from: Tom
This is what we use might help
(defun c:dh  (/ dp1 dp2)
    (setvar "cmdecho" 0)
    (setq oldclayv (getvar "clayer")
     )
    (command "-dimstyle" "r" "wdt_linear001")
    (command "-layer" "s" "wdt-dim" "")
    (prompt "first extension line origin or return to select: ")
    (command "_dim1" "hor" pause pause pause)
    (setvar "clayer" oldclayv)
    (princ)
    )

Before I begin: Tom, I'm going to critique your code a bit, so please don't take offense. I do this so that we might all put out better code. Believe it or not, people actually sell poorly coded work and get away with it. I'll explain in a bit of rage within the critique.

Okay, here it is. Taking what Tom posted; critiquing it lightly (not to bash or abuse) and adding suggestions. Note: I don't have Autocad while writing this. Here goes anyway:
First line (/ dp1 dp2) There are no variables declared or set. There then seems to be no reason to not do this (). However, there are variables set which should be placed between ( and )

I'm going to step right over the "-dimstyle" command. I don't see how that works at this point.

 (command "-layer" "s" "wdt-dim" "") [exasperated breath mode]Sigh[/ebm] As a programmer, you may think that using "s" is perfectly fine, and if it works it must be, but if someone ever comes to you and says, "Hey, that lisp you gave me didn't work. It told me to tell it what I want to do with the layer command..." don't be hard on him. He didn't know what layer you were trying to hard code. The better used value in this case would be to use "m" ILO "s". Even if the layer exists, it'll only be set, whereas if the layer doesn't exist, it will be made and set, unless you do as you've done and used "s", then you might want to brace yourself for questions. P.S. The reason this topic bothers me sooooooo much at this time more than EVER before, is for the mere fact that at my current employ, I'm forced to use this AWFUL program called AutoCrete. This is someones great idea of selling a product to a bunch of unknowing concrete contractors and making a killing. So, what's stopping me from going into this nuthead's lisp and improving it, you ask????? Well, the bonehead had the nerve to encrypt the one lisp that might mean anything. The actual lsp file is encrypted. It's not fas. Anybody know of a good decrypter? Okay, back on with the critique.

  (command "_dim1" "hor" pause pause pause) I'm not going to guess at what each succesive pause means, but the line before it seems to imply something. Now, since Andre' has need of more than "hor", wouldn't it be wise to setup some sort of user interaction? (initget "Hor Ver Ang") Then, set a variable to catch this solution before and then passing it to the command line. At the same time, more often than not, pause is used as select item or getpoint. If it's to get a point use getpoint set to a variable. If it's to get an entity, use one of the various methods available, i.e. entsel. Then, pass it along in variable form to the command line. Now, you say, "Well, I want to see the dimension on the screen before selecting all the points." Okay, use pause, but minimize the amount of times you use it. I know there are other ways of accomplishing this, but I do want to keep this simple.

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #25 on: February 22, 2005, 08:31:57 AM »
Quote from: nivuahc
Do you just want the answers, with no effort on your part whatsoever, Andrea? Is that what you're after?


Not really...in fact I want to understand before.....why ,how, who...
and create one of mine....

But if someone have some samples.....i'll take it..

thanks.
Keep smile...

ELOQUINTET

  • Guest
Dim Mode !!?
« Reply #26 on: February 22, 2005, 08:46:46 AM »
andrea i was using this reactor for awhile which would change the layer to the correspoding dimstyle when the dim command was executed. maybe you can use bits and pieces of it to get you where you wanna go.


Code: [Select]
(vl-load-com)
(vl-load-reactors)
(defun ax:MakeLayer (lName / oLayer)
  (if
    (vl-catch-all-error-p
      (setq oLayer
          (vl-catch-all-apply
            'vla-add
              (list
                (vla-get-layers
                  (vla-get-activedocument
                    (vlax-get-acad-object)
                    )
                  )
                lName
                )
             )
          )
        )
    nil
    oLayer
    )
  )
(vlr-command-reactor
  nil
  '((:vlr-CommandWillStart . StartCommand))
  )
(vlr-command-reactor
  nil
  '((:vlr-commandEnded . EndCommand))
  )
(vlr-command-reactor
  nil
  '((:vlr-commandCancelled . EndCommand))
  )
(defun StartCommand (calling-reactor startcommandinfo / thecommandstart)
  (setq thecommandstart (nth 0 startcommandInfo))
  (cond
    ((= thecommandstart "DIMLINEAR")
      (match:layer)
     )
    ((= thecommandstart "DIMALIGNED")
      (match:layer)
     )
    ((= thecommandstart "QDIM")
      (match:layer)
     )
    ((= thecommandstart "DIMBASELINE")
      (match:layer)
     )
    ((= thecommandstart "QLEADER")
      (match:layer)
     )
    ((= thecommandstart "DIMCONTINUE")
      (match:layer)
     )
    ((= thecommandstart "DIMANGULAR")
      (match:layer)
     )
    ((= thecommandstart "DIMRADIUS")
      (match:layer)
     )
    ((= thecommandstart "DIMDIAMETER")
      (match:layer)
     )
    ((= thecommandstart "DIMORDINATE")
      (match:layer)
     )
    )
  )
(defun EndCommand (calling-reactor endcommandInfo / thecommandend)
  (setq thecommandend (nth 0 endcommandInfo))
  (cond
    ((= thecommandend "DIMLINEAR")
      (EC:MatchLayer)
     )
    ((= thecommandend "DIMALIGNED")
      (EC:MatchLayer)
     )
    ((= thecommandend "QDIM")
      (EC:MatchLayer)
     )
    ((= thecommandend "DIMBASELINE")
      (EC:MatchLayer)
     )
    ((= thecommandend "QLEADER")
      (EC:MatchLayer)
     )
    ((= thecommandend "DIMCONTINUE")
      (EC:MatchLayer)
     )
    ((= thecommandend "DIMANGULAR")
      (EC:MatchLayer)
     )
    ((= thecommandend "DIMRADIUS")
      (EC:MatchLayer)
     )
    ((= thecommandend "DIMDIAMETER")
      (EC:MatchLayer)
     )
    ((= thecommandend "DIMORDINATE")
      (EC:MatchLayer)
     )
    )
  )
(defun match:layer (/ LayerName ex:dimstyle)
  (setq ex:layer (getvar 'clayer))
  (setq ex:dimstyle (getvar 'dimstyle))
  (if (/= ex:layer ex:dimstyle)
    (progn
      (setq LayerName (ax:MakeLayer ex:dimstyle))
      (vla-put-ActiveLayer
        (vla-get-activedocument
          (vlax-get-acad-object)
          )
        LayerName
        )
      (if (not (vlax-object-released-p LayerName))
        (vlax-release-object LayerName)
        )
      (princ)
      )
    )
  )
(defun EC:MatchLayer (/ LayerName)
  (progn
    (setq LayerName (ax:MakeLayer ex:layer))
    (vla-put-ActiveLayer
      (vla-get-activedocument
        (vlax-get-acad-object)
        )
      LayerName
      )
    (if
      (not
        (vlax-object-released-p LayerName)
        )
      (vlax-release-object LayerName)
      )
    (setq ex:layer nil)
    (princ)
    )
  )

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #27 on: February 24, 2005, 11:08:19 AM »
Quote from: nivuahc
Do you just want the answers, with no effort on your part whatsoever, Andrea? Is that what you're after?



hmmm....I have revised my decision....

I need the anwer....

I'm trying to understand the reactor...nut don't know if i'm going in the good way....and I need any solution for doing that...

I need to detect the DIM command..

(when dim activated) (do this)
(when dim stopped) (do that)

so i need to change the layer of any dimension without remaking all dimension command.

so in a Acad button to have somthing similar to..

(changelayerbefore)^c^c_QDIM;(resetlayerafter)

or

^c^c_QDIM;(change last in specific layer)

can I do this easily ?

Help needed....

thanks.

(sorry for my english. :oops:
Keep smile...

ronjonp

  • Needs a day job
  • Posts: 7529
Dim Mode !!?
« Reply #28 on: February 24, 2005, 01:34:00 PM »
Take a look here....not lisp but it works great:

http://theswamp.org/phpBB2/viewtopic.php?p=33933#33933

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #29 on: February 24, 2005, 03:56:49 PM »
I have created this...

Hi


Code: [Select]
(defun dim1_mode ()

(setvar "cecolor" 4))
(setvar "clayer" "dimensions")
 
(while (= 1 (getvar "cmdactive"))
(command pause)
(progn
  (command "cecolor" (getvar "cecolor"))
  (command "clayer" (getvar "clayer"))
)); end while
(princ)
)))


so i have modified a button...for exemple..
^C^C^P_dimlinear;(dim1_mode)

work well...but lot of error message..

also...this is not working when using...QDIM or DIMBASELINE or DIMCONTINUE   etc..

any help ?
Keep smile...

ronjonp

  • Needs a day job
  • Posts: 7529
Dim Mode !!?
« Reply #30 on: February 24, 2005, 07:10:06 PM »
Take a look at the vba module Keith posted .......You can set the layer to whatever you please before ANY command.


http://theswamp.org/phpBB2/viewtopic.php?p=33933#33933

I have a dimension layer set before:

dimaligned
dimangular
dimbaseline
dimcenter
dimcontinue
dimdiameter
dimlinear
dimordinate
dimradius
qdim
dim

and the layer will be set back after the command is done or you cancel out.

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #31 on: February 24, 2005, 10:13:27 PM »
what about

QLEADER or LEADER ??
Keep smile...

ronjonp

  • Needs a day job
  • Posts: 7529
Dim Mode !!?
« Reply #32 on: February 25, 2005, 11:24:03 AM »
Quote
what about

QLEADER or LEADER ??


We put those on a "leader" layer.....

Like I said before....ANY COMMAND can have a layer created before you run it.


Code: [Select]
If (CommandName = "dim") Then
  CLayer = ThisDrawing.GetVariable("CLAYER")
  Set XrefLay = ThisDrawing.Layers.Add("dimension")
  XrefLay.color = acWhite
  ThisDrawing.SetVariable "CLAYER", "dimension"
 End If


All you have to do is create another section with the appropriate command and layer.

Ron

Windows 11 x64 - AutoCAD /C3D 2023

Custom Build PC

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #33 on: February 27, 2005, 06:00:11 PM »
Quote from: ronjonp
Quote
what about

QLEADER or LEADER ??


We put those on a "leader" layer.....

Like I said before....ANY COMMAND can have a layer created before you run it.


Code: [Select]
If (CommandName = "dim") Then
  CLayer = ThisDrawing.GetVariable("CLAYER")
  Set XrefLay = ThisDrawing.Layers.Add("dimension")
  XrefLay.color = acWhite
  ThisDrawing.SetVariable "CLAYER", "dimension"
 End If


All you have to do is create another section with the appropriate command and layer.

Ron


Ok..ronjonp..

first...thanks for all your answer..
but i think i need help...because l'm not very familar with VBA in AutoCAD.. :oops:

How to get this routine to work ?
Keep smile...

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #34 on: February 27, 2005, 06:44:15 PM »
Quote from: ronjonp
Take a look at the vba module Keith posted .......You can set the layer to whatever you please before ANY command.


http://theswamp.org/phpBB2/viewtopic.php?p=33933#33933

I have a dimension layer set before:

dimaligned
dimangular
dimbaseline
dimcenter
dimcontinue
dimdiameter
dimlinear
dimordinate
dimradius
qdim
dim

and the layer will be set back after the command is done or you cancel out.

Ron



Ronjonp...

see the

http://theswamp.org/phpBB2/viewtopic.php?p=33933#33933

I have made some tests..
Keep smile...

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #35 on: February 28, 2005, 09:23:29 AM »
rnew reply...

http://theswamp.org/phpBB2/viewtopic.php?p=33933#33933


also..I need to make DIM command before dimensionning..

the
dimaligned
dimangular
dimbaseline
dimcenter
dimcontinue
dimdiameter
dimlinear
dimordinate
dimradius
qdim
dim

command not working in our office...maybe because we have AutoCAD (French release) even with the "underscore" before the command _
Keep smile...

PDJ

  • Guest
Dim Mode !!?
« Reply #36 on: February 28, 2005, 02:17:02 PM »
Andrea, here's something I've been using for about 15 years now:

Code: [Select]
(setq cl  (getvar "clayer")        ;current layer
            cc  (getvar "cecolor")       ;current color
            tln (cdr (assoc 8 el))       ;text layer name
            tc  (cdr (assoc 62 el))      ;text color
      )



Then to return back to the previous values:

Code: [Select]
(if (/= cl tln)(command "LAYER" "S" cl ""))
           (if (/= cc tc)(command "COLOR" cc))

Andrea

  • Water Moccasin
  • Posts: 2372
Dim Mode !!?
« Reply #37 on: February 28, 2005, 04:35:23 PM »
Quote from: PDJ
Andrea, here's something I've been using for about 15 years now:

Code: [Select]
(setq cl  (getvar "clayer")        ;current layer
            cc  (getvar "cecolor")       ;current color
            tln (cdr (assoc 8 el))       ;text layer name
            tc  (cdr (assoc 62 el))      ;text color
      )



Then to return back to the previous values:

Code: [Select]
(if (/= cl tln)(command "LAYER" "S" cl ""))
           (if (/= cc tc)(command "COLOR" cc))


PDJ...

I think the code is not complete...
need the "el" variable..

also, if "el" is a selected entity...
this is not what i need.

I only need to detect the DIM mode.
Keep smile...