Hi,
Using : Microstation V8
OS : Windows
I want to know method to get POINT with inputs of Given POINT, ANGLE and DISTANCE in using Microstation VBA, I have searched Microstation VBA help, but could not find one, can you suggest in this.
Thanks & Regards,
(mmk)
Point3dAddAngleDistance is the answer I think
Sub get_Point() Dim given_Point As Point3d Dim point_At_Angle As Point3d given_Point = Point3dFromXYZ(1#, 1#, 2.2) ' Point3dAddAngleDistance Method ' Syntax: ' Point3d = Object.Point3dAddAngleDistance(point1, AngleRadians, DistanceXY, Dz) point_At_Angle = Point3dAddAngleDistance(given_Point, (Pi / 2), 5, 0) ' here Dz =0 Debug.Print "using Point3dAddAngleDistance :" Debug.Print "X= " & point_At_Angle.X & " " & "Y= " & point_At_Angle.Y & " " & "z= " & point_At_Angle.Z ' Result : ' using Point3dAddAngleDistance: ' X= 1 Y= 6 z= 2.2 End Sub
what is the use of Point3dFromAngleDistance?
the method Point3dFromAngleDistance is calculating a Point3D with a given distance and angle from the Origin (xyz=0,0,0).Here a small example how this could be used:
Dim pStart As Point3d Dim pEnd As Point3d Dim pAdd As Point3d pStart = Point3dFromXYZ(10, 20, 10) Debug.Print "Start:", pStart.X, pStart.Y, pStart.Z pAdd = Point3dFromAngleDistance(Pi / 4, Sqr(2), 10) Debug.Print "Add:", pAdd.X, pAdd.Y, pAdd.Z pEnd = Point3dAdd(pStart, pAdd) Debug.Print "End:", pEnd.X, pEnd.Y, pEnd.Z
Best regards,
Artur