Hi folks,
I found no solution to the following problem, maybe someone already solved it or can correct me.
Given a box with the top face selected.
'Edit sketch' is active.
IFace2 and ISurface objects of the top are available.
Given a point XYZ.
The goal is to project the point to the surface and get the proper values for CreatePoint2(x, y, z)
I got to the phase where the point is correcly projected onto the surface's plane. (x, y, z coordinates are correct)
I tried to give these values to CreatePoint2() No matter what the 'z' parameter was, the point was created on the surface's plane.
Then I tried to get 'u' and 'v' values for surface with ISurface.ReverseEvaluate() and tried CreatePoint2(u, v, 0). It was inconsistent.
For example on the top surface, x=-u, y=v, z=0 created the correct point, but this equation did not work on other sides.
I looked in the API help everywhere, and did not find info about the 'uv' vs. 'sketching plane' relations, not even a single transformation from one to another.
Finally I tried to turn off AutoSolve and AutoInference', same, no success.
In short:
If I have the x, y, z global coordinates for a point, which lays on the active sketching plane, how to create the point on that position?
I hope, something simple and elegant way exists to this problem.
Any help would be appreciated.
Thank you
SolidworksApi macros