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:
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
Marco W said:What would be your best way to scale a newly created line? Google hasn't found me something useful, neither the learning MicroStation VBA handbook.
Scaling, movement and rotation are provided by a higher-level mathematical concept called transformation. The data for a transformation are conveyed in a VBA User Defined Type (UDT) called either Transform3d or Matrix3d. There are many methods you can apply to both those UDTs to construct a transformation. More info here.
Transform3d
Matrix3d
Once you have a transform filled with data, use it with any element by applying Element.Transform.
Element.Transform
Regards, Jon Summers LA Solutions
Answer Verified By: Marco W
Hi Jon, thanks for your input. Need to get my head around the matrix itself, initially thought just put in the numbers but as you write on your linked page not a great idea to do so