AutoCAD Land Desktop

AutoCAD Land Desktop

Reply
*Lazic, Rad
Post 1 of 2

Project Preferences Settings

72 Views, 1 Replies
03-16-2002 08:15 PM
Hi,

Has anyone tried to toggle on/off any of the project preferences settings in
VBA?
They are controlled through normal Settings functions and some just have a
On/Off state.

They are declared as enumerated "eAeccPref... " types and usually hold a
list of constants with preset values for every switch.

I have used the following list from eAeccPrefParcelInt:

kIncludeParcelLines
kNumberLabelsOn

Using those, I was only able to toggle Off. Repeated use would leave the
toggle Off.
NB: There are no constants named "kNumberLabelsOff"

How to read a current state of the setting, toggle it On or Off as needed
and reset to original state?

Any advise is welcome.

TIA

Rad
*Lazic, Rad
Post 2 of 2

Project Preferences Settings - OK, OK...

03-16-2002 09:28 PM in reply to: *Lazic, Rad
Ha, ha,

Of course, the standard 1 and 0 worked like a charm!
But what confused me when I tried them at first was that when you query any
of the "kNumberLabelsOn" etc. at runtime, they return values of 5, 6, 11...

Obviously, this was misleading (in my case, anyway...).
So, the right way to do it is:

...snip code

Set parcelPref = AeccApplication.ActiveProject.Preferences.parcel
Dim ti(12) As Long
ti(0) = parcelPref.GetInteger(kAreaUnitLabelsOn)
ti(1) = parcelPref.GetInteger(kAreaUnitPrecision)
ti(2) = parcelPref.GetInteger(kAutoLabelPlacement)

...snip

parcelPref.SetInteger kAreaUnitLabelsOn, 0
parcelPref.SetInteger kAreaUnitPrecision, 1
parcelPref.SetInteger kAutoLabelPlacement, 1

...snip

parcelPref.SetInteger kAreaUnitLabelsOn, ti(0)
parcelPref.SetInteger kAreaUnitPrecision, ti(1)
parcelPref.SetInteger kAutoLabelPlacement, ti(2)

etc...

Thanks for everyone's support (or patience...)

Regards,
Rad
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!