Jump to content



Recommended Posts

Generally each settings in the Options dialog has an associated system variable. This gives us a way to programmatically access them.


However, AMOPTIONS don't seem to have any associated system variables.


Even the Preferences object doesn't seem to give them the access.


What, then, is the way to access them using VBA?

Link to comment
Share on other sites

AM is Autodesk Mechanical and AMOPTIONS is the equivalent to OPTIONS in vanilla AutoCAD. AM is an AutoCAD vertical and VBA cannot deal with the specialities of the verticals. http://docs.autodesk.com/AMECH_PP/2013/ENU/index.html?url=filesACM/GUID-534FFA6A-EAE6-49C6-AFB5-2D43BEAB85D5.htm,topicNumber=ACMd30e171093


There is a solution to your problem and that is go to .NET. You can download the free Visual Studio Express program directly from the Microsoft web site. The latest version is VSE 2012, but be warned it is only available as a 64-bit version. You can however still download the VSE 2010 if you need a 32-bit version.

Link to comment
Share on other sites

I don't use Mechanical, but the first result in a quick Google search brought me to this, which includes Documentation, Samples, etc. for Mechanical's ActiveX COM (VBA), and .NET Developer resources:


Autodesk Developer Network - AutoCAD® Mechanical



ActiveX (COM Automation)


AutoCAD Mechanical ActiveX Automation contains three parts of type libraries, including SymBBAuto (Symbols, Balloons, and Bills Of Materials), AcadmAuto (AutoCAD Mechanical), and GeAuto (Geometry). These type libraries provide ActiveX® interfaces in AutoCAD Mechanical software to automate AutoCAD Mechanical from other applications via COM automation.




I wholeheartedly support Tyke's recommendation to jump to .NET API despite VBA 7 being made available as Jimmy reports here.


I skipped VBA altogether, and jumped from Visual LISP to .NET API, and could not be more happy that I did... This old thread may be of use to you, if you decide to give .NET a try:


Where to start with .Net?





Link to comment
Share on other sites

I wholeheartedly support Tyke's recommendation to jump to .NET API despite VBA 7 being made available as Jimmy reports here.


As Jimmy says VB6 Controls will not work in VAB7. That means some controls are missing, such as a progress bar, and should you try to run a VBA6 project with some of these controls in VBA7 it will not run. The "SHELL" function in VBA7 does not work either. I haven't done a lot of checking so I cannot offer a definitive list of the implications of VBA7 not implementing VB6 controls. My advice is drop VBA7 and go to .NET. But as you are running AutoCAD 2010 VBA7 should not be an issue. But the advice is still good.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...