Message 1 of 13
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I found the code below, and if I have used an insert constrain and set 2 parts 100 in apart, this code does not give the correct value. I need something to where I can choose the 2 faces and then get the actual face to face measurements. Thanks in advanced!
Dim Face1 As Object Dim Face2 As Object Dim oDoc As AssemblyDocument oDoc = ThisApplication.ActiveDocument Face1 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter,"Select Start Face1 to measure distance:") 'MsgBox("Face area1: " & Face1.Evaluator.Area & " cm^2") Face2 = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceFilter,"Select End Face2 to measure distance:") 'MsgBox("Face area: " & Face2.Evaluator.Area & " cm^2") Dim Distance As Double 'Distance = Face1.PointOnFace.DistanceTo(Face2.PointOnFace) Distance = ThisApplication.MeasureTools.GetMinimumDistance(Face1.PointOnFace, Face2.PointOnFace) MsgBox( Distance & " cm") Distance = oDoc.UnitsOfMeasure.ConvertUnits(Distance, "cm", "in") MsgBox (Distance & " in")
Autodesk Certified Professional
Solved! Go to Solution.