.NET

.NET

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

PointPromptResult and Point2D Compatibility

143 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,767
Registered: ‎12-18-2002
Message 2 of 4 (140 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,607
Registered: ‎06-29-2007
Message 3 of 4 (139 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,767
Registered: ‎12-18-2002
Message 4 of 4 (114 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
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.