[MicroStation Connect Version 10.16.02.34] Draw and scale line

Hi community,

What would be your best way to scale a newly created line based on a user input?

I am thinking of creating a small program which let's the user input a *.txt file with coordinates from a point with old and new coordinates, draw a line between old and new coordinates (using the Application.CreateLineElement2 function) and then scale this newly line based on a user input

Assume the following:

  • User inputs a coordinate list. Format: Pointnumber, X_old, Y_old, Z_old, X_new, Y_new, Z_new
  • User is asked what scale shall be applied
  • Program then draws a line between XYZ_old to XYZ_new and then scales the line based on the user input. E.g. if the user inputs "500" the program shall scale this created line 500 times, with the origin on the XYZ_old coordinates.

I am not after the entire code itself at this stage. More about the ideas or say tools Microstation VBA has available? Are there functions available for 2D and/or 3D-scaling available?

Google hasn't found me something useful, neither the learning Microstation VBA handbook.

Thanks in advance

Parents Reply
  • Hi Marco. In MicroStation (and in any other software really), Lines have 2 points, a start and end point. A point element is actually a line element with length =0 , therefore a point element has its start and end points in the same location. Yongan’s example is creating a vector from a line’s start & end points by subtracting them, then scaling that vector by a scale factor. Try his sample code with a single line and you can compare the results doing the same with the scale tool and looking at the start and endpoint coordinates via the element properties or XYZ text.

Children