<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Cursor Coordinate Problems in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330284#M85068</link>
    <description>The ObjectARX and .NET API's are different. That is the reason we wanted this forum. Unfortunately Autodesk have blurred the line by packaging the .NET API documentation with the ObjectARX SDK and originally telling .NET API users to use the ObjectARX discussion group. Hopefully Autodesk will further help end this confusion by seperating the .NET API documentation and putting out material that explains they are different.&lt;BR /&gt;
&lt;BR /&gt;
Regards - Nathan</description>
    <pubDate>Thu, 19 May 2005 03:14:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2005-05-19T03:14:00Z</dc:date>
    <item>
      <title>Cursor Coordinate Problems</title>
      <link>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330283#M85067</link>
      <description>We are in the process of customizing the DockingPalette C# sample found in C:\ObjectARX 2006\samples\dotNet\DockingPalette. &lt;BR /&gt;
&lt;BR /&gt;
We are attempting to insert an entity into the database at the X,Y drawing coordinates where the user released the mouse button. We are able to retrieve the X,Y pixel coordinates from System.Windows.Forms.DragEventArgs, but have not found a way to translate those into X, Y coordinates useful for inserting an entity at an accurate spot on the drawing. In addition, we haven't found anyway to retrieve the current X, Y of the mouse position when we receive our drop event.&lt;BR /&gt;
&lt;BR /&gt;
Can anyone provide any guidance on either:&lt;BR /&gt;
&lt;BR /&gt;
A) translating System.Windows.Forms.DragEventArgs X,Y coords into World Coordinate or User Coordinate system X,Y values&lt;BR /&gt;
&lt;BR /&gt;
B) retrieving World Coordinate or User Coordinate system X,Y values for the current mouse position&lt;BR /&gt;
&lt;BR /&gt;
BTW, we're I'd like to thank whoever got a .NET forum setup. We're looking forward to a better repository of .NET knowledge for the ObjectARX api.</description>
      <pubDate>Thu, 19 May 2005 02:37:26 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330283#M85067</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T02:37:26Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Coordinate Problems</title>
      <link>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330284#M85068</link>
      <description>The ObjectARX and .NET API's are different. That is the reason we wanted this forum. Unfortunately Autodesk have blurred the line by packaging the .NET API documentation with the ObjectARX SDK and originally telling .NET API users to use the ObjectARX discussion group. Hopefully Autodesk will further help end this confusion by seperating the .NET API documentation and putting out material that explains they are different.&lt;BR /&gt;
&lt;BR /&gt;
Regards - Nathan</description>
      <pubDate>Thu, 19 May 2005 03:14:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330284#M85068</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T03:14:00Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Coordinate Problems</title>
      <link>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330285#M85069</link>
      <description>If the pros that program all day long have a hard time understanding this, &lt;BR /&gt;
us amateurs that dabble with it part-time are going nuts. So is that VB, &lt;BR /&gt;
dotnet, C#, C++ or VS?    Waitress, can I get another cup of coffee?&lt;BR /&gt;
&lt;BR /&gt;
Murph&lt;BR /&gt;
&lt;BR /&gt;
&lt;NATHAN taylor=""&gt; wrote in message news:4849966@discussion.autodesk.com...&lt;BR /&gt;
 Hopefully Autodesk will further help end this confusion by seperating the &lt;BR /&gt;
.NET API documentation and putting out material that explains they are &lt;BR /&gt;
different.&lt;BR /&gt;
&lt;BR /&gt;
Regards - Nathan&lt;/NATHAN&gt;</description>
      <pubDate>Thu, 19 May 2005 12:23:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330285#M85069</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T12:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Coordinate Problems</title>
      <link>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330286#M85070</link>
      <description>I've been calling the .NET APIs "ARX.NET" for lack of an official name.  I &lt;BR /&gt;
think ARX is/was for AutoCAD Runtime eXtension (maybe now it's "just three &lt;BR /&gt;
letters") which still makes sense for .NET.&lt;BR /&gt;
&lt;BR /&gt;
The line is somewhat blury because a .NET language like Managed C++ or &lt;BR /&gt;
C++/CLI can readily use both ARX.NET and ObjectARX.  Even VB.NET and C# can &lt;BR /&gt;
make limited use of ObjectARX through P/Invoke and COM Interop.&lt;BR /&gt;
&lt;BR /&gt;
Also, just as System.Windows.Forms is built on Win32, ARX.NET is largly &lt;BR /&gt;
built on ObjectARX.  Eventually, this will be just an "implementation &lt;BR /&gt;
detail" (and there will be new .NET-only functionality), but right now it &lt;BR /&gt;
can still be helpful to know Win32 and ObjectARX even if you're only using &lt;BR /&gt;
the .NET APIs.&lt;BR /&gt;
&lt;BR /&gt;
   Dan&lt;BR /&gt;
&lt;BR /&gt;
&lt;NATHAN taylor=""&gt; wrote in message news:4849966@discussion.autodesk.com...&lt;BR /&gt;
The ObjectARX and .NET API's are different. That is the reason we wanted &lt;BR /&gt;
this forum. Unfortunately Autodesk have blurred the line by packaging the &lt;BR /&gt;
.NET API documentation with the ObjectARX SDK and originally telling .NET &lt;BR /&gt;
API users to use the ObjectARX discussion group. Hopefully Autodesk will &lt;BR /&gt;
further help end this confusion by seperating the .NET API documentation and &lt;BR /&gt;
putting out material that explains they are different.&lt;BR /&gt;
&lt;BR /&gt;
Regards - Nathan&lt;/NATHAN&gt;</description>
      <pubDate>Thu, 19 May 2005 13:26:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330286#M85070</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-19T13:26:16Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Coordinate Problems</title>
      <link>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330287#M85071</link>
      <description>There's no first class .NET API to convert pixel to world coordinates and &lt;BR /&gt;
back. You will need to P/Invoke 2 C++ APIs to accomplish this. Here's how to &lt;BR /&gt;
do it:&lt;BR /&gt;
  public class ArxApi&lt;BR /&gt;
    {&lt;BR /&gt;
        [DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl, &lt;BR /&gt;
EntryPoint="?acedCoordFromPixelToWorld@@YAHHVCPoint@@QAN@Z")]&lt;BR /&gt;
        extern static bool acedCoordFromPixelToWorld(int viewportNumber, &lt;BR /&gt;
System.Drawing.Point pixel, out Autodesk.AutoCAD.Geometry.Point3d worldPt);&lt;BR /&gt;
&lt;BR /&gt;
        [DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl, &lt;BR /&gt;
EntryPoint="?acedCoordFromWorldToPixel@@YAHHQBNAAVCPoint@@@Z")]&lt;BR /&gt;
        extern static bool acedCoordFromWorldToPixel(int viewportNumber, ref &lt;BR /&gt;
Autodesk.AutoCAD.Geometry.Point3d worldPt, out System.Drawing.Point pixel);&lt;BR /&gt;
&lt;BR /&gt;
        [CommandMethod("testpix")]&lt;BR /&gt;
        public void Test()&lt;BR /&gt;
        {&lt;BR /&gt;
            Point3d pt = new Point3d(0,0,0);&lt;BR /&gt;
            System.Drawing.Point pix;&lt;BR /&gt;
            acedCoordFromWorldToPixel(0,ref pt,out pix);&lt;BR /&gt;
            Point3d res;&lt;BR /&gt;
            acedCoordFromPixelToWorld(0,pix,out res);&lt;BR /&gt;
        }&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;BR /&gt;
To convert between UCS and WCS you can use the transformation matrix &lt;BR /&gt;
returned by Editor.CurrentUserCoordinateSystem&lt;BR /&gt;
&lt;BR /&gt;
Albert&lt;BR /&gt;
&lt;BR /&gt;
&lt;TREI&gt; wrote in message news:4849962@discussion.autodesk.com...&lt;BR /&gt;
We are in the process of customizing the DockingPalette C# sample found in &lt;BR /&gt;
C:\ObjectARX 2006\samples\dotNet\DockingPalette.&lt;BR /&gt;
&lt;BR /&gt;
We are attempting to insert an entity into the database at the X,Y drawing &lt;BR /&gt;
coordinates where the user released the mouse button. We are able to &lt;BR /&gt;
retrieve the X,Y pixel coordinates from System.Windows.Forms.DragEventArgs, &lt;BR /&gt;
but have not found a way to translate those into X, Y coordinates useful for &lt;BR /&gt;
inserting an entity at an accurate spot on the drawing. In addition, we &lt;BR /&gt;
haven't found anyway to retrieve the current X, Y of the mouse position when &lt;BR /&gt;
we receive our drop event.&lt;BR /&gt;
&lt;BR /&gt;
Can anyone provide any guidance on either:&lt;BR /&gt;
&lt;BR /&gt;
A) translating System.Windows.Forms.DragEventArgs X,Y coords into World &lt;BR /&gt;
Coordinate or User Coordinate system X,Y values&lt;BR /&gt;
&lt;BR /&gt;
B) retrieving World Coordinate or User Coordinate system X,Y values for the &lt;BR /&gt;
current mouse position&lt;BR /&gt;
&lt;BR /&gt;
BTW, we're I'd like to thank whoever got a .NET forum setup. We're looking &lt;BR /&gt;
forward to a better repository of .NET knowledge for the ObjectARX api.&lt;/TREI&gt;</description>
      <pubDate>Fri, 20 May 2005 00:25:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330287#M85071</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-20T00:25:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Coordinate Problems</title>
      <link>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330288#M85072</link>
      <description>Hi Albert. &lt;BR /&gt;
&lt;BR /&gt;
Thanks for the great samples.&lt;BR /&gt;
&lt;BR /&gt;
Can we presume that System.Drawing.Point and CPoint are&lt;BR /&gt;
call-compatible types?&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Albert Szilvasy" &lt;NOT_PROVIDED&gt; wrote in message news:4851284@discussion.autodesk.com...&lt;BR /&gt;
There's no first class .NET API to convert pixel to world coordinates and &lt;BR /&gt;
back. You will need to P/Invoke 2 C++ APIs to accomplish this. Here's how to &lt;BR /&gt;
do it:&lt;BR /&gt;
  public class ArxApi&lt;BR /&gt;
    {&lt;BR /&gt;
        [DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl, &lt;BR /&gt;
EntryPoint="?acedCoordFromPixelToWorld@@YAHHVCPoint@@QAN@Z")]&lt;BR /&gt;
        extern static bool acedCoordFromPixelToWorld(int viewportNumber, &lt;BR /&gt;
System.Drawing.Point pixel, out Autodesk.AutoCAD.Geometry.Point3d worldPt);&lt;BR /&gt;
&lt;BR /&gt;
        [DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl, &lt;BR /&gt;
EntryPoint="?acedCoordFromWorldToPixel@@YAHHQBNAAVCPoint@@@Z")]&lt;BR /&gt;
        extern static bool acedCoordFromWorldToPixel(int viewportNumber, ref &lt;BR /&gt;
Autodesk.AutoCAD.Geometry.Point3d worldPt, out System.Drawing.Point pixel);&lt;BR /&gt;
&lt;BR /&gt;
        [CommandMethod("testpix")]&lt;BR /&gt;
        public void Test()&lt;BR /&gt;
        {&lt;BR /&gt;
            Point3d pt = new Point3d(0,0,0);&lt;BR /&gt;
            System.Drawing.Point pix;&lt;BR /&gt;
            acedCoordFromWorldToPixel(0,ref pt,out pix);&lt;BR /&gt;
            Point3d res;&lt;BR /&gt;
            acedCoordFromPixelToWorld(0,pix,out res);&lt;BR /&gt;
        }&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;BR /&gt;
To convert between UCS and WCS you can use the transformation matrix &lt;BR /&gt;
returned by Editor.CurrentUserCoordinateSystem&lt;BR /&gt;
&lt;BR /&gt;
Albert&lt;BR /&gt;
&lt;BR /&gt;
&lt;TREI&gt; wrote in message news:4849962@discussion.autodesk.com...&lt;BR /&gt;
We are in the process of customizing the DockingPalette C# sample found in &lt;BR /&gt;
C:\ObjectARX 2006\samples\dotNet\DockingPalette.&lt;BR /&gt;
&lt;BR /&gt;
We are attempting to insert an entity into the database at the X,Y drawing &lt;BR /&gt;
coordinates where the user released the mouse button. We are able to &lt;BR /&gt;
retrieve the X,Y pixel coordinates from System.Windows.Forms.DragEventArgs, &lt;BR /&gt;
but have not found a way to translate those into X, Y coordinates useful for &lt;BR /&gt;
inserting an entity at an accurate spot on the drawing. In addition, we &lt;BR /&gt;
haven't found anyway to retrieve the current X, Y of the mouse position when &lt;BR /&gt;
we receive our drop event.&lt;BR /&gt;
&lt;BR /&gt;
Can anyone provide any guidance on either:&lt;BR /&gt;
&lt;BR /&gt;
A) translating System.Windows.Forms.DragEventArgs X,Y coords into World &lt;BR /&gt;
Coordinate or User Coordinate system X,Y values&lt;BR /&gt;
&lt;BR /&gt;
B) retrieving World Coordinate or User Coordinate system X,Y values for the &lt;BR /&gt;
current mouse position&lt;BR /&gt;
&lt;BR /&gt;
BTW, we're I'd like to thank whoever got a .NET forum setup. We're looking &lt;BR /&gt;
forward to a better repository of .NET knowledge for the ObjectARX api.&lt;/TREI&gt;&lt;/NOT_PROVIDED&gt;</description>
      <pubDate>Fri, 20 May 2005 03:05:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330288#M85072</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-20T03:05:00Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Coordinate Problems</title>
      <link>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330289#M85073</link>
      <description>I don't have control over either of these types so I can't say whether this &lt;BR /&gt;
will be safe assumption forever but they are certainly bit by bit compatible &lt;BR /&gt;
right now.&lt;BR /&gt;
Same is true for Point3d and double[3], Point2d and double[2].&lt;BR /&gt;
&lt;BR /&gt;
Albert&lt;BR /&gt;
&lt;BR /&gt;
"Tony Tanzillo" &lt;TONY.TANZILLO&gt; wrote in message &lt;BR /&gt;
news:4851364@discussion.autodesk.com...&lt;BR /&gt;
Hi Albert.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the great samples.&lt;BR /&gt;
&lt;BR /&gt;
Can we presume that System.Drawing.Point and CPoint are&lt;BR /&gt;
call-compatible types?&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
http://www.caddzone.com&lt;BR /&gt;
&lt;BR /&gt;
AcadXTabs: MDI Document Tabs for AutoCAD 2004/2005/2006&lt;BR /&gt;
http://www.acadxtabs.com&lt;BR /&gt;
&lt;BR /&gt;
"Albert Szilvasy" &lt;NOT_PROVIDED&gt; wrote in message &lt;BR /&gt;
news:4851284@discussion.autodesk.com...&lt;BR /&gt;
There's no first class .NET API to convert pixel to world coordinates and&lt;BR /&gt;
back. You will need to P/Invoke 2 C++ APIs to accomplish this. Here's how to&lt;BR /&gt;
do it:&lt;BR /&gt;
  public class ArxApi&lt;BR /&gt;
    {&lt;BR /&gt;
        [DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl,&lt;BR /&gt;
EntryPoint="?acedCoordFromPixelToWorld@@YAHHVCPoint@@QAN@Z")]&lt;BR /&gt;
        extern static bool acedCoordFromPixelToWorld(int viewportNumber,&lt;BR /&gt;
System.Drawing.Point pixel, out Autodesk.AutoCAD.Geometry.Point3d worldPt);&lt;BR /&gt;
&lt;BR /&gt;
        [DllImport("acad.exe", CallingConvention = CallingConvention.Cdecl,&lt;BR /&gt;
EntryPoint="?acedCoordFromWorldToPixel@@YAHHQBNAAVCPoint@@@Z")]&lt;BR /&gt;
        extern static bool acedCoordFromWorldToPixel(int viewportNumber, ref&lt;BR /&gt;
Autodesk.AutoCAD.Geometry.Point3d worldPt, out System.Drawing.Point pixel);&lt;BR /&gt;
&lt;BR /&gt;
        [CommandMethod("testpix")]&lt;BR /&gt;
        public void Test()&lt;BR /&gt;
        {&lt;BR /&gt;
            Point3d pt = new Point3d(0,0,0);&lt;BR /&gt;
            System.Drawing.Point pix;&lt;BR /&gt;
            acedCoordFromWorldToPixel(0,ref pt,out pix);&lt;BR /&gt;
            Point3d res;&lt;BR /&gt;
            acedCoordFromPixelToWorld(0,pix,out res);&lt;BR /&gt;
        }&lt;BR /&gt;
    }&lt;BR /&gt;
&lt;BR /&gt;
To convert between UCS and WCS you can use the transformation matrix&lt;BR /&gt;
returned by Editor.CurrentUserCoordinateSystem&lt;BR /&gt;
&lt;BR /&gt;
Albert&lt;BR /&gt;
&lt;BR /&gt;
&lt;TREI&gt; wrote in message news:4849962@discussion.autodesk.com...&lt;BR /&gt;
We are in the process of customizing the DockingPalette C# sample found in&lt;BR /&gt;
C:\ObjectARX 2006\samples\dotNet\DockingPalette.&lt;BR /&gt;
&lt;BR /&gt;
We are attempting to insert an entity into the database at the X,Y drawing&lt;BR /&gt;
coordinates where the user released the mouse button. We are able to&lt;BR /&gt;
retrieve the X,Y pixel coordinates from System.Windows.Forms.DragEventArgs,&lt;BR /&gt;
but have not found a way to translate those into X, Y coordinates useful for&lt;BR /&gt;
inserting an entity at an accurate spot on the drawing. In addition, we&lt;BR /&gt;
haven't found anyway to retrieve the current X, Y of the mouse position when&lt;BR /&gt;
we receive our drop event.&lt;BR /&gt;
&lt;BR /&gt;
Can anyone provide any guidance on either:&lt;BR /&gt;
&lt;BR /&gt;
A) translating System.Windows.Forms.DragEventArgs X,Y coords into World&lt;BR /&gt;
Coordinate or User Coordinate system X,Y values&lt;BR /&gt;
&lt;BR /&gt;
B) retrieving World Coordinate or User Coordinate system X,Y values for the&lt;BR /&gt;
current mouse position&lt;BR /&gt;
&lt;BR /&gt;
BTW, we're I'd like to thank whoever got a .NET forum setup. We're looking&lt;BR /&gt;
forward to a better repository of .NET knowledge for the ObjectARX api.&lt;/TREI&gt;&lt;/NOT_PROVIDED&gt;&lt;/TONY.TANZILLO&gt;</description>
      <pubDate>Fri, 20 May 2005 04:15:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/cursor-coordinate-problems/m-p/1330289#M85073</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2005-05-20T04:15:55Z</dc:date>
    </item>
  </channel>
</rss>

