We value your input! Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey
2022-05-31 08:12 AM
Hi there,
I use "ACAPI_Notify_CatchNewElement" to catch the modify of the element.
ACAPI_Notify_CatchNewElement(nullptr, ElementEventHandlerProc);
ACAPI_Notify_InstallElementObserver(ElementEventHandlerProc);
When I change the material attribute which has already been used at current surface,the observer can't get change.
figure1 shows the material current use.
figure2 shows change material.
However, When I change the material's texture, I can't get the change in "ElementEventHandlerProc".
So how should I do can get the change?
Solved! Go to Solution.
2022-06-07 11:59 AM
Hi!
There are two different cases I can make out from your question:
1. Detect if some material changed. (Not possible with ElementObservers)
2. Detect if the material assignment of some element is changed. (You get a APINotifyElement_Change notification for this with ElementObservers)
I think you want case 1 correct?
I came up with a technique on how this might be possible. I use it for something else so I'm not 100% sure it works for this case as well. So try with care.
Here's a rough sketch:
- Make sure "Save each step" is enabled in the Data Safety settings of the AC Work Environment
- Use the Project Notification "APINotify_TempSave"
- Now you can check on every action whether your material changed (API_Attribute stuff)
- this now is triggered on almost any action in AC so be careful to not use to much time to decide whether to act on it!
Let me know if it works for you as well 🙂
2022-06-07 11:59 AM
Hi!
There are two different cases I can make out from your question:
1. Detect if some material changed. (Not possible with ElementObservers)
2. Detect if the material assignment of some element is changed. (You get a APINotifyElement_Change notification for this with ElementObservers)
I think you want case 1 correct?
I came up with a technique on how this might be possible. I use it for something else so I'm not 100% sure it works for this case as well. So try with care.
Here's a rough sketch:
- Make sure "Save each step" is enabled in the Data Safety settings of the AC Work Environment
- Use the Project Notification "APINotify_TempSave"
- Now you can check on every action whether your material changed (API_Attribute stuff)
- this now is triggered on almost any action in AC so be careful to not use to much time to decide whether to act on it!
Let me know if it works for you as well 🙂
2022-06-13 05:02 AM - edited 2022-06-13 05:49 AM
Hi bschwb,
Thanks a lot!
Forgive me leaving a long time to reply you.I try the method you post and it really works.