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

Extracting Y-values from coordinates. Csharp

1 REPLY 1
SOLVED
Reply
Message 1 of 2
Cald
412 Views, 1 Reply

Extracting Y-values from coordinates. Csharp

Good Day,

 

I'm writing a c sharp program in visual studio for autocad designed to calculate an invert level at a place the user clicks, then inserts a Level_Arrow block stating that level at the point they clicked. My current problem is I need ask the user to click on a base point, and then I need to extract only the Y value of those coordinates for use in my calculations.  

Does anyone know a method that will allow me to extract that value from the coordinates?

 

Please note I've experience with Lisp but very little experience with C sharp, if the answer could be as simple as possible and well explained I would be grateful.

 

Thank you,

1 REPLY 1
Message 2 of 2
_gile
in reply to: Cald

Hi,

 

The Point3d structure has a Y property.

Assuming you get the user picked point with the Editor.GetPoint() method.

 

PromptPointResult ppr = ed.GetPoint("\nPick a point: ");
if (ppr.Status == PromptStatus.OK)
{
    Point3d pt = ppr.Value;
    double yCoord = pt.Y;
    // do your stuff with yCoord
}

 



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

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