Announcements
IMPORTANT. Forum in Read Only mode. You can no longer submit new questions or replies. Please read this message for details
Autodesk Architectural Desktop 2007 & Prior
Welcome to Autodesk’s Autodesk Architectural Desktop 2007 & Prior Forums. Share your knowledge, ask questions, and explore popular Autodesk Architectural Desktop 2007 & Prior topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Dimension Overrides - step by step

8 REPLIES 8
Reply
Message 1 of 9
Anonymous
422 Views, 8 Replies

Dimension Overrides - step by step

For those of you who have asked over the last few months, here is the way to
disable the automatic behavior that ADT has on AutoCAD dimension styles and
units. Disclaimer - you can adversely affect the operation of your computer
if you're not careful. Follow the steps below and you'll be okay. Hit the
[Delete] key somewhere along the way and you're likely to lose something
important.

1. Start RegEdit (Start menu > Run... > type Regedit in the "Open:" line >
pick OK).

On the left side of the Registry Editor dialog, you'll see something that
looks like a directory "tree" starting with "My Computer" at the top. Below
that you'll see several "keys" (HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, etc.).
Each of these has a plus sign in front. As with a directory tree, clicking
on the plus will expand the key to show you the next level.

2. Navigate to the key
HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R15.0\ACAD-12:{your locale
code - for ADT3 english this is: 409}\Profiles\{your profile
name}\Preferences\AecBase. (Navigate here means to expand the sequence of
keys until you get to the last one. When you expand "HKEY_CURRENT_USER",
you'll see "Software." When you expand that key, you'll see "Autodesk" and
so forth).

The text which I've included in {} above is variable, depending on your
particular localized version of ADT and the particular profile name that you
happen to be using to launch ADT. If you have a US English version of ADT3,
look for ACAD-12:409. Other localized versions will have a different three
digits at the end, but they'll all start with ACAD-12:. Similarly, the
current profile name can vary; {your profile name} from the usual
installation would be "Architectural Desktop". Continue expanding the tree
until you get to "AecBase" which has no plus sign. Select that key, so the
folder icon is open.

3. The values that are part of a key will appear in the right pane of the
Registry Editor dialog (in two columns - Name and Data).

Select the first of these values, "DwgSetupDoAcadVars", right-click and pick
Modify. Change the value from 1 (the default) to 0. OK.

4. Now start ADT. You will no longer have Dimension Style overrides
created, and the settings in the Drawing Setup dialog will not affect the
settings in the AutoCAD Units dialog. It is important to make the Registry
changes before you start ADT, because these values are read only at startup

----------------------------------------------------

Why isn't this easier? The intention of the Drawing Setup dialog is that it
will control your AutoCAD variables automatically.

Why is this available at all? Because someone planned for the occasional
user who would want to disable the automatic behavior.

What will we do in the future? We're always open to your suggestions.
Please post them to the autodesk.aec.arch-desktop.wishes newsgroup.

Thanks,

Bill Glennie
Autodesk AEC Market Group
8 REPLIES 8
Message 2 of 9
Anonymous
in reply to: Anonymous

EXCELLENT! We can now call for a funeral to this dimension override thread. (YOU ALL LISTENING SHARP?). Thanks Bill!
Message 3 of 9
Anonymous
in reply to: Anonymous

BIG Thanks to you Bill...YOU DA MAN!
I can now postpone the padded cell

Thanks again,
Mark
Message 4 of 9
Anonymous
in reply to: Anonymous

Aw, shucks! I thought we'd get to meet there!
Message 5 of 9
Anonymous
in reply to: Anonymous

and for those who do not want to trek the regedit waters, here is my
routine again
and as Bill said
"Note that once you have run Nauman's lisp file (which I have NOT
attempted),
you will need to exit ADT and re-start. These registry values are read
ONLY
when the program is first loaded. The fact that his program is based on
the
current profile means that you must also make sure that your current
profile
is the same as the one used when you start the program."

The advantage of Nauman's method is that you won't have to risk making
an
inadvertent change to the registry.

And those who are not familiar with lisps, copy the code between the CUT
lines and paste it in NOTEPAD, save the file as dimovrtoggle.LSP (make
sure you type in .LSP). open the folder where you saved it and drag n
DROP the file onto AUTOCAD drawing area. then type in DIMOVRTOGGLE, exit
autocad and restart it.

----------------CUT ------------------
;;Rob Starz registry editing code
(defun SetRegistry ( key Dword setting / )
(vl-registry-write (strcat "HKEY_CURRENT_USER\\"
(vlax-product-key)
"\\Profiles\\"
(getvar "cprofile")
key ) Dword setting )
)

(defun GetRegistry ( key Dword / )
(vl-registry-read (strcat "HKEY_CURRENT_USER\\"
(vlax-product-key)
"\\Profiles\\"
(getvar "cprofile")
key ) Dword )
)
;;;Toggle Dimoverrides On/Off..By Nauman Mysorewala
(defun C:DIMOVRTOGGLE ( / val1 val2)
(setq val1 (getregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars"))
(setq val2 (getregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars"))
;;(princ (strcat "DwgSetupDoLispVars" (itoa val1) "DwgSetupDoAcadVars"
(itoa val2)))
(if (= val1 nil)
(princ "You are not using ADT3")
(progn
(if (= val1 0)
(progn
(setregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars" 1)
(setregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars" 1)
(princ "Dimension Overrides have been Turned On")
);end progn
(progn
(setregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars" 0)
(setregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars" 0)
(princ "Dimension Overrides have been Turned OFF")
);end progn
);end if
);end progn
);end if
(princ)
);;end

------------------------------END CUT -------------------

Nauman M
CAD Bazaar
Need to easily Navigate to your Custom Content Folders?
Need Autolayering for Dimensions without going through Design Center?
Download the updated ADT Tools for ADT 2 & 3 at
http://www.cadbazaar.com

"Bill Glennie [Autodesk]" wrote:
>
> For those of you who have asked over the last few months, here is the way to
> disable the automatic behavior that ADT has on AutoCAD dimension styles and
> units. Disclaimer - you can adversely affect the operation of your computer
> if you're not careful. Follow the steps below and you'll be okay. Hit the
> [Delete] key somewhere along the way and you're likely to lose something
> important.
>
> 1. Start RegEdit (Start menu > Run... > type Regedit in the "Open:" line >
> pick OK).
>
> On the left side of the Registry Editor dialog, you'll see something that
> looks like a directory "tree" starting with "My Computer" at the top. Below
> that you'll see several "keys" (HKEY_CLASSES_ROOT, HKEY_CURRENT_USER, etc.).
> Each of these has a plus sign in front. As with a directory tree, clicking
> on the plus will expand the key to show you the next level.
>
> 2. Navigate to the key
> HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R15.0\ACAD-12:{your locale
> code - for ADT3 english this is: 409}\Profiles\{your profile
> name}\Preferences\AecBase. (Navigate here means to expand the sequence of
> keys until you get to the last one. When you expand "HKEY_CURRENT_USER",
> you'll see "Software." When you expand that key, you'll see "Autodesk" and
> so forth).
>
> The text which I've included in {} above is variable, depending on your
> particular localized version of ADT and the particular profile name that you
> happen to be using to launch ADT. If you have a US English version of ADT3,
> look for ACAD-12:409. Other localized versions will have a different three
> digits at the end, but they'll all start with ACAD-12:. Similarly, the
> current profile name can vary; {your profile name} from the usual
> installation would be "Architectural Desktop". Continue expanding the tree
> until you get to "AecBase" which has no plus sign. Select that key, so the
> folder icon is open.
>
> 3. The values that are part of a key will appear in the right pane of the
> Registry Editor dialog (in two columns - Name and Data).
>
> Select the first of these values, "DwgSetupDoAcadVars", right-click and pick
> Modify. Change the value from 1 (the default) to 0. OK.
>
> 4. Now start ADT. You will no longer have Dimension Style overrides
> created, and the settings in the Drawing Setup dialog will not affect the
> settings in the AutoCAD Units dialog. It is important to make the Registry
> changes before you start ADT, because these values are read only at startup
>
> ----------------------------------------------------
>
> Why isn't this easier? The intention of the Drawing Setup dialog is that it
> will control your AutoCAD variables automatically.
>
> Why is this available at all? Because someone planned for the occasional
> user who would want to disable the automatic behavior.
>
> What will we do in the future? We're always open to your suggestions.
> Please post them to the autodesk.aec.arch-desktop.wishes newsgroup.
>
> Thanks,
>
> Bill Glennie
> Autodesk AEC Market Group

--

-------------------
Nauman M
CAD Bazaar
Need to easily Navigate to your Custom Content Folders?
Need Autolayering for Dimensions without going through Design Center?
Download the updated ADT Tools for ADT 2 & 3 at
http://www.cadbazaar.com
Message 6 of 9
Anonymous
in reply to: Anonymous

One quick Question..
Since we're changing the registry values for I'm assuming more than one
ADTR3 Variable, what else does this affect? or is it just for Dim
overrides? Side note... I think I'll stick with the lisp routine. That
button is way to close to the enter button!

Randy Rush

"Nauman M" wrote in message
news:3ABA7620.4D3C282F@email.com...
> and for those who do not want to trek the regedit waters, here is my
> routine again
> and as Bill said
> "Note that once you have run Nauman's lisp file (which I have NOT
> attempted),
> you will need to exit ADT and re-start. These registry values are read
> ONLY
> when the program is first loaded. The fact that his program is based on
> the
> current profile means that you must also make sure that your current
> profile
> is the same as the one used when you start the program."
>
> The advantage of Nauman's method is that you won't have to risk making
> an
> inadvertent change to the registry.
>
> And those who are not familiar with lisps, copy the code between the CUT
> lines and paste it in NOTEPAD, save the file as dimovrtoggle.LSP (make
> sure you type in .LSP). open the folder where you saved it and drag n
> DROP the file onto AUTOCAD drawing area. then type in DIMOVRTOGGLE, exit
> autocad and restart it.
>
> ----------------CUT ------------------
> ;;Rob Starz registry editing code
> (defun SetRegistry ( key Dword setting / )
> (vl-registry-write (strcat "HKEY_CURRENT_USER\\"
> (vlax-product-key)
> "\\Profiles\\"
> (getvar "cprofile")
> key ) Dword setting )
> )
>
> (defun GetRegistry ( key Dword / )
> (vl-registry-read (strcat "HKEY_CURRENT_USER\\"
> (vlax-product-key)
> "\\Profiles\\"
> (getvar "cprofile")
> key ) Dword )
> )
> ;;;Toggle Dimoverrides On/Off..By Nauman Mysorewala
> (defun C:DIMOVRTOGGLE ( / val1 val2)
> (setq val1 (getregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars"))
> (setq val2 (getregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars"))
> ;;(princ (strcat "DwgSetupDoLispVars" (itoa val1) "DwgSetupDoAcadVars"
> (itoa val2)))
> (if (= val1 nil)
> (princ "You are not using ADT3")
> (progn
> (if (= val1 0)
> (progn
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars" 1)
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars" 1)
> (princ "Dimension Overrides have been Turned On")
> );end progn
> (progn
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars" 0)
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars" 0)
> (princ "Dimension Overrides have been Turned OFF")
> );end progn
> );end if
> );end progn
> );end if
> (princ)
> );;end
>
> ------------------------------END CUT -------------------
>
> Nauman M
> CAD Bazaar
> Need to easily Navigate to your Custom Content Folders?
> Need Autolayering for Dimensions without going through Design Center?
> Download the updated ADT Tools for ADT 2 & 3 at
> http://www.cadbazaar.com
>
> "Bill Glennie [Autodesk]" wrote:
> >
> > For those of you who have asked over the last few months, here is the
way to
> > disable the automatic behavior that ADT has on AutoCAD dimension styles
and
> > units. Disclaimer - you can adversely affect the operation of your
computer
> > if you're not careful. Follow the steps below and you'll be okay. Hit
the
> > [Delete] key somewhere along the way and you're likely to lose something
> > important.
> >
> > 1. Start RegEdit (Start menu > Run... > type Regedit in the "Open:" line
>
> > pick OK).
> >
> > On the left side of the Registry Editor dialog, you'll see something
that
> > looks like a directory "tree" starting with "My Computer" at the top.
Below
> > that you'll see several "keys" (HKEY_CLASSES_ROOT, HKEY_CURRENT_USER,
etc.).
> > Each of these has a plus sign in front. As with a directory tree,
clicking
> > on the plus will expand the key to show you the next level.
> >
> > 2. Navigate to the key
> > HKEY_CURRENT_USER\Software\Autodesk\AutoCAD\R15.0\ACAD-12:{your locale
> > code - for ADT3 english this is: 409}\Profiles\{your profile
> > name}\Preferences\AecBase. (Navigate here means to expand the sequence
of
> > keys until you get to the last one. When you expand
"HKEY_CURRENT_USER",
> > you'll see "Software." When you expand that key, you'll see "Autodesk"
and
> > so forth).
> >
> > The text which I've included in {} above is variable, depending on your
> > particular localized version of ADT and the particular profile name that
you
> > happen to be using to launch ADT. If you have a US English version of
ADT3,
> > look for ACAD-12:409. Other localized versions will have a different
three
> > digits at the end, but they'll all start with ACAD-12:. Similarly, the
> > current profile name can vary; {your profile name} from the usual
> > installation would be "Architectural Desktop". Continue expanding the
tree
> > until you get to "AecBase" which has no plus sign. Select that key, so
the
> > folder icon is open.
> >
> > 3. The values that are part of a key will appear in the right pane of
the
> > Registry Editor dialog (in two columns - Name and Data).
> >
> > Select the first of these values, "DwgSetupDoAcadVars", right-click and
pick
> > Modify. Change the value from 1 (the default) to 0. OK.
> >
> > 4. Now start ADT. You will no longer have Dimension Style overrides
> > created, and the settings in the Drawing Setup dialog will not affect
the
> > settings in the AutoCAD Units dialog. It is important to make the
Registry
> > changes before you start ADT, because these values are read only at
startup
> >
> > ----------------------------------------------------
> >
> > Why isn't this easier? The intention of the Drawing Setup dialog is
that it
> > will control your AutoCAD variables automatically.
> >
> > Why is this available at all? Because someone planned for the
occasional
> > user who would want to disable the automatic behavior.
> >
> > What will we do in the future? We're always open to your suggestions.
> > Please post them to the autodesk.aec.arch-desktop.wishes newsgroup.
> >
> > Thanks,
> >
> > Bill Glennie
> > Autodesk AEC Market Group
>
> --
>
> -------------------
> Nauman M
> CAD Bazaar
> Need to easily Navigate to your Custom Content Folders?
> Need Autolayering for Dimensions without going through Design Center?
> Download the updated ADT Tools for ADT 2 & 3 at
> http://www.cadbazaar.com
Message 7 of 9
Anonymous
in reply to: Anonymous

Hey Nauman,

I tried your lisp and I'm getting "Your not using ADTR3." Also, and just
so you know I'm very new to Vlisp so I'm not sure on anything, so bare with
me. I got an error message stating there was an additional right
parenthesis.. it was just after the (princ) so I got ride of it and I don't
get the message anymore. I clipped it into a lisp routine that always loads
with ADT, then assigned it to a menu drop down so i can just click on it
whenever... but all it does is give me the current registry value. I'm
looking at your code now and I can sort of follow it. Now for the lesson...
correct me if I'm wrong... and I know this belongs in customization but...

> (defun SetRegistry ( key Dword setting / )
> (vl-registry-write (strcat "HKEY_CURRENT_USER\\"
> (vlax-product-key)
> "\\Profiles\\"
> (getvar "cprofile")
> key ) Dword setting )
> )
Can follow this I think defining the function SetRegistry by writing to the
current profile in the registry (although I got lost at the key Dword
setting... Question- What is that? I know it's a argument, I think...

> (defun GetRegistry ( key Dword / )
> (vl-registry-read (strcat "HKEY_CURRENT_USER\\"
> (vlax-product-key)
> "\\Profiles\\"
> (getvar "cprofile")
> key ) Dword )
> )
Defining function Getregistry... same thing with the Dword... no clue....
Question- I'm not sure but wouldnt you want to get the registry before you
write to it? or since your only defining the functions it doesnt really
matter?

> ;;;Toggle Dimoverrides On/Off..By Nauman Mysorewala
> (defun C:DIMOVRTOGGLE ( / val1 val2)
> (setq val1 (getregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars"))
> (setq val2 (getregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars"))
> ;;(princ (strcat "DwgSetupDoLispVars" (itoa val1) "DwgSetupDoAcadVars"
> (itoa val2)))
> (if (= val1 nil)
> (princ "You are not using ADT3")
I'm assuming that somewhere in here the program is setting val1 to nil which
is why I'm getting... This statement. So I went into the registry based on
Mr. Glennies' instructions, the value was set to 1... I changed it to 0,
(was only a lil afraid!) I thought changing it to 0 would trigger something
but all I get is DIMOVRTOGGLE "0" instead of "1". So I'm assuming the
program is getting stuck... somewhere above me.

> (progn
> (if (= val1 0)
> (progn
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars" 1)
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars" 1)
> (princ "Dimension Overrides have been Turned On")
> );end progn
> (progn
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars" 0)
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars" 0)
> (princ "Dimension Overrides have been Turned OFF")
I can basically follow whats going on here and it makes sense.

> );end progn
> );end if
> );end progn
> );end if
> (princ)
> );;end
this last parenthesis was giving me an error. Anyway any help you can give
would be appreciated
thank you

Randy Rush
Message 8 of 9
Anonymous
in reply to: Anonymous

see below

Randy besides the learning , the code works as is. the setregistry and
getregistry are just functions Rob wrote to easily read and write to
current User registry. if you clip between the CUT's correctly, the code
should work, but I figured what the problem is that the newreader is
wrapping a line and instead of being one continuous, it is making it two
separate the (itoa val1))) should be part of the commented PRINC line.
so here is the updated code which should work.

your answers are below
----------------CUT---------------------------
;;Rob Starz registry editing code
(defun SetRegistry ( key Dword setting / )
(vl-registry-write (strcat "HKEY_CURRENT_USER\\"
(vlax-product-key)
"\\Profiles\\"
(getvar "cprofile")
key ) Dword setting )
)

(defun GetRegistry ( key Dword / )
(vl-registry-read (strcat "HKEY_CURRENT_USER\\"
(vlax-product-key)
"\\Profiles\\"
(getvar "cprofile")
key ) Dword )
)
;;;Toggle Dimoverrides On/Off
(defun C:DIMOVRTOGGLE ( / val1 val2)
(setq val1 (getregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars"))
(setq val2 (getregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars"))
(if (= val1 nil)
(princ "You are not using ADT3")
(progn
(if (= val1 0)
(progn
(setregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars" 1)
(setregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars" 1)
(princ "Dimension Overrides have been Turn On")
);end progn
(progn
(setregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars" 0)
(setregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars" 0)
(princ "Dimension Overrides have been Turn OFF")
);end progn
);end if
);end progn
);end if
(princ)
);;end
----------------CUT---------------------------

Randy Rush wrote:
>
> Hey Nauman,
>
I clipped it into a lisp routine that always loads
> with ADT, then assigned it to a menu drop down so i can just click on it
> whenever... but all it does is give me the current registry value. I'm
> looking at your code now and I can sort of follow it. Now for the lesson...
> correct me if I'm wrong... and I know this belongs in customization but...

Well the issue is that you have to restart ADT for the settin gto be in
effect as it is read only at startup. so assigning it to the menu might
be decieving that it does it instantly, which is not true.

>
> > (defun SetRegistry ( key Dword setting / )
> Can follow this I think defining the function SetRegistry by writing to the
> current profile in the registry (although I got lost at the key Dword
> setting... Question- What is that? I know it's a argument, I think...

This is a registry write function, which writes it to the CURRENT
PROFILE registry.
the vl-registry-write function needs three arguments, the path, the
VALUE, and the setting for the Value.

in our case , the part of the path is being filled in by the
vlax-product-key and (getvar "cprofile")
and then I just supply the rest
(setregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars" 1)
KEY DWORD setting

i..e this would translate to on mycomputer,
HKEY_CURRENT_USER\\Software\\Autodesk\\Autocad\\12:409\\Nauman\\Preferences\\AecBase
and then I want to modeify DWGSETUPDOLispVars by setting its value to 1

the Getregistry is the same, but it needs 2 arguments, as it is
providing us with the setting in return.

>
>> or since your only defining the functions it doesnt really
> matter?

I am just definging the FUNCTIONS, I am not doing anything with it
yet...

>
> > ;;;Toggle Dimoverrides On/Off..By Nauman Mysorewala
> > ;;(princ (strcat "DwgSetupDoLispVars" (itoa val1) "DwgSetupDoAcadVars"
> > (itoa val2))) <<<<<<<<<<<<<<<<<<<<<<<<,hey this should be commented here as part of the (princ (strcat
> > (if (= val1 nil)
> > (princ "You are not using ADT3")
> I'm assuming that somewhere in here the program is setting val1 to nil which
> is why I'm getting... This statement.
by default any variable that you set in autocad autolisp is nil. i.e. in
Autolisp you really do no define a variable the value of the variable
tells autocad the type of the variable it is, unlike VBA where you have
to specifically tell what type of variable it is and you define it
before using it.
and hence if you say on the command line of autocad
(princ MYOWNSPECIALVARIABLE) it will print nil
or for that matter anything.
but if you say
(setq MYOWNSPECIALVARIABLE 1)
then this is an intger variable
and should output 1
(setq MYOWNSPECIALVARIABLE "1")
will make it a string.

Hope this helps!!

sorry for the error, but the wrapping sometimes messes many things.

-------------------
Nauman M
CAD Bazaar
Need to easily Navigate to your Custom Content Folders?
Need Autolayering for Dimensions without going through Design Center?
Download the updated ADT Tools for ADT 2 & 3 at
http://www.cadbazaar.com
Message 9 of 9
Anonymous
in reply to: Anonymous

Nauman,

Thanks that did it... I didn't even notice that, although I should have
after you pointed it out, I thought... the parenthesis add up... by why are
those semi-colon's there? it now makes sense, Thank you.

Randy Rush

"Nauman M" wrote in message
news:3ABB61E4.80DFAD45@email.com...
> see below
>
> Randy besides the learning , the code works as is. the setregistry and
> getregistry are just functions Rob wrote to easily read and write to
> current User registry. if you clip between the CUT's correctly, the code
> should work, but I figured what the problem is that the newreader is
> wrapping a line and instead of being one continuous, it is making it two
> separate the (itoa val1))) should be part of the commented PRINC line.
> so here is the updated code which should work.
>
> your answers are below
> ----------------CUT---------------------------
> ;;Rob Starz registry editing code
> (defun SetRegistry ( key Dword setting / )
> (vl-registry-write (strcat "HKEY_CURRENT_USER\\"
> (vlax-product-key)
> "\\Profiles\\"
> (getvar "cprofile")
> key ) Dword setting )
> )
>
> (defun GetRegistry ( key Dword / )
> (vl-registry-read (strcat "HKEY_CURRENT_USER\\"
> (vlax-product-key)
> "\\Profiles\\"
> (getvar "cprofile")
> key ) Dword )
> )
> ;;;Toggle Dimoverrides On/Off
> (defun C:DIMOVRTOGGLE ( / val1 val2)
> (setq val1 (getregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars"))
> (setq val2 (getregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars"))
> (if (= val1 nil)
> (princ "You are not using ADT3")
> (progn
> (if (= val1 0)
> (progn
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars" 1)
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars" 1)
> (princ "Dimension Overrides have been Turn On")
> );end progn
> (progn
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars" 0)
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoAcadVars" 0)
> (princ "Dimension Overrides have been Turn OFF")
> );end progn
> );end if
> );end progn
> );end if
> (princ)
> );;end
> ----------------CUT---------------------------
>
> Randy Rush wrote:
> >
> > Hey Nauman,
> >
> I clipped it into a lisp routine that always loads
> > with ADT, then assigned it to a menu drop down so i can just click on it
> > whenever... but all it does is give me the current registry value. I'm
> > looking at your code now and I can sort of follow it. Now for the
lesson...
> > correct me if I'm wrong... and I know this belongs in customization
but...
>
> Well the issue is that you have to restart ADT for the settin gto be in
> effect as it is read only at startup. so assigning it to the menu might
> be decieving that it does it instantly, which is not true.
>
> >
> > > (defun SetRegistry ( key Dword setting / )
> > Can follow this I think defining the function SetRegistry by writing to
the
> > current profile in the registry (although I got lost at the key Dword
> > setting... Question- What is that? I know it's a argument, I think...
>
> This is a registry write function, which writes it to the CURRENT
> PROFILE registry.
> the vl-registry-write function needs three arguments, the path, the
> VALUE, and the setting for the Value.
>
> in our case , the part of the path is being filled in by the
> vlax-product-key and (getvar "cprofile")
> and then I just supply the rest
> (setregistry "\\Preferences\\AecBase" "DwgSetupDoLispVars" 1)
> KEY DWORD setting
>
> i..e this would translate to on mycomputer,
>
HKEY_CURRENT_USER\\Software\\Autodesk\\Autocad\\12:409\\Nauman\\Preferences\
\AecBase
> and then I want to modeify DWGSETUPDOLispVars by setting its value to 1
>
> the Getregistry is the same, but it needs 2 arguments, as it is
> providing us with the setting in return.
>
> >
> >> or since your only defining the functions it doesnt really
> > matter?
>
> I am just definging the FUNCTIONS, I am not doing anything with it
> yet...
>
> >
> > > ;;;Toggle Dimoverrides On/Off..By Nauman Mysorewala
> > > ;;(princ (strcat "DwgSetupDoLispVars" (itoa val1) "DwgSetupDoAcadVars"
> > > (itoa val2))) <<<<<<<<<<<<<<<<<<<<<<<<,hey this should be commented
here as part of the (princ (strcat
> > > (if (= val1 nil)
> > > (princ "You are not using ADT3")
> > I'm assuming that somewhere in here the program is setting val1 to nil
which
> > is why I'm getting... This statement.
> by default any variable that you set in autocad autolisp is nil. i.e. in
> Autolisp you really do no define a variable the value of the variable
> tells autocad the type of the variable it is, unlike VBA where you have
> to specifically tell what type of variable it is and you define it
> before using it.
> and hence if you say on the command line of autocad
> (princ MYOWNSPECIALVARIABLE) it will print nil
> or for that matter anything.
> but if you say
> (setq MYOWNSPECIALVARIABLE 1)
> then this is an intger variable
> and should output 1
> (setq MYOWNSPECIALVARIABLE "1")
> will make it a string.
>
> Hope this helps!!
>
> sorry for the error, but the wrapping sometimes messes many things.
>
> -------------------
> Nauman M
> CAD Bazaar
> Need to easily Navigate to your Custom Content Folders?
> Need Autolayering for Dimensions without going through Design Center?
> Download the updated ADT Tools for ADT 2 & 3 at
> http://www.cadbazaar.com

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report