Automatic Macros
Automatic macros are macros that are automatically run when certain events
happen within Autodesk Inventor. An automatic macro is like any other macro
except for its name. To create an automatic macro just name a macro so it
contains any of the automatic macro names. Depending on the name of the macro,
it will be automatically run by Autodesk Inventor if the associated event
occurs. Automatic macros are only supported within document projects. Macros
within the Application or a User Project that use the names below will be
ignored as far as running automatically.
Inventor identifies automatic macros by their names. For example the name for
the macro that will run automatically when the document is opened is "AutoOpen."
Autodesk Inventor allows some flexibility in this naming by only requiring the
string to be part of the macro name. For example, the following macro names will
be considered auto-open macros: AutoOpen1, AutoOpen2, NewAutoOpen, autoopen3, or
TestAutoOpen4. From these examples you can see that additional characters can
precede or be appended to the auto macro name. In addition, it is not
case-sensitive. Because of this flexibility you can create multiple automatic
macros for a single event. If there are multiple macros for an event, their
order of execution is arbitrary.
Autodesk Inventor runs automatic macros automatically whenever the associated
events occur. If the user presses the Shift key when the event occurs, the
automatic macro will not run. For example, if the user presses the Shift key
while opening a document that contains an AutoOpen macro, the macro will not
run.
- AutoOpen
- This macro is run automatically when the document it is contained within is
opened.
- AutoNew
- This macro is run automatically when a new document is created from a
template. For this macro to be used, it must exist within the template file.
- AutoSave
- This macro is run automatically whenever the document it is contained within
is saved.
- AutoClose
- This macro is run automatically whenever the document it is contained within
is closed.
- AutoEdit
- This macro is run when parts/sub-assemblies are opened or edited.