The community will undergo maintenance on October 16th at 10:00 PM PDT and will be unavailable for up to one hour.
While using ProSelectionDistanceEval on assembly cut surface ,creo crashes .
What can be other way to measure distance between surfaces in which one surface is assmebly cut surface.
Hi all,
There is no magic in distance calculation, the regular vector algebra: pseudocode: v=pt2-pt1; dist=sqrt(v*v);
The only question is how to determine which point belonging to one of surfaces to be used.
In the most simplistic case when a user' selection determines target measurement points, the application would need to get coordinates using ProSelectionPoint3dGet, transform those coordinates to inertia coordinate system using ProSelectionAsmcomppathGet and ProAsmcoppathTrfGet, and calculate the distance. If one of the surfaces is a plane then ProSelectionPoint3dGet, ProSelectionAsmcomppathGet and ProAsmcompTrfGet for both surfaces, for the planar surface ProSelectionModelitemGet, ProGeomitemToSurface, ProSurfaceXyzdataEval, convert extracted ProPoint3d and ProVector to inertia coordinate system, calculate a distance between a plane ( defined by a point and a normal) and a point. The similar approach could be used for other types of analytical surfaces as well.
HIH.
Feliks.