Got a minute? We appreciate your feedback:

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

Possible to add property definitions on project open/new?

Hi again,

Curious as to if I can create a few new property definitions from a project event, so all projects with the add-on will have these new properties to have their values set later on elements.

It seems the only hangup is that
needs undoable scope, but calling that command via CallUndoableCommand from any of the project events (ACAPI_Notify_CatchProjectEvent) causes a crash.

I assume this is explained here in the docs of CallUndoableCommand :
Add-ons may not call this function from their element database event handler callback, because those notifications are sent from within an existing database transaction."

Does this mean that its impossible to create properties from callbacks of project events? I have no issues creating properties from a CatchNewElement callback...


One other thing... Its strange that this causes a crash but creating a property group does not. I can successfully create a property group from a project open event just fine.

Ralph Wessel
I'm not certain whether this operation is supported during that notification, but there is an alternative solution. Take a look at the documentation for ACAPI_Command_CallFromEventLoop. Use this function to instruct ARCHICAD to call your add-on at a point when it is suitable to handle functions that might otherwise be context-sensitive. There is example code with the documentation.
Ralph Wessel BArch

Thanks! Really appreciate the help, seems I miss things in the docs all the time...

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!