.NET

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

PointPromptResult and Point2D Compatibility

117 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,476
Registered: ‎12-18-2002
Message 2 of 4 (114 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,890
Registered: ‎06-29-2007
Message 3 of 4 (113 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,476
Registered: ‎12-18-2002
Message 4 of 4 (88 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
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

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

Ask the Community