Choose your top Archicad wishes!

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

API: Settings panel to modify an object parameter

scottjm
Advisor

Hi All,

 

So I have attempted to dive into the world of API.  I'm managed to get over the hurdle of how to actually build the apx file, and have been trawling through the example files, but am still feeling very lost.

 

I am attempting to create a very simple API, that adds a panel to the Object Settings, that allows me to modify a Building Material parameter I have in an object.

 

I have been using the Panels_Test as the basis to start from and then found the attribute pickers in the DG_Test examples and have managed to get a panel with a 'picker', but I can't work how to associate that with a specific attribute type or parameter in the object.

scottjm_0-1658641620713.png

 

Snippets from my GRC:

 

'STR#' IDS_SETTINGSPAGE_NAME "Panel test settings page" {
/* [  1] */		"Panel test settings page"
}

...

'GDLG'  InfoBoxPageId  TabPage  0    0  160   36  "" {
/* [ 1] */ UserControl        12   20  188   20  257  0x0004  0x1100  0		/* Building Material control	*/
}

'DLGH'  InfoBoxPageId  DLG_InfoBoxPageId {
1	""							UC257_0
}

 

 

I have come across the ACAPI_​Interface_​CreateAttributePicker function,  in the API reference, which seems to be what I am looking for, but I can't see that having being used anywhere in the DG_Functions example to modify from.

 

Is someone able to point me in the right direction?

 

Thanks,

Scott

Scott J. Moore | Fulton Trotter Architects | BIM Manager, Associate, Architect
Since AC13 | Current versions AC23.7000 & AC26.5002 | BIMCloud Basic | Python, GDL, VBA, PHP, SQL, CSS
Certified Graphisoft BIM Manger (2022)
Win 10, i9-9900K, 32GB, Quadro P2200, 500GB NVMe
3 REPLIES 3

Hi Scott!

The function was added with AC26. It's used a few times in the "DG_Test" example project in the AC26 Devkit.

 

Edit: To clarify a bit further. I think what used to be defined via UserControls as an Item type is starting to change to use the new functions as introduced in AC26. If you want to use the "old" style attribute pickers, you can check out the examples in the older DevKits (<=AC25). Also for everything Dialog related, I highly recommend checking out the offline help which comes installed with the devkits. It includes more documentation on the DG functionality than the online help.

And to clarify further: There are 2 "styles" of handling Dialog stuff. The "older" C style (which is decently documented in the offline documentation.). This style uses Handlers and you need to register them.
As a contrast there's the "newer" C++ style which is less documented unfortunately. Here you create Classes/Objects for your Dialogs, Items etc. Instead of Handlers you work more with Event Observers.
It's a rough distinction but I hope it helps anyway.

 

Best, Bernd

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com
scottjm
Advisor

Thanks so much for your reply Bernd.  I'll check those ones out.

 

Do you know if the older style attribute picker still works on 26?  I was planning to develop for 25 but would prefer not to have to reinvent it again if that functionality has already been removed in 26.

 

Thanks,

Scott

Scott J. Moore | Fulton Trotter Architects | BIM Manager, Associate, Architect
Since AC13 | Current versions AC23.7000 & AC26.5002 | BIMCloud Basic | Python, GDL, VBA, PHP, SQL, CSS
Certified Graphisoft BIM Manger (2022)
Win 10, i9-9900K, 32GB, Quadro P2200, 500GB NVMe

I haven't tried it, but I'm pretty sure the old style attribute pickers would still work in AC26. The following points indicate so:
* Their removal is not mentioned in the changes for the AC26 devkit and I think such a big removal would be definitely mentioned there
* The AC26 DG_Test example still uses the old style in a few places
* The (offline) AC26 documentation still mentions the old style
* The relevant flags are still set in the AC26 Devkit/Modules/UCLib/UCDefs.h

 

Hope that helps,
Bernd

Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: Archi-XT.com