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

[SOLVED] ACAPI_Element_GetMemo error: APIERR_REFUSEDCMD

Anonymous
Not applicable
Hello,

I am getting this error in my Addin: APIERR_REFUSEDCMD while attempting to get the Memo of Rooms(API_ZoneID), ONLY when I call my function from a managed WPF Control (mixed code).

Are there any locks happening automatically when the API is used without an ArchiCAD UI trigger? What could be the problem here? I am a little confused.

I have checked the GUIDs and they are unchanged as when I call the function from a Menu Command, also I can access all Informations at the "element.zone..." level and also the IFC Properties, just the memo throws this error.

I would be very glad to get some suggestions. Thanks in advance!

*DEVENV: Windows 10, VS2012, AC20
13 REPLIES 13
Anonymous
Not applicable
Thank you all for the replies, the Problem is for the Moment resolved. Do you consider this mechanism unadvisable even though the WPF Form will call exclusively read-only functions?

Is there some kind of Roadmap for further developing concurrency?
Akos Somorjai
Graphisoft
Graphisoft
mar_kq wrote:
Thank you all for the replies, the Problem is for the Moment resolved. Do you consider this mechanism unadvisable even though the WPF Form will call exclusively read-only functions?

Is there some kind of Roadmap for further developing concurrency?
Yes, because for example the main thread could be in the middle of a database transaction, where the internal state of the application is not consistent.
Also the API uses a few globals

We don't plan further development in this area at the moment, having two different solutions already (see my previous comment).

Best, Akos
Oleg
Expert
Hi Akos,

ACAPI_Command_CallFromEventLoop works but not so easy to use.
May be better to add one more thread safe function for easy using
Something like:
ACAPI_Register_CallFromEventLoop( CallbackProc* )
It will call the callback from the event loop
Akos Somorjai
Graphisoft
Graphisoft
Oleg wrote:
Hi Akos,

ACAPI_Command_CallFromEventLoop works but not so easy to use.
May be better to add one more thread safe function for easy using
Something like:
ACAPI_Register_CallFromEventLoop( CallbackProc* )
It will call the callback from the event loop
The reason why we chose this mechanism because it's already known for the API developers. Otherwise how would you implement data pass through from that thread to AC, and then back to the add-on from the main thread?

Best, Akos