How to check if a ployline is in another polyline?

How to check if a ployline is in another polyline?

Anonymous
Not applicable
931 Views
8 Replies
Message 1 of 9

How to check if a ployline is in another polyline?

Anonymous
Not applicable

Please advise me:

I want to check, if a polyline is enclosed in another polyline or not?

I want to dimension the outer most closed polyline.

P.S. all polylines are closed.

0 Likes
932 Views
8 Replies
Replies (8)
Message 2 of 9

3wood
Advisor
Advisor

You can create 2 REGIONs from 2 closed polylines.

The use SUBTRACT to minus the Large Region from the Small Region.

If there is nothing left, it means the small polyline is inside the larger polyline.

0 Likes
Message 3 of 9

Anonymous
Not applicable

through VBA, I’m getting x & y’s of only one polyline at a time which I want to check if it is enclosed inside another polyline or not.

 I haven’t any other thing from which I can compare two different/similar polylines.

0 Likes
Message 4 of 9

3wood
Advisor
Advisor

Method of checking if all vertex are inside another polyline only valid in Convex Polygons.

It doesn't work in Concave Polygons. See scenario below.

Capture5.JPG

Message 5 of 9

Anonymous
Not applicable

My scenario is simpler than that. All vertices of smaller/enclosed polylines will always be inside the bigger/outer polyline.
But same questions again, How to find, if polyline is inside or it is the outer-one?

tagohar_0-1632827724106.png

 

0 Likes
Message 6 of 9

3wood
Advisor
Advisor

Second approach is using the polyline vertex of Polyline A to make a WP selection. If Polyline B is in the selection, then Polyline B is inside Polyline A. 

 

Message 7 of 9

Anonymous
Not applicable

I am exactly using this (Second Option), Now the problem I am facing is that when Polyline is empty inside, my code fails there. Assume a Square/Rectangle and nothing inside, just one polyline.

0 Likes
Message 8 of 9

Anonymous
Not applicable
I think you are right, I need to work through regions, Need to convert each entity into regions and then check if they are intersecting?
Probably that's the way.
0 Likes
Message 9 of 9

MakCADD
Advocate
Advocate

draw a ray from the vertex of inner polyline

if the number of intersection is an odd number 

then it is inside the polyline.

and the two polylines intersect each other then it not inside the polyline

0 Likes