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

0 Members and 1 Guest are viewing this topic.

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...