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

    Something about AppObserver#onQuit

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 4.5k 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](http://www.smustard.com)

        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