BIM Coordinator Program (INT) April 22, 2024
Find the next step in your career as a Graphisoft Certified BIM Coordinator!
Archicad C++ API
About Archicad add-on development using the C++ API.

Move/drag event

Anonymous
Not applicable
Hello!

I need to get move/drag operation beg and end coords. Couldn't find a way to get drag event or initialize drag. Any ideas ?
5 REPLIES 5
Ralph Wessel
Mentor
Rinovo wrote:
Hello!

I need to get move/drag operation beg and end coords. Couldn't find a way to get drag event or initialize drag. Any ideas ?
There are example add-ons bundled with the API to illustrate the use of many calls. For drag-drop operations, I suggest looking at Navigator_Test and searching for DGDragDropMsgData. You should find all the details your looking for in that data structure.
Ralph Wessel BArch
Anonymous
Not applicable
Thanks Ralph!

Will look into.
Anonymous
Not applicable
In navigator_test i can get drag operation in list view, didn't found what could suit me. I need to get move/drag operation when moving object and retrieve beg and end coords.


ACAPI_Notify_GetTranParams could be the one, but ..
*The transformation data is valid only between a APINotifyElement_BeginEvents and the following APINotifyElement_EndEvents notification.

..i don't know how to get these events.

EDIT: Hmmm... i might have found a way, will set up for a try.
Ralph Wessel
Mentor
Rinovo wrote:
ACAPI_Notify_GetTranParams could be the one, but ..
*The transformation data is valid only between a APINotifyElement_BeginEvents and the following APINotifyElement_EndEvents notification.

..i don't know how to get these events. .
Sorry, I misunderstood your question – I thought you meant drag-drop in the UI, e.g. list items. What you really want to do is track moving elements.

In order to get events for an element moving, you need to instruct ARCHICAD to notify you by calling ACAPI_Notify_InstallElementObserver. You also need to identify which elements should trigger a notification with ACAPI_Element_AttachObserver.
Ralph Wessel BArch
Anonymous
Not applicable
Thanks Ralph!

Got it working.

If i could initiate move/drag operation in project would be even better, but i guess there isn't structure for that.
Learn and get certified!