170 likes | 1.04k Views
VBA Project Manager. MicroStation Menu Command:Utilities->Macro->Project ManagerVBA Macros use mvba" file name extension.. MicroStation VBA Examples. Sample MVBA files found in folder:\Program Files\Bentley\Workspace\System\vba\examplesOther example sources:Bentley SelectBentley De
E N D
2. VBA Project Manager MicroStation Menu Command:
Utilities->Macro->Project Manager
VBA Macros use “mvba” file name extension.
3. MicroStation VBA Examples Sample MVBA files found in folder:
\Program Files\Bentley\Workspace\System\
vba\examples
Other example sources:
Bentley Select
Bentley Developer Network (BDN)
Upcoming MicroStation VBA Book
4. Where To Find Help MicroStation Readme File.
MicroStation VBA Help File.
Bentley Newsgroup: discussion.bentley.com
Bentley.microstation.v8.vba
Bentley Select Support
Bentley Developer Network
5. VBA is not compiled
VBA Protection is Limited (Google “VBA Crack”)
VBA meets .NET
Two Solutions Examined:
Move VBA to Visual Basic.
Native Mode MicroStation Programming VBA Limitations
6. Programming Style Programmer’s Buzz Words
Thick Client vs. Thin Client
Business Rules
N-Tier Programming Techniques
Object Oriented Programming
(VBA supports all of the above techniques)
7. Thick vs. Thin Clients A programmers view of code organization.
Thick Clients:
All computational code placed in with the Form.
Thin Clients:
Separate user interaction code from computation and Business Rules.
GUI displayed as Form, Web Page, etc. Examine TextExamples.mvba –
(C:\Program Files\Bentley\Workspace\System\vba\examples\ TextExamples.mvba )Examine TextExamples.mvba –
(C:\Program Files\Bentley\Workspace\System\vba\examples\ TextExamples.mvba )
8. Business Rules Collections of computational procedures placed in modules separate from the user interface code. For example:
Routines that might lookup data from tables when placing elements in a model.
Routines that scan a design file looking for elements with a certain level, color, weight criteria.
These modules may run outside of a VBA Macro.
9. N-Tier Programming Move logical grouping of code to separate modules.
Program modules could run on separate computers or all on the same.
VBA Forms run on local computer
Business Rules run on Department Server
Engineering Analysis Modules run on Engineering’s Server
Database code run on Database Server
10. Object Oriented Programming This opens up a world of possibilities…
Develop code around real world features.
Each feature is defined as a class with methods, properties, and events.
Design classes as if they’re experts whom you would ask questions from. (How many, how tall, what elevation, calculate volume, etc.)
11. VBA Conforms VBA Supports these programming techniques in stand-alone MVBA applications.
However:
New options emerge allowing Business Rules and Object Oriented code to become part of a compiled program using Visual Basic or other languages.
12. External Programs Stand-alone program (exe).
ActiveX component (dll).
Compiled programs hide your intellectual property from theft or unauthorized modifications.
13. COM Programming ActiveX components (EXE and DLL) are COM Objects.
Visual Basic, C/C++ and other languages are capable of building COM Objects.
14. VBA vs. VB.NET More Source Code Changes In Your Future?
Significant Changes to the Visual Basic language.
Rewrite VBA code to comply with .NET requirements.
Increased Object Oriented capabilities.
Using .NET Common Language Runtime (CLR)
15. MicroStation Native Mode Programming Visual C/C++ programming using Visual Studio
Use Visual C Debugger
Runs in same codespace as MicroStation
Can call MDL functions directly unlike VBA wrapper functions.
Compiled programs.
16. Native Mode Program Structure Executables:
Requires .MA file to load resources and identify .DLL program.
DLL program identified in .MA application.
Other Advantages:
Build custom key-in commands.
Access to internal MDL resources.
17. Geometric Technology VThompson@SomeoneKnows.com
Custom MicroStation VBA, MDL, and Native Mode Development.
Database Development
Bentley GeoGraphics Spatial Development.