You are on page 1of 3

OS.

Autodesk AutoCAD Macro


Wri ng the Member Sec on Forces at any Distance Along a Member in AutoCAD® 2000 or higher.

OpenSTAAD can also be used to integrate pre- or post-processing data with AutoCAD 2000 or higher.AutoCAD 2000 supports VBA macros with its own exposed set of func ons. This example automa cally calculates the sec on forces at any distance along a member from a
STAAD file and plots the results in a table as a separate layer. A dialog box was created in AutoCAD using AutoCAD VBA forms. The input box will prompt for the STAAD file name, the member number, the load case and the point along the member (expressed as a frac on
of the length) where the sec on forces are to be determined. The macro returns the sec on forces (by using OpenSTAAD to read STAAD's database) and plots them in a pre-defined table in the DXF file (STDandAcad.dxf).

1. Open the file C:\Users\Public\Documents\STAAD.Pro CONNECT Edition\Samples\ OpenSTAAD\STDandACAD.dwg.

AutoCAD will warn of macros present in the file.

CAUTION: It is always recommended to do a virus scan on any macro before opening it - including this one!

2. Click Enable Macros.

3. To run the macro, either:

select the RUN VBA Macro tool on the Manage tab (AutoCAD 2009 and higher).

Note: Microso Visual Basic for Applica ons Module is not installed with recent versions of AutoCAD but can be downloaded from the Autodesk website. Refer to the help included with AutoCAD for more informa on.

or

select Tools > Macro > Macros (previous versions of AutoCAD or when AutoCAD 2009 is in AutoCAD Classic mode).

or

press ALT+F8.

The Macro dialog opens.


Macro dialog in Autodesk AutoCAD 2011

4. Select the macro named STAADSectionForces and click Run.

The STAAD.Pro Sec on Forces dialog opens. A warning also opens informing you that the STAAD File name must be specified.

5. Enter a valid filename, including complete file path, for the current input file open in STAAD.Pro. The Member Number and Load Case drop-down lists are populated with data from the selected model.
6. Select a Member Number and Load Case and specify a Frac on Along Beam.

7. Click OK. The table is updated


8. (Op onal) To populate the table with different results, first clear all contents on the STAAD Results
Note: For more informa on on how to call AutoCAD commands in VBA, please refer to the AutoCAD VBA Help provided with AutoCAD.

You might also like