.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Problem using acedTrans for UCS to DCS in AutoCAD 2013

4 REPLIES 4
Reply
Message 1 of 5
rick_hgy
2646 Views, 4 Replies

Problem using acedTrans for UCS to DCS in AutoCAD 2013

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

 

 

4 REPLIES 4
Message 2 of 5
_gile
in reply to: rick_hgy

Hi,

 

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



Gilles Chanteau
Programmation AutoCAD LISP/.NET
GileCAD
GitHub

Message 3 of 5
huaxiamengqing
in reply to: rick_hgy

thank very much!its exactly what l want!
Message 4 of 5

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);
    }

 

Message 5 of 5

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);

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost