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!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download

    Operations not commited

    Scheduled Pinned Locked Moved Developers' Forum
    2 Posts 2 Posters 57 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
      algorytmus
      last edited by

      Hi all,

      I got a problem with committing an operation inside a sketchup plugin. To reproduce:

      ` model = Sketchup.active_model

      model.start_operation 'updateName'
      @some_component.name="newName"
      model.commit_operation

      model.start_operation 'hide_all_except'
      @some_component.instances[0].hidden = true
      model.abort_operation`

      Both operations are aborted.

      It is a simplification, there are more operations but none of them are model.*_operation related.
      What I am doing wrong?

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

        (1) It's easy to see why the 2nd op is aborted because you call model.abort_operation instead of committing it.

        (2) Perhaps some other plugin is also creating ops and "gluing" their's transparently between your 2 ops ??

        • I always disable all other 3rd party plugins when developing!* (But I leave the OEM Dynamic Components extension ON.)

        (3) Do yourself and us a big favor.. wrap your operations and trap any errors that cause the ops to abort.

        • See [Code] wrapping operations

        πŸ’­

        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