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

AutoCAD 32bits and 64bits API

10 REPLIES 10
SOLVED
Reply
Message 1 of 11
FRPT1257
3464 Views, 10 Replies

AutoCAD 32bits and 64bits API

It will possible run the same application addin in both AutoCAD 32bits and 64bits?

 

For example, if the addin is developed in 32bits it will work in AutoCAD 64bits plataform?

Or it will be necessary create and compile 2 different addins?

 

For example in Inventor 2015 it will be possible compile the addin for both platforms and use the same addin in both Inventors (32bits and 64bits).

This is possible too for AutoCAD?

 

Thanks & Regards,

Rui

10 REPLIES 10
Message 2 of 11


@FRPT1257 wrote:

It will possible run the same application addin in both AutoCAD 32bits and 64bits?


Yes. But there are some restriction which prevent using one dll-file for both platform.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 3 of 11

What kind of restrictions?
I did an Addin with Inventor API and works perfect in both platforms.
Message 4 of 11


@FRPT1257 wrote:
What kind of restrictions?
I did an Addin with Inventor API and works perfect in both platforms.

For example, if you using third-party ActiveX/COM module which exist only for x86 but not for x64.

Also read: http://adndevblog.typepad.com/autocad/2012/06/where-did-my-interop-assemblies-go.html

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | Do you find the posts helpful? "LIKE" these posts!
Находите сообщения полезными? Поставьте "НРАВИТСЯ" этим сообщениям!
На ваше запитання відповіли? Натисніть кнопку "ПРИЙНЯТИ РІШЕННЯ" | Have your question been answered successfully? Click "ACCEPT SOLUTION" button.
На ваш вопрос успешно ответили? Нажмите кнопку "УТВЕРДИТЬ РЕШЕНИЕ"


Alexander Rivilis / Александр Ривилис / Олександр Рівіліс
Programmer & Teacher & Helper / Программист - Учитель - Помощник / Програміст - вчитель - помічник
Facebook | Twitter | LinkedIn
Expert Elite Member

Message 5 of 11

Yes. if you want use the same DLL for x86 or x64 dont use another dll. (on any CPU) for example :

if you have seven 32b with sqlserver ans another seven 64b witch sqlserver you cant have the same dll loaded in acad. the string connection is the same but you need to have code on x64 for x64 seven or x86 for seven x86.

 

you can but you need to install x86 install for sqlserver on the x64 seven. but i dunno if you can do that.

 

sqlserver is a example. i tryed to connect on a file XLS with a string connection (Database format) but i have to change the api and my code for this.)

Message 6 of 11
khoa.ho
in reply to: FRPT1257

Inventor .NET API uses COM/Interop (Autodesk.Inventor.Interop.dll) which is Any CPU. Any .NET plugin which is built as Any CPU and references Any CPU .NET assemblies should work for all platforms (x86 and x64).


AutoCAD .NET API uses targeted platform (x86 or x64) for accoremgd.dll, acdbmgd.dll and acmgd.dll, as they heavily use unmanaged objects from native AutoCAD DLLs (x86 or x64). Your .NET plugin is Any CPU and it can reference both x86 and x64 .NET assemblies. Therefore, it may work on both platforms (AutoCAD 32 bits and 64 bits).


The restriction happens when your .NET plugin references a non-.NET assembly such as ActiveX/COM which was compiled from C++, and targeted by either x86 or x64. If your plugin references x64 ActiveX control, it cannot work on x86 machine, and vice versa.


We cannot reference an ActiveX control created by .NET to .NET plugins. Therefore, third-party ActiveX/COM libraries use in .NET plugins are compiled from non-.NET languages such as C++, VB… Those libraries are really care about 32 bits or 64 bits.


I don’t have AutoCAD 32 bit to test my Any CPU .NET plugins yet, as it requires Windows 32 bit. I am not sure all Any CPU plugins can work on AutoCAD 32 bit. As this topic is interesting so I want to point some ideas for further discussion.


Khoa

Message 7 of 11
FRPT1257
in reply to: khoa.ho

Until now, in all tests I did my Addin and works well in both plataforms (x86 and x64).
My addin references are all to AutoCAD .DLLs and assemblies created by me.
Thanks & Regards.
Message 8 of 11
khoa.ho
in reply to: FRPT1257

Thank you to confirm that your Any CPU addins work well on both x64 and x86 platforms. That makes me confident that I can deliver my addins to both 32 bits and 64 bits machines.

 

As long as we take care of the target platform of the addin and all its references, it should avoid the problem of 32 and 64 bits at the end users.

 

Message 9 of 11
FRPT1257
in reply to: khoa.ho

The only issue is that I needed to compile 2 InstallPrograms. But this looks to be a VisualStudio limitation. All my Addin DLLs are the same for both platforms (compiled with “Any CPU” option), but since I have an install program I needed to compile one setup to x86 and other to x64.
Message 10 of 11
khoa.ho
in reply to: FRPT1257

You may try to use Inno Setup (free), Advanced Installer or InstallShield to have the mixed 32/64-bit all in one installer for two platforms.

 

Message 11 of 11
naywatcharapol
in reply to: khoa.ho

😀

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