sketchucation logo sketchucation
    • Login
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    🚨 Skimp | 25% Off until March 30 Buy Now

    Removing observers

    Scheduled Pinned Locked Moved Developers' Forum
    4 Posts 2 Posters 264 Views 2 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

      How do you remove observers? What is the argument to pass on?

      I've been using an entities observer to monitor the enitites of the active path. Whenever the path changes I need to remove the observers watchign the old path. But now?
      http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#remove_observer
      The example in the manual doesn't give much of a clue. Just says observers. I tried passing my Observer class, but that didn't do anything. The remove_observer method return false every time.

      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

        @tig said:

        http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#remove_observer ?

        That would be the same link I provided in my OP. It's not obvious to me what it does and what the observer is.

        I've tried to make store the return value when I do MyEntitiesObserver.new ( myTemp = MyEntitiesObserver.new )

        And then I try entities.remove_observer( myTemp ) and that returns true. But the old observers still triggers... 😞

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

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          http://code.google.com/apis/sketchup/docs/ourdoc/entities.html#remove_observer ?

          You need to pass the observer to the 'remove_'... You must have an entity_ or entities_observer ?

          TIG

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

            Ok. Found the problem. I was using model.active_path to cache the last path. When the last path was the model itself it'd return an empty array.

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

            1 Reply Last reply Reply Quote 0

            Hello! It looks like you're interested in this conversation, but you don't have an account yet.

            Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

            With your input, this post could be even better πŸ’—

            Register Login
            • 1 / 1
            • First post
              Last post
            Buy SketchPlus
            Buy SUbD
            Buy WrapR
            Buy eBook
            Buy Modelur
            Buy Vertex Tools
            Buy SketchCuisine
            Buy FormFonts

            Advertisement