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

Manual project setup for Tool Palettes API in VS 2017 (ObjectARX 2020 and AutoCAD 2020)

23 REPLIES 23
Reply
Message 1 of 24
ShricharanaB
1427 Views, 23 Replies

Manual project setup for Tool Palettes API in VS 2017 (ObjectARX 2020 and AutoCAD 2020)

Hi, 

 

Can anyone tell me how to manually set up a project for Tool Palettes API with Object ARX and C++? 

 

The help website says "Select ObjectARX/DBX/OMF Project to launch the wizard."

But the templates created using ObjectARX wizards (with admin rights) are not working for me. They just repeat the same template selection window when I click ok.

I'm using AutoCAD 2020.

 

23 REPLIES 23
Message 2 of 24
tbrammer
in reply to: ShricharanaB

Check out the samples in

<ARX2020>\samples\editor\SimpleToolPalette_dg

<ARX2020>\samples\dotNet\SimpleToolPalette

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 3 of 24
ShricharanaB
in reply to: tbrammer

Hi @tbrammer

 

Thank you.

I'm going through the projects and I'm getting these errors and more like these. If I switch the project from x86 to x64, some cannot open errors disappear and some others #includes start showing the same error.

 

And MSXML error persists and the dll for it is not located in the project folder.  Could you please help?

ShricharanaB_0-1668594482571.png

ShricharanaB_1-1668596387827.png

 

Message 4 of 24
tbrammer
in reply to: ShricharanaB

acadi.h and the other headers are located in <ARX>\inc-x64  not in <ARX>\inc. 

It looks like you have to add <ARX>\inc-x64  to your project include paths. I recommend to put inc-x64 before inc.
Maybe this will already fix your problems.

AcImportXml.h looks basically like this:

#ifdef _ADESK_WINDOWS_
	#ifndef AC_DO_NO_IMPORT
		#import "msxml6.dll" named_guids rename_namespace("MSXML") rename("offset", "MSXMLoffset")
	#else // AC_DO_NO_IMPORT
		#include "msxml6.tlh"
	#endif
#endif // _ADESK_WINDOWS_

Do you have _ADESK_WINDOWS_ #define'd in your project?


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 5 of 24
ShricharanaB
in reply to: tbrammer

@tbrammer 

I switch the project from x86 to x64. Now I'm getting error for the below two and "acpi_i.h" (- no such file in directory). The rest of the #includes have no errors now. I did add inc x64 above inc folder,  that seems to have no impact.

ShricharanaB_0-1668599331069.png

And the mxsm16.dll missing error still persists in the AcImportXml.h . 

ShricharanaB_1-1668599414757.png

ShricharanaB_2-1668599510709.png

 

I'm just trying to compile the sample toolpallettes projects so I'm not sure if _ADESK_WINDOWS_ is defined or not. How do I go about checking that and defining if it is not? 

 

Message 6 of 24
ShricharanaB
in reply to: ShricharanaB

Hi @tbrammer 

So I managed to resolve the SimpleToolPalette_i.h issue. I copied the file from the project folder to inc folder or OARX. 

Now the individual .cpp files compile successfully. But when building the project I get the below errors. I'm not sure what I'm missing here. Could you please let me know what I'm missing. 

ShricharanaB_0-1668664125652.png

 

Message 7 of 24
tbrammer
in reply to: ShricharanaB

I suppose you need to link to AcTc.lib and/or AcTcUi.lib.


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 8 of 24
ShricharanaB
in reply to: tbrammer

I do have these added in the project settings. And the "C:\Autodesk\OARX\lib-x64" folder is added to the project library location as well.

ShricharanaB_0-1668673872929.png

 

Message 9 of 24
tbrammer
in reply to: ShricharanaB

Can you build the original <ARX>\samples\editor\SimpleToolPalette_dg\SimpleToolPalette.vcxproj project?
Maybe it helps to compare the project settings of this project and yours.

Regarding the IID_s you should especially compare the MIDL settings.

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 10 of 24
ShricharanaB
in reply to: tbrammer

All the above issues are with building the original project. I've not created another. Also I'll look into MIDL settings. 

Message 11 of 24
tbrammer
in reply to: ShricharanaB

Strange. I built the ARX2020 sample "out of the box" with no problems.

 

Are you using the right Visual Studio Version?

Visual Studio 2017 Update 2, 15.7.5 and earlier  / Platform Toolset = v141

 

Do you build the project in the <ARX>\samples subfolder or did you copy it to a different directory? In this case you might include wrong headers/libs.

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 12 of 24
ShricharanaB
in reply to: tbrammer

I've installed the following version. Will I have to re-install the 15.7.5 version? 

ShricharanaB_0-1668760117284.png

ShricharanaB_1-1668760180568.png

 

Message 13 of 24

@ShricharanaB 

I've checked with VS 2017 (15.9.51). Configuration Debug (also Release) x64 - no errors while build solution.

Відповідь корисна? Клікніть на "ВПОДОБАЙКУ" цім повідомленням! | 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 14 of 24

None of the samples seem to be building out of the box for me.

 

Message 15 of 24
tbrammer
in reply to: ShricharanaB

Not even a simple one like i.e. <ARX>\samples\database\curve_dg ?

 


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 16 of 24
ShricharanaB
in reply to: tbrammer

Just tried the Curve_dg. Failed to build. Not sure why these are missing

ShricharanaB_3-1668773393553.png

 

ShricharanaB_2-1668773359223.png

 

Message 17 of 24
tbrammer
in reply to: ShricharanaB

Looks like there is something missing or wrong in your VS installation.

 

On my system these headers are in C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt

This path is within the $(WindowsSDK_IncludePath) which is set in

Project settings->General->VC++ directories->include directories.

Note: I have only VS 2019 installed on my machine - but with the additional MSVC v141-VS 2017 C++ Buildtools.

This uses the Windows SDK 10. You might have/need a different Windows SDK 8.1. So paths may be different - i.e. C:\Program Files (x86)\Windows Kits\8.1\


Thomas Brammer ● Software Developer ● imos AGLinkedIn
If an answer solves your problem please [ACCEPT SOLUTION]. Otherwise explain why not.

Message 18 of 24
ShricharanaB
in reply to: tbrammer

This is the location for me where these header files are. and I don't

C:\Program Files (x86)\Windows Kits\10\Include\10.0.17763.0\ucrt

 

And I can see that the location is shown in the project settings. Still these headers are failing to open. 

ShricharanaB_0-1668830204064.png

 

I've attached the list of header files in that location. Not sure if something is missing. 

 

Note: The project I create anew and set up manually is working properly. I'm able to add commands and print in AutoCAD console. Just that the samples are not working out of the box. And I need to compile the tool palette samples to learn the tool palette API as I need to work on it. I tried to create a new project, set it up and then tried to copy the code from the sample project files to no avail. 

Message 19 of 24

Maybe when you installed VS, you didn't include some modules? I.e. MFC doesn't install by default in some cases

Python for AutoCAD, Python wrappers for ARX https://github.com/CEXT-Dan/PyRx
Message 20 of 24

I have installed MFC. Here is the currently installed modules. 

ShricharanaB_0-1668841588962.png

 

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

Post to forums  

Forma Design Contest


AutoCAD Beta