.NET

.NET

Reply
Valued Contributor
77 Posts
0 Kudos
Registered: ‎04-13-2009
Post 1 of 5

Problem using acedTrans for UCS to DCS in AutoCAD 2013

866 Views, 4 Replies
04-11-2012 11:10 PM

Dear All,

 

We using acedTrans function in AutoCAD 2012 and previous version, and it worked fine.

 

[DllImport("acad.exe", CallingConvention=CallingConvention.Cdecl, EntryPoint="acedTrans")] static extern int acedTrans(double[] point, IntPtr fromRb, IntPtr toRb, int disp, double[] result);

 

Kean had a post introduct this code: http://through-the-interface.typepad.com/through_the_interface/2007/10/plotting-a-wind.html

 

but after we migrate it to AutoCAD 2013, there is a error message:  Unable to find an entity point named 'acedTrans' in dll 'acad.exe'

 

We can't find the reference sample from the objectARX for 2013 version, it's any change for 2013?

 

Thanks!

 

Rick

 

 

*Expert Elite*
2,141 Posts
254 Kudos
Registered: ‎04-29-2006
Post 2 of 5

Re : Problem using acedTrans for UCS to DCS in AutoCAD 2013

04-11-2012 11:25 PM in reply to: rick_hgy

Hi,

 

Try replacing "acad.exe" with "accore.dll".

Gilles Chanteau
Active Contributor
35 Posts
0 Kudos
Registered: ‎05-23-2012
Post 3 of 5

Re: Problem using acedTrans for UCS to DCS in AutoCAD 2013

10-10-2012 07:44 PM in reply to: rick_hgy
thank very much!its exactly what l want!
Active Contributor
33 Posts
3 Kudos
Registered: ‎01-18-2009
Post 4 of 5

Re: Problem using acedTrans for UCS to DCS in AutoCAD 2013

06-10-2014 12:15 PM in reply to: huaxiamengqing

Additional info for AutoCAD 2015.

 

Its name is _acedTrans in AutoCAD 2015 x86, and acedTrans in AutoCAD 2015 x64. So, as a variant:

 

#if AUTOCAD_NEWER_THAN_2012
    const String acedTransOwner = "accore.dll";
#else
    const String acedTransOwner = "acad.exe";    
#endif
 
#if AUTOCAD_NEWER_THAN_2014
    const String acedTrans_x86_Prefix = "_";
#else
    const String acedTrans_x86_Prefix = "";
#endif
 
    const String acedTransName = "acedTrans";
 
    [DllImport(acedTransOwner, CallingConvention = CallingConvention.Cdecl,
            EntryPoint = acedTrans_x86_Prefix + acedTransName)]
    static extern Int32 acedTrans_x86(Double[] point, IntPtr fromRb, 
      IntPtr toRb, Int32 disp, Double[] result);
 
    [DllImport(acedTransOwner, CallingConvention = CallingConvention.Cdecl,
            EntryPoint = acedTrans_x86_Prefix + acedTransName)]
    static extern Int32 acedTrans_x64(Double[] point, IntPtr fromRb, 
      IntPtr toRb, Int32 disp, Double[] result);
 
    public static Int32 acedTrans(Double[] point, IntPtr fromRb, IntPtr toRb,
      Int32 disp, Double[] result) {
        if(IntPtr.Size == 4)
          return acedTrans_x86(point, fromRb, toRb, disp, result);
        else
          return acedTrans_x64(point, fromRb, toRb, disp, result);
    }

 

_________________________________________
AutoCAD .Net Laboratory
Active Contributor
33 Posts
3 Kudos
Registered: ‎01-18-2009
Post 5 of 5

Re: Problem using acedTrans for UCS to DCS in AutoCAD 2013

06-10-2014 01:34 PM in reply to: Andrey_Bushman

Misprint for acedTrans_x64. This is right:

 

[DllImport(acedTransOwner, CallingConvention = CallingConvention.Cdecl,
            EntryPoint = acedTransName)]
    static extern Int32 acedTrans_x64(Double[] point, IntPtr fromRb, 
      IntPtr toRb, Int32 disp, Double[] result);

 

 

_________________________________________
AutoCAD .Net Laboratory
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!