Choose your top Archicad wishes!

Read more
Archicad C++ API
About Archicad add-on development using the C++ API.

Custom panels

Anonymous
Not applicable
I've been poring over the panel_test example, and looking over some previous posts on adding custom panels.

http://archicad-talk.graphisoft.com/viewtopic.php?p=14581
http://archicad-talk.graphisoft.com/viewtopic.php?p=17180

I understand the panel_text example well enough to have added a panel for the type of element I'm interested in. I'm having two problems:

1- The width is...very wide. Several screens wide at 1280x1024. Even after unloading the add-on. The only way to reset the panel's width is to start a new project with default settings. I used the same dimensions in my resource file that the panel_test example uses(in fact, it's still the same dialog resource spec entirely):
0 0 444 50
x y dx dy

2-I think I've run into a variation of the bug spoken of in the first thread above. If I load an Add-On with a custom settings panel, it shows. If I exit AC and come back, it will not be visible for the elements until I unload and then reload the Add-On. I know it was initialized, though, because of my breakpoints and the fact that the Add-On's menu shows up. Obviously, I can't require users to unload and reload the Add-On each time they start AC.

Can anyone comment on using DGCreateBlankTabPage to create non-resource based panels? There are no examples of this much more flexible method of doing panels.

Given the difficulty of working with dialogs in the SDK, is it perhaps better to sacrifice cross-platform compatibility and use the dialog designer in Visual Studio? As much as I like the idea of the add-on working on both, the reality is that it will only be used on Windows at present. The downside would be that it doesn't look like part of AC...

One last thing to dev support subscribers: is the paid support from GS able to really help with issues like this, or are they just limitations of the SDK whether you have support or not? The users here seem very knowledgeable, so I'm wondering if there are extra examples or documentation to be had by subscribing.
3 REPLIES 3
Anonymous
Not applicable
Well, just to update in case anyone else runs into any of this....

I figured out problem #1. I missed an include in my resource def file that had all my resource IDs defined. Oddly, when the panel class was instantiated it said something like DG::TabPage (tabControl, 1, MyPanelId). Starting a tabPage can use 3 or 4 params. If 3 the last is supposed to be the resource ID; if 4, then the width and height. I only passed 3 but because my resources weren't defined quite right in the GRC it still used 37520 as the width! A little too large.

Starting to appreciate the DG manager, just takes some getting used to for someone with a C#/VB/Java background. Not exactly 'Visual'. 😉

Still can't get add-ons to load custom panels without unloading and reloading using the add-on manager...
Akos Somorjai
Graphisoft
Graphisoft
Ramblin wrote:
Starting to appreciate the DG manager, just takes some getting used to for someone with a C#/VB/Java background. Not exactly 'Visual'. 😉
I'm glad to hear that
Ramblin wrote:
Still can't get add-ons to load custom panels without unloading and reloading using the add-on manager...
Are you in AC 9? Then try to add the add-on's panel to the element settings dialog through the Work Environment dialog.

Regards,

Akos
Anonymous
Not applicable
Thanks Akos, that seems to have fixed it.

I do have AC9. When I first loaded the add-on the panel showed up correctly, but in the work environment it had the 'hidden' icon by my panel. So I guess it showed then because I'd just loaded it, but by default was hidden for future sessions?

At any rate, thank you for your insight. Glad to have that nagging little issue taken care of.