Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

Can’t get the checked radiobutton

Anonymous
Not applicable
Hey,

I have 3 radio buttons in the same group. In the palette they look good - I can switch between them and the previous checked RadioButton will become unchecked..
But in the code I can’t get or change the status of them. DGselectradio doesn’t work.. also when trying to get the current checked radiobutton I always get 0 (with DGgetcheckedtadio or DGgetitemvallong).
Maybe there was a define or another function I should have called?

Thanks!
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Anonymous
Not applicable
I think it was a syntax mistake. Tried from scratch again and got it working. I think that maybe not using capital letter for my const short checkbox somehow made it stop working..
Also, when using DGGetItemValLong it worked when I uses dialogID but not when used DG_TOP_MODAL

Thanks everyone!

View solution in original post

8 REPLIES 8
Anonymous
Not applicable
Sorry - wrong post
Ralph Wessel
Mentor
Are you passing the ID of the radio group to DGGetCheckedRadio (as opposed to a control index)?
Ralph Wessel BArch
Anonymous
Not applicable
Ralph wrote:
Are you passing the ID of the radio group to DGGetCheckedRadio (as opposed to a control index)?
Yep. I set the ID of the group to 1 (and it’s working, the check is switched when checking between different radio buttons). And I’m passing 1 and it doesn’t work
Anonymous
Not applicable
I am ganerally unable to get the value of radiobuttons or slider bars.. if I try to use dggetvallong I always get 0..
Anonymous
Not applicable
Tomer1 wrote:
I am ganerally unable to get the value of radiobuttons or slider bars.. if I try to use dggetvallong I always get 0..
Does anyone have an idea?..
Ralph Wessel
Mentor
I can only say that it's working normally for us. If you post some source code, it might be possible to spot a reason for it not working in this case.
Ralph Wessel BArch
Akos Somorjai
Graphisoft
Graphisoft
Tomer1 wrote:
Hey,

I have 3 radio buttons in the same group. In the palette they look good - I can switch between them and the previous checked RadioButton will become unchecked..
But in the code I can’t get or change the status of them. DGselectradio doesn’t work.. also when trying to get the current checked radiobutton I always get 0 (with DGgetcheckedtadio or DGgetitemvallong).
Maybe there was a define or another function I should have called?

Thanks!
Could you please post some of your code here? Also, have you tried to use the C++ interface of DG?

Best, Akos
Solution
Anonymous
Not applicable
I think it was a syntax mistake. Tried from scratch again and got it working. I think that maybe not using capital letter for my const short checkbox somehow made it stop working..
Also, when using DGGetItemValLong it worked when I uses dialogID but not when used DG_TOP_MODAL

Thanks everyone!