Auto-detect View Overlap on IDW

Auto-detect View Overlap on IDW

Maxim-CADman77
Advisor Advisor
2,938 Views
21 Replies
Message 1 of 22

Auto-detect View Overlap on IDW

Maxim-CADman77
Advisor
Advisor

Can anyone share optimal algorithm for smart detecting View Overlap on IDW.

 

I guess firstly View Bounding Box need to be checked for overlapping (How?) .

Next (if Box overlapping is true) re-check to find real overlapping (point that belongs to visible objects of two different views). Again How?

 

My best expectation - detect View with real distance (between visible objects) less then given (let say 10mm).

 

Maybe there is some example of solving alike task with Inventor API shared already?

 

PS: I'm not happy with dumb "Overlapping Views" check that is built into Inventor Design Checker Free App (for subscribers) thus want to replace it with custom iLogic check.

Please vote for Inventor-Idea Text Search within Option Names

Accepted solutions (1)
2,939 Views
21 Replies
Replies (21)
Message 21 of 22

NachoShaw
Advisor
Advisor

i would definitely avoid that amount of For Next nested statements, any more than 1 are too many.

 

in vb.net i do this simply by creating a System.Drawing.Rectangle for each view using  the view points, width & height. Then its a simple check through a List(of Records) which is a records class holding the view name and rectangle in a list. i iterate through the list and check each rectangle.IntersectsWith(OtherRectangle). If they intersect, i raise a flag on the views and store them in a result table.

 

i also add the name of processed first view to a string list and condition to use only if the view is not in the list, then add the view name to the list after as a checked view.

 

this allows for 1 level nesting, minimal iterations and a fast completion time.

 

i'll try and get my code out over the weekend

 

 

 

 

Nacho
Automation & Design Engineer

Inventor automation Programmer (C#, VB.Net / iLogic)
Furniture, Sheet Metal, Structural, Metal fab, Tradeshow, Fabrication, CNC

EESignature


Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.


Message 22 of 22

SevInventor
Advocate
Advocate

Hi Maxim-Anatoljevich, and NachitoMax,

 

i know the code isn't very beautiful.

I figuered out that only on isometric views there are problems with.

ThisApplication.MeasureTools.GetMinimumDistance(CurveSegment, bCurveSegment)

 Sometimes it measures  0 even if the views don't touch.

Maybe it works using  proxies of the curve segments instead of measuring on the curve segments.

Another way to get the distance between curve segments from one view to the other would be vectors... But that's even more complicated because you need each point of each curve segment and create vectors to the other one.

0 Likes