.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

GetEntity and UCS

2 REPLIES 2
SOLVED
Reply
Message 1 of 3
Anonymous
784 Views, 2 Replies

GetEntity and UCS

I have a program that asks a user to select an entity and then returns data on it.  Everything works great as long as the UCS is set to world.  However, I'm trying to bulid an app that will provide data to my other programs in all real world situations.

 

I have attached a basic autocad drawing with a 2d polyline which was created in the WCS.  The view of the drawing is rotated to some random setting, and the ucs is set to the view.  When I select a point on the polyline, it does not always return the segment I selected.  For example, if you click left of the label on the far right line, it returns data for the curve adjacent to it.

 

I'm using the GetClosestPointTo() method and currently telling it to use the current view's diretion.  I don't think this is right, as it shouldn't be based on the view, it should be based on the current UCS, however I'm not sure how to proceed to get a vector that will relate the current coordinates (which are in the  current ucs) to the polyline, which also appears to be in the current ucs, but the method being called doesn't reliably return the segment picked.

 

I have attached my code and test drawing, if anyone has time please take a look at it and let me know what I'm missing here.

 

Line #139 is where the polyline method GetClosestPointTo() is called and where I suspect the issue is.

 

Thanks for the help.

-Mark P.

2 REPLIES 2
Message 2 of 3
kdub_nz
in reply to: Anonymous

 

Is the point passed to GetClosestPointTo() in UCS or WCS ??

WCS coordinates are expected.


// Called Kerry in my other life.

Everything will work just as you expect it to, unless your expectations are incorrect.

class keyThumper<T> : Lazy<T>;      another  Swamper

Message 3 of 3
Anonymous
in reply to: kdub_nz

I actually had tried passing both the UCS and WCS point to the method, but when I passed the WCS point to it, I didn't pass the curent view direction.  When passing world coordinates and view direction it works perfectly.

 

Thanks for the help.

 

-Mark P.

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

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost