.NET

.NET

Reply
Valued Contributor
rick_hgy
Posts: 77
Registered: ‎04-13-2009
Message 1 of 5 (845 Views)

Problem using acedTrans for UCS to DCS in AutoCAD 2013

845 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*
_gile
Posts: 2,125
Registered: ‎04-29-2006
Message 2 of 5 (843 Views)

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
huaxiamengqing
Posts: 35
Registered: ‎05-23-2012
Message 3 of 5 (673 Views)

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
Andrey_Bushman
Posts: 33
Registered: ‎01-18-2009
Message 4 of 5 (258 Views)

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
Andrey_Bushman
Posts: 33
Registered: ‎01-18-2009
Message 5 of 5 (243 Views)

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
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.