EntitiesObserver in SU 2014
-
I just noticed that in SU 2014, the onElementAdded method from the EntitiesObserver class only fires when a single entity is added to the collection. In the past, it would fire once for each entity added to the collection, even if they were all added at one time. For example, if the rectangle tool was used, the observer would recognize five new elements - one right after the other - four edges and one face. In 2014, the observer does not fire at all when multiple elements are added at once. It does not fire when the rectangle tool is used or when multiple objects are pasted into the collection. Is there any work-around for this?
Is there any other way to detect new objects in a model - both simple (lines and faces) as well as complex objects such as groups and component instances?
Thanks!
-
Do you have reproducible steps and code snippet for us to test?
-
Hi TT,
I created a simple test code and... Everything worked fine. I am doing more investigation on my actual code and I know that the problem occurs when an entities collection has more than one entities observer. The observers are there to perform different functions, but I can probably move the analysis and execution elsewhere (outside the observer) to avoid whatever internal conflict is occurring.
If I am able to get a test script to recreate the problem, I'll post it.
By the way, the problem is not unique to SU 2014.
Karen
-
@kwalkerman said:
Is there any other way to detect new objects in a model ... groups and component instances?
Try the DefinitionObserver # onComponentInstanceAdded callback.
Advertisement