sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    EntitiesObserver in SU 2014

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 3 Posters 316 Views 3 Watching
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K Offline
      kwalkerman
      last edited by

      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!

      1 Reply Last reply Reply Quote 0
      • tt_suT Offline
        tt_su
        last edited by

        Do you have reproducible steps and code snippet for us to test?

        1 Reply Last reply Reply Quote 0
        • K Offline
          kwalkerman
          last edited by

          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

          1 Reply Last reply Reply Quote 0
          • Dan RathbunD Offline
            Dan Rathbun
            last edited by

            @kwalkerman said:

            Is there any other way to detect new objects in a model ... groups and component instances?

            Try the DefinitionObserver # onComponentInstanceAdded callback.

            I'm not here much anymore.

            1 Reply Last reply Reply Quote 0
            • 1 / 1
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement