VBA
Discuss AutoCAD ActiveX and VBA (Visual Basic for Applications) questions here.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Select and Change AutoCAD Profile via VBA

2 REPLIES 2
Reply
Message 1 of 3
Anonymous
603 Views, 2 Replies

Select and Change AutoCAD Profile via VBA

Does anyone know if it is possible to change the current profile setting via
VBA while in AutoCAD 2002?

Basically, I have several profiles utilized for different purposes. I would
like the operator on startup to select the profile needed for that session.
Also, the ability to easily change profiles without going to
Tools>Options... Profiles or having several desktop icons with the different
profile switches set.

I am able to read all the profiles available from the registry, and place
them in a list box, however simply writing a selected profile as new value
to the Profiles (Default) registry key does not affect the current session.
The profile selected and written to the registry however is the default the
next time AutoCAD is started.

Any ideas how this can be achieved????

Thanks.
2 REPLIES 2
Message 2 of 3
Anonymous
in reply to: Anonymous

This statement returns a variant array of string values containing a list of
the available profiles on the system:
Call
ThisDrawing.Application.Preferences.Profiles.GetAllProfileNames(myprofilenam
es)

This statement can set the active profile (where i is the array index):
ThisDrawing.Application.Preferences.Profiles.ActiveProfile =
myprofilenames(i)

Cheers,
Kenneth Hutson
San Antonio, Texas


"T Willmer" wrote in message
news:51AAC149482EE6C87CB99820476CE4D0@in.WebX.maYIadrTaRb...
> Does anyone know if it is possible to change the current profile setting
via
> VBA while in AutoCAD 2002?
>
> Basically, I have several profiles utilized for different purposes. I
would
> like the operator on startup to select the profile needed for that
session.
> Also, the ability to easily change profiles without going to
> Tools>Options... Profiles or having several desktop icons with the
different
> profile switches set.
>
> I am able to read all the profiles available from the registry, and place
> them in a list box, however simply writing a selected profile as new value
> to the Profiles (Default) registry key does not affect the current
session.
> The profile selected and written to the registry however is the default
the
> next time AutoCAD is started.
>
> Any ideas how this can be achieved????
>
> Thanks.
>
>
Message 3 of 3
Anonymous
in reply to: Anonymous

Thanks Ken... just what I wanted... works great.

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

Post to forums  

Autodesk Design & Make Report

”Boost