We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2023-03-23 02:54 AM
Hi.
I using vs 2019 with 2017 toolset and I use development kit 23.3006.
I write addon's dialogs but The setting buttons for pen , line, color using UserControl are only grayed out.
I followed DG_Test's example and Graphisoft's post, but it didn't work.
https://graphisoft.com/jp/solutions/workflows/build-your-own/archicadaddonapi/guide/usercontrol
Can you tell me what I need to modify?
----My Code------
#include "DGDefs.h"
'GDLG' 32500 Modal 40 40 400 160 "躯体中心線の一括配置"{
/* [ 1] */ Button 320 130 70 20 LargePlain "OK"
/* [ 2] */ Button 240 130 70 20 LargePlain "キャンセル"
/* [ 3] */ Icon 10 50 50 50 32500 //pic
/* [ 4] */ LeftText 150 10 20 13 LargePlain "a:" //text a:
/* [ 5] */ RealEdit 168 10 50 20 SmallPlain "500.0" "10000" //a pos:
/* [ 6] */ LeftText 240 10 20 13 LargePlain "b:" //text b:
/* [ 7] */ RealEdit 258 10 50 20 SmallPlain "500.0" "10000" //b pos:
/* [ 8] */ UserControl 150 40 180 30 261 0x0100 //Select Line
/* [ 9] */ PosIntEdit 150 80 30 21 SmallPlain "201" "300" //pen_int
/* [ 10] */ UserControl 210 80 33 19 257 0x0001 0x1100 0 //pen COLOR
/* [ 11] */ Separator 0 118 400 2 //区分
/* [ 12] */ UserControl 10 120 180 20 257 0x0006 0x0000 0 //Layer
}
2023-03-31 12:39 PM
Those user controls (Pen, LineType, Material, etc.) work in a special way, as they fetch their content through a callback function implemented in a higher level (ie. in AC or in the Attribute module).
These controls are in the UC.dll module which ArchiCAD depends on. UC does not know anything about ArchiCAD specific attributes and data structures. Whenever the popup is opened these UC controls call the data query callback (which is implemented in a higher (AC) level) to get the elements. This callback is set to the user controls while the dialog is initialized.
Please refer to these functions:
ACAPI_Interface_SetUserControlCallback
API_UserControlType
API_UCCallbackType