.NET

Reply
*Expert Elite*
tcorey
Posts: 2,314
Registered: ‎12-18-2002
Message 1 of 4 (108 Views)

PointPromptResult and Point2D Compatibility

108 Views, 3 Replies
04-30-2012 11:54 PM

 

Dim ptll AsPromptPointResult 

Dim ptlr AsPoint2d       

 

ptll = acDoc.Editor.GetPoint(PrmtPointOpt)                                

ptlr = PolarPoints(ptll, 0, desFrameWid)

 

The code above creates a point called ptll using the GetPoint function. The code that creates ptlr wants a Point2d as its basepoint arguement, but ptll is a PromptPointResult and causes an error when I plug it in as basepoint.

 

Does anyone know how to convert a PromptPointResult into a Point2D?

 

TIA,

 

Tim

 

 

                            

Tim Corey, Owner
Delta Engineering Systems
Redding, CA
Autodesk Authorized Value-Added Reseller
*Expert Elite*
tcorey
Posts: 2,314
Registered: ‎12-18-2002
Message 2 of 4 (105 Views)

Re: PointPromptResult and Point2D Compatibility

05-01-2012 12:12 AM in reply to: tcorey

Never mind, I figured it out. I guess I should think just a little before posting.

 

To solve it, I created X,Y variables from the promptpointresult object and substituted those into the x,y values of a point2d object, and then used that as the basepoint.

 

 

Tim Corey, Owner
Delta Engineering Systems
Redding, CA
Autodesk Authorized Value-Added Reseller
*Expert Elite*
Alfred.NESWADBA
Posts: 8,511
Registered: ‎06-29-2007
Message 3 of 4 (104 Views)

Re: PointPromptResult and Point2D Compatibility

05-01-2012 12:14 AM in reply to: tcorey

Hi,

 

look to this (and don't forget to declare varaibles so you get the message of some issues at the moment you write your code!

 

'assuming you have the following statement on top of your codefile
Imports Autodesk.AutoCAD

Dim ptll as EditorInput.PromptPointResult ptll = acDoc.Editor.GetPoint(PrmtPointOpt) if ptll.Status = EditorInput.PromptStatus.OK then 'so we know the query for the point was not ESCaped dim pt as Geometry.Point3D = ptll.Value 'now you can goon

 

 

- alfred -

 

[EDIT] ok, to late [/EDIT]

-------------------------------------------------------------------------
Alfred NESWADBA
Ingenieur Studio HOLLAUS ... www.hollaus.at
-------------------------------------------------------------------------
*Expert Elite*
tcorey
Posts: 2,314
Registered: ‎12-18-2002
Message 4 of 4 (79 Views)

Re: PointPromptResult and Point2D Compatibility

05-01-2012 03:44 PM in reply to: tcorey

Thanks, Alfred.

Tim Corey, Owner
Delta Engineering Systems
Redding, CA
Autodesk Authorized Value-Added Reseller

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community