Find the next step in your career as a Graphisoft Certified BIM Manager!

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

How do I get/set profile modifier?

arad
Participant

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;
}

 

2 REPLIES 2
Ben Cohen
Enthusiast

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..

 

Ben Cohen
Mac and PC
Archicad (Latest Version) aus
www.4DLibrary.com.au

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.