sketchucation logo sketchucation
    • Login
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info

    Operations not commited

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