cancel
Showing results for 
Search instead for 
Did you mean: 
EN
cancel
Showing results for 
Search instead for 
Did you mean: 
arad
Contributor

How do I get/set profile modifier?

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
Advocate

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
arad
Contributor

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.

Didn't find the answer?

Check other topics in this Forum

Back to Forum

Read the latest accepted solutions!

Accepted Solutions

Start a new conversation!