- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Problem:
I'm trying to get the minimum distance between 2 faces that are not aligned to the X,Y, or Z axes. Ultimately I'm trying to do this in an assembly, which means that the ilogic function for doing this does not work for my needs. see below for using the iLogic function in the assembly for this
In attempting to use the API to do this I am getting these results, where things work for the round face, but not for the square face. I assume the round face is getting the center points of the circular edges, but the square face is getting some other points.
How would I get the correct measurement for these sloped faces?
Dim Face1 As Face
Dim Face2 As Face
Dim oDoc As PartDocument
oDoc = ThisApplication.ActiveDocument
Face1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select Start Face:")
Face2 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter, "Select End Face:")
Dim Distance As Double
Distance = ThisApplication.MeasureTools.GetMinimumDistance(Face1.PointOnFace, Face2.PointOnFace,,,ClosestPointTwo)
Distance = oDoc.UnitsOfMeasure.ConvertUnits(Distance, "cm", "in")
MsgBox(Distance & " in",,"iLogic")
I've provided a 2023 example that demonstrates the issue. This example is a part, but I get the same results with this part in an assembly.
To see the issue open the part and run the rule. Then select the top and bottom face of the disc, and you will get 4 in, which is correct.
Do the same for the square shape and you get this result:
Solved! Go to Solution.