Announcements

We are currently experiencing an issue impacting some Autodesk Products and Services - please refer to the Autodesk Health Dashboard for updates.

Traceboundary or...

Traceboundary or...

fieldguy
Advisor Advisor
1,373 Views
5 Replies
Message 1 of 6

Traceboundary or...

fieldguy
Advisor
Advisor

I need to find perpendicular distances from line work to a point.  It looks like I can use Traceboundary, but I need to know the best way to:

1) save the current layer status

2) freeze all layers except the layers the boundary objects are on 

3) get the polyline from traceboundary (I have this part already)

4) restore the user's layer status

 

Or, is there another way?  I looked at ray but I don't see how to implement the perpendicular part. 

 

In the attached image, I need to calculate the distances.

 

bdy.PNG

 

 

0 Likes
Accepted solutions (1)
1,374 Views
5 Replies
Replies (5)
Message 2 of 6

norman.yuan
Mentor
Mentor

In one of CAd tool I developed, I did something in the exactly the same steps as you described.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 3 of 6

norman.yuan
Mentor
Mentor

Oh, as for the perpendicular distance, you only need to find closed point on the each segment (between 2 vertices) to your point inside the polyline.

Norman Yuan

Drive CAD With Code

EESignature

0 Likes
Message 4 of 6

fieldguy
Advisor
Advisor
Accepted solution

I ended up using rays. i got the start from >>here<<.

 

the layer idea with trace boundary works but for me messing with users layers is not the best method.

 

i created an objectid collection of the lines for checking and kept track of the length - i needed the closest. create a 2 vertex polyline and get the closest point for the perpendicular distance.

 

the ray part of the code is attached (requires transaction tr). thx @norman.yuan

0 Likes
Message 5 of 6

ActivistInvestor
Mentor
Mentor

@fieldguy wrote:

I ended up using rays. i got the start from >>here<<.

 

the layer idea with trace boundary works but for me messing with users layers is not the best method.

 

i created an objectid collection of the lines for checking and kept track of the length - i needed the closest. create a 2 vertex polyline and get the closest point for the perpendicular distance.

 

the ray part of the code is attached (requires transaction tr). thx @norman.yuan


Sorry, but that doesn't make any sense.

 

If you already have the line, it is just a matter of calling GetClosestPointTo() to get the point on the line where it intersects a perpendicular line passing through the test point..

 

There are no rays needed.

0 Likes
Message 6 of 6

fieldguy
Advisor
Advisor

>>If you already have the line<<

 

i do not. i have a point and 100s of lines to test.

0 Likes