.NET

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

PointPromptResult and Point2D Compatibility

142 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,716
Registered: ‎12-18-2002
Message 2 of 4 (139 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: 9,417
Registered: ‎06-29-2007
Message 3 of 4 (138 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,716
Registered: ‎12-18-2002
Message 4 of 4 (113 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!