determine slope and y intercept of line '2. Public Const ZERO As Double = 0.00001 Public Const NO_SLOPE As Double = 999999999# Public Function IsPointOnLine(ByVal pt1X As Double, ByVal pt1Y As Double, _īyVal pt2X As Double, ByVal pt2Y As Double, _īyVal ptTestX As Double, ByVal ptTestY As Double) As Boolean Select Case True ' test for vertical line Case FloatEqual(pt1X, pt2X) IsPointOnLine = FloatEqual(pt1X, ptTestX) ' test for horizontal line Case FloatEqual(pt1Y, pt2Y) IsPointOnLine = FloatEqual(pt1Y, ptTestY) Case Else 'slope intercept equation 'y = mx + b '1. These can be placed in a separate module and included in any VBA or VB.Net project for any application platform. Notice that all of the arguments are Double values, no platform specific point or line data types are used. Here are a group of example functions used to determine if a point lines on a given line. These modules can then be easily included into VBA (or even VB.Net) projects on the various platforms.
#Onlinecivil net 2014 bentley microstation v8i code#
You will want to develop these in separate code or class modules using only base VBA data types. After you’ve been at it awhile you will eventually have the need to develop similar functions for each.
That’s the beauty of VBA, once you learn the language basics in say MicroStation, you can easily jump to developing applications in Excel, AutoCAD, or other platforms that support VBA. Once you begin writing VBA tools for one application you will probably expand to writing VBA tools for other applications as well.