Community
Inventor Programming - iLogic, Macros, AddIns & Apprentice
Inventor iLogic, Macros, AddIns & Apprentice Forum. Share your knowledge, ask questions, and explore popular Inventor topics related to programming, creating add-ins, macros, working with the API or creating iLogic tools.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Point is equal to tolerance

3 REPLIES 3
SOLVED
Reply
Message 1 of 4
CAD_CAM_MAN
531 Views, 3 Replies

Point is equal to tolerance

CAD_CAM_MAN
Advocate
Advocate

How does the tolerance parameter work for a point object? The admapi info seems somewhat vague.

CAD_CAM_MAN_0-1635976527467.png

 

If I code as follows what should I expect?...

 

If Point1.IsEqualTo(Point2, 0.5) Then

       'Do Something incredible

End If

 

Will the above conditional evaluate to true if point1 is within 0.5cm of point2?

How does the tolerance work?

 

0 Likes

Point is equal to tolerance

How does the tolerance parameter work for a point object? The admapi info seems somewhat vague.

CAD_CAM_MAN_0-1635976527467.png

 

If I code as follows what should I expect?...

 

If Point1.IsEqualTo(Point2, 0.5) Then

       'Do Something incredible

End If

 

Will the above conditional evaluate to true if point1 is within 0.5cm of point2?

How does the tolerance work?

 

Tags (2)
Labels (1)
3 REPLIES 3
Message 2 of 4

SometimesInventorMakesMeAngry
Advocate
Advocate
Accepted solution

You are correct. Though I've programmatically created 2 points on the same coordinates in the past, and this method has failed with tolerance of 0. It has worked fine with 0.001" tolerance (about 0.025 mm). This might be OK depending on what you're doing.

0 Likes

You are correct. Though I've programmatically created 2 points on the same coordinates in the past, and this method has failed with tolerance of 0. It has worked fine with 0.001" tolerance (about 0.025 mm). This might be OK depending on what you're doing.

Message 3 of 4
WCrihfield
in reply to: CAD_CAM_MAN

WCrihfield
Mentor
Mentor
Accepted solution

Hi @CAD_CAM_MAN.  This is a good place for a good old fashioned test to prove/disprove the theory (because it is very easy to test).  My theory is that the tolerance is simply asking for a single numerical value (expecting a number with decimal places, but that may not be necessary) that the coordinates of the first point can be different from the coordinates of the second point and still pass or fail the test, depending on your purpose/need for the test.

For instance/example, you can use the following simple iLogic rule code to test this theory.

 

Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oP1 As Point = oTG.CreatePoint(1, 2, 3)
Dim oP2 As Point = oTG.CreatePoint(1.0001, 2.0001, 3.0001)
If oP1.IsEqualTo(oP2, .00001) Then
	MsgBox("They are Equal.", , "")
Else
	MsgBox("Then are not Equal.", , "")
End If

 

If ran exactly like this, it will return False (the two points are not equal - not within the specified tolerance).  However, if you eliminate 2 of the zeros between the decimal point and the 1 at the end, then run the rule again, the test returns True (the two points are now equal - within the specified tolerance).  In the case of this point object, think of the tolerance as a radius dimension around the original point that the second point is either within, or outside of.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS :light_bulb: or you can Explore My CONTRIBUTIONS

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes

Hi @CAD_CAM_MAN.  This is a good place for a good old fashioned test to prove/disprove the theory (because it is very easy to test).  My theory is that the tolerance is simply asking for a single numerical value (expecting a number with decimal places, but that may not be necessary) that the coordinates of the first point can be different from the coordinates of the second point and still pass or fail the test, depending on your purpose/need for the test.

For instance/example, you can use the following simple iLogic rule code to test this theory.

 

Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oP1 As Point = oTG.CreatePoint(1, 2, 3)
Dim oP2 As Point = oTG.CreatePoint(1.0001, 2.0001, 3.0001)
If oP1.IsEqualTo(oP2, .00001) Then
	MsgBox("They are Equal.", , "")
Else
	MsgBox("Then are not Equal.", , "")
End If

 

If ran exactly like this, it will return False (the two points are not equal - not within the specified tolerance).  However, if you eliminate 2 of the zeros between the decimal point and the 1 at the end, then run the rule again, the test returns True (the two points are now equal - within the specified tolerance).  In the case of this point object, think of the tolerance as a radius dimension around the original point that the second point is either within, or outside of.

 

If this solved your problem, or answered your question, please click ACCEPT SOLUTION.
Or, if this helped you, please click (LIKE or KUDOS) 👍.

If you want and have time, I would appreciate your Vote(s) for My IDEAS :light_bulb: or you can Explore My CONTRIBUTIONS

 

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

Message 4 of 4
CAD_CAM_MAN
in reply to: CAD_CAM_MAN

CAD_CAM_MAN
Advocate
Advocate

Thanks to responders for clarification. I suspected this was the case but was getting some unexpected results. Found the "real" issue and it is unrelated to my tolerance parameter setting.

0 Likes

Thanks to responders for clarification. I suspected this was the case but was getting some unexpected results. Found the "real" issue and it is unrelated to my tolerance parameter setting.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report