2021-10-23 05:20 AM
I am using Archicad 23.
I want to get the settings from favorites, but I can't get the values of profile modifier.
How can I get/set the value of all or a specific profile modifier?
Please, help me.
Here is the code.
GSErrCode favtest() {
GSErrCode err = NoError;
API_Favorite fav = {};
fav.memo.New();
fav.name = "test";
ACAPI_Favorite_Get(&fav);
ACAPI_CallUndoableCommand("place element from favorite",
[&]() -> GSErrCode {
API_Element elem = fav.element;
err = ACAPI_Element_Create(&elem, &fav.memo.Get());
if (err != NoError) {
ACAPI_WriteReport(ErrID_To_Name(err), true);
}
ACAPI_DisposeElemMemoHdls(&fav.memo.Get());
return NoError;
});
return NoError;
}
2021-10-25 02:03 AM
Hi Arad
I think this is a bug / limitation. I came across this same issue years ago in v22, and it is still not working in v24.. Profile modifiers in favourites are not set when using the API..
I ended up just setting the modifiers manually using "ACAPI_Element_SetProperty"
The Property_Test example is a good place to start if you go down that route.
Hope this Helps..
2021-10-25 05:21 AM
Hi, Ben.
Thank you for your reply.
I see.
I will try with your method.
I hope we can use it soon.
Thanks for the help.