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

APIEnv_SetCurrent3DStyleID Error

Not applicable
I have Error This Source in Debug
(ArchiCAD 23 API / Windows / Visual Studio 2017 C++/Japanese)

Error Message / Code Stopped

GS::UniString curStyleName;
GS::Array <GS::UniString> StyleList;
GSErrCode err = ACAPI_Environment(
, &stylesNames
, &currentStyleName
GS::UniString u = StyleList[0];
err = ACAPI_Environment(
, &u
In the code you posted it seems that some variable names are inconsistent (curStyleName <-> currentStyleName, StyleList <-> stylesNames), but that might be fine depending on the context your code is in.

Anyway I also get the same error when running the function "Do_Edit3DStyles" from the API Example "Environment_Control".
When debugging it I saw, that it runs into the following assertion:
ODB assertion failed at P:\VMWD\Build\Sources\ObjectDatabase\ObjectDatabaseDll\Database\ODBDatabase.cpp 1275
    assert id: A9CF0419-32EB-4DEB-A7EB-73B9F6B82C7F
    description: can't open modification scope inside transaction (modification scope should be the outermost)
I then tried to wrap ACEnv_SetCurrent3DStyleID in ACAPI_CallCommand but that still gives the same error. I filled out a bit more detailed bug report for Graphisoft. In case I hear back from them I'll let you know.
Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website:
Not applicable
Thank You Your Answer.
Sorry, I missed My Variable Names in C++ Source.
But This Error is not caused by Variable Names.

I'm hoping in order to evade this error by your report.

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!