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

    Something about AppObserver#onQuit

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 4.6k 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.
    • A Offline
      azuby
      last edited by

      Hi folks,

      I'm working on a new Ruby extension. Because there is no AppObserver#onSave method, I use onQuit instead. But there seems to be a problem calling methods from your own class in onQuit. You can't call Sketchup.active_model - that seems clear, because if you quit, there is no active model any longer. But you also can't use, say, an instance variable, where you saved the active model to when it was opend. First I thought "OK, I use an instance variable and do some cleanup at the end of the Sketchup session with this 'old' model" So I call another method within my class from onQuit and there a third method is called within my class with the variable as an argument. This call causes a Bug Splat 😢

      onQuit > m1 > m2(@var)

      I've checked it with some output - Sketchup isn't able to call m2. I have a checkpoint before, in and after the method. Only the checkpoint before is passed.

      Sketchup 6.0.277

      azuby

      *error initus :: Blocks | CurrentDate | d/Code | extensionmanager | FFlipper | HideEdges | MeasuredArea | ModelHistory | PluginsHelp | PronButton | SAWSO | SCP | SU²CATT

      Bad English? PM me, correct me. :smile:**

      1 Reply Last reply Reply Quote 0
      • R Offline
        RickW
        last edited by

        Sorry I'm no help - have not tried that observer yet. The onSave observer has been requested, and noted by the SU folks, so maybe we'll get that one soon...

        RickW
        www.smustard.com

        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