sketchucation logo sketchucation
    • Login
    πŸ€‘ SketchPlus 1.3 | 44 Tools for $15 until June 20th Buy Now

    Observer event BEFORE entity is deleted

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 1 Posters 166 Views 1 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.
    • thomthomT Offline
      thomthom
      last edited by

      I'm currently working on a plugin which makes cutout components cut double faces. What I'm doing is creating a cutout component for the opposite face.

      What I'm trying to do now is sync these two components. Currently, if I move one, the other moves with it. I have added a reference to each other by adding an attribute dictionary so that I can reattach the observes across sessions.

      However, when one is deleted, I'd like to move the other. But, when the onEraseEntity is fired the entity is already deleted and I can't access the attribute dictionary any more. Is there any way to be notified about the deletion of an entity before it's actually deleted?
      Or will I have to keep an extra hash which references the linked components?

      Thomas Thomassen β€” SketchUp Monkey & Coding addict
      List of my plugins and link to the CookieWare fund

      1 Reply Last reply Reply Quote 0
      • thomthomT Offline
        thomthom
        last edited by

        hrmm... I tried using an extra hash to keep a reference list. But as it turns out, the entity that onEraseEntity returns doesn't match the ones I've stored...

        Thomas Thomassen β€” SketchUp Monkey & Coding addict
        List of my plugins and link to the CookieWare fund

        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