Beruflich Dokumente
Kultur Dokumente
Module1 Class1
Module2 Class2
Module3 Form1
Form2
Overview/mechanics of VBA
Overview/mechanics of VBA
Macros
shows only
Subs from
Modules Visual Basic
that have Editor (IDE)
no params Shows Projects
and contents:
Modules,
Classes, Forms
Immediate Window
Properties Window
Watches Window
Macros
List of all Public Subs (that have no params), in all Modules, from the Project(s) selected below
• Modules contain:
– Declarations (variables)
• Const pi = 3.14159265358979
• Private count As Integer
• Public oElement As Element
– Subroutines
• Sub subWithNoParams()
• Sub subWithParams(count As Integer, total As Integer)
• Methods
Things that we can do with the
object (i.e. functions we can call)
such as delete, copy, change size.
• Events
Notification that something
happened to our object. The object
was clicked on. The object was
moved. The object was deleted.
VB Objects Example
Properties (things that describe)
Color is silver
Receiver is red
Touch tone
Stationary
Text on screen
• Debugging
– Breakpoints, watch window, immediate window, etc.
Record an action
1 Switch to Model “Interaction”
2 Unload all VBA projects except the Default project in the VBA Project Manager.
5 Returning to MicroStation, select the Move Element tool from the Manipulate tool box
7 Place the element a distance from its original location. Be sure to move it in both the X and the Y direction.
(For this exercise the actual distance moved is not as important as the fact that you moved the object.)
• Element.ReWrite
– Save changes made to element