Difference between revisions of "Lines"

From Microstation VBA Wiki
Jump to: navigation, search
Line 21: Line 21:
 
ptEnd.Z = 0
 
ptEnd.Z = 0
 
</PRE>
 
</PRE>
 +
 +
==Line Characteristics==
 +
 +
Some settings are pretty easy, able to be set by changing active settings.

Revision as of 16:50, 4 August 2010

You can't just draw a line. Instead you have to create a line in memory and then write it to the DGN file. So in a subroutine, first you set up a variable that will hold an element.

Dim oMyLine As Element

Then you use a very long command to make a line (see below for more info):

Then you write the line to the DGN file:

But to create the line you need a start and end point. So you have to set up variables that can hold those points. A point consists of three pieces of data for the X, Y, and Z coordinates. So once the point is set up, you have to store X and Y values in there and set Z to 0 (I'm always doing 2D, but it seems to work better with 3D points):

Dim ptStart, ptEnd as point3d

ptStart.X = 10
ptStart.Y = 10
ptStart.Z = 0
ptEnd.X = 10
ptEnd.Y = 20
ptEnd.Z = 0

Line Characteristics

Some settings are pretty easy, able to be set by changing active settings.