Readme for Mechanical Structure VBA Samples

This readme contains information about the VBA samples which show functionality for Mechanical Structure in AutoCAD Mechanical.

To Use the Samples

The samples are AutoCAD VBA project (DVB) files. See the "Description of the Samples" section below for any specific information about the samples.

To use a VBA sample or view its code

  1. Start AutoCAD Mechanical, drag and drop the VBA sample into AutoCAD Mechanical.
  2. On the AutoCAD Mechanical Assist menu, click Macro > Macros.
  3. In the Macros dialog box, in the Macro list, select a macro to use or view.
  4. Do one of the following:
    1. To use the selected macro, click Run.
    2. To view the code of the selected macro in the VBA Integrated Development Environment (VBA IDE), click Edit.


Descriptions of the Samples

 

PickStructure.dvb

This sample demonstrates how to pick on folder and component view in model space, and get the properties of the folder, component view, and folder and component view definitions.

Before using this sample, open the PickStructure.dwg sample drawing file.

To use the sample for component views and folders, run the macros named Views_Folders.

To use the sample for component view and folder definitions, run the macros named ViewsDefs_FolderDefs.

Return to Top

structure_mgr.dvb

This sample provides the following general functionality of mechanical structure:

To use the sample, run the macro named StructureMgr.

Return to Top

CreateStructure.dvb

This sample provides the following AMSNEW functionality:

To use the sample, run the macro named CreateStructure.

Return to Top

XrefStructure.dvb

This sample lists external component and component view definition in xref drawing, xref components and component views inserted in structure, and provides the following xref functionality:

To use the sample, run the macro named XrefStructure.

As this sample references to “Microsoft Windows Common Controls 6.0”, you must ensure that this Common Control is installed and “mscomctl.ocx” exists in “WINDOWS\system32” or “WINDOWS\SysWOW64\” (for 64-bit Windows OS).

Return to Top

RestructureView.dvb

 

This sample provides the following restructure functionality for component views and folders:

To use the sample, run the macro named RestructureView.

As this sample references to “Microsoft Windows Common Controls 6.0”, you must ensure that this Common Control is installed and “mscomctl.ocx” exists in “WINDOWS\system32” or “WINDOWS\SysWOW64\” (for 64-bit Windows OS).

Return to Top

ComponentAttribute.dvb

 

This sample provides the following functionality to attach, query and manage attribute associated with a component definition:

To use the sample, run the macro named ComponentAttribute.

Return to Top

FormulaEvaluator.dvb

 

This sample provides the following data provider functionality for standard part:

To use the sample, run the macro named FormulaEvaluator.

Return to Top

AMSHide2D.dvb

 

This sample demonstrates how to create and edit simple and complex hide situations.

To use the sample, run the macros named CreateAndEditSimpleHide and CreateAndEditComplexHide.

 

Return to Top