NirantarVidyarthee Posted August 14, 2013 Posted August 14, 2013 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? Quote
Tyke Posted August 14, 2013 Posted August 14, 2013 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. Quote
BlackBox Posted August 14, 2013 Posted August 14, 2013 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? Quote
Tyke Posted August 14, 2013 Posted August 14, 2013 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. Quote
BlackBox Posted August 14, 2013 Posted August 14, 2013 ... But the advice is still good. 1+ Tyke, Tyke, Tyke, Tyke... What day is it, Tyke? #WhatWhat Quote
Recommended Posts
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.