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

How to change floor plan cut definition?

YONGWOO KIM
Participant

I want to change floor cut plan using api.

 

But it's not work.

 

 

API_FloorPlanCutDefinition floorPlanCutDefinition;
GSErrCode testErr = ACAPI_Environment(APIEnv_GetPreferencesID, &floorPlanCutDefinition, (void*)APIPrefs_FloorPlanCutPlaneDef);
floorPlanCutDefinition.currCutLevel += 1;
testErr = ACAPI_SetPreferences(1, sizeof(API_FloorPlanCutDefinition), &floorPlanCutDefinition);

 

 

testErr is 0. But current cut level is not changed.

1 ACCEPTED SOLUTION

Accepted Solutions
Solution
LChen
Graphisoft
Graphisoft

Hi,

Please try the following code on AC27(build5030) to see whether you can change the cur level.

HTH.

	GSErrCode err = NoError;
	API_FloorPlanCutDefinition prefs = {};

	err = ACAPI_ProjectSetting_GetPreferences( &prefs, APIPrefs_FloorPlanCutPlaneDef);
	if (err == NoError) {
		prefs.currCutLevel = newCutLevel;

		err = ACAPI_ProjectSetting_SetPreferences( &prefs, APIPrefs_FloorPlanCutPlaneDef);
	}

View solution in original post

2 REPLIES 2
Solution
LChen
Graphisoft
Graphisoft

Hi,

Please try the following code on AC27(build5030) to see whether you can change the cur level.

HTH.

	GSErrCode err = NoError;
	API_FloorPlanCutDefinition prefs = {};

	err = ACAPI_ProjectSetting_GetPreferences( &prefs, APIPrefs_FloorPlanCutPlaneDef);
	if (err == NoError) {
		prefs.currCutLevel = newCutLevel;

		err = ACAPI_ProjectSetting_SetPreferences( &prefs, APIPrefs_FloorPlanCutPlaneDef);
	}
LChen
Graphisoft
Graphisoft

Hi,

If you feel this is a good solution, please hit that “Accept as Solution” button. This helps others quickly find the answers. Thank you!