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

    SU 2017 anything new in the Ruby API?

    Scheduled Pinned Locked Moved Developers' Forum
    5 Posts 4 Posters 639 Views 4 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.
    • PixeroP Offline
      Pixero
      last edited by

      Is there anything new in the Ruby API for SketchUp 2017?

      I'm hoping for opening groups and components...

      1 Reply Last reply Reply Quote 0
      • K Offline
        kaas
        last edited by

        I just noticed the documentation has been changed. More easy to search for stuff. @Pixero - I don't see anything new in the Group section (yet):
        http://ruby.sketchup.com/Sketchup/Group.html

        Api changes here:
        http://ruby.sketchup.com/file.ReleaseNotes.html

        1 Reply Last reply Reply Quote 0
        • placidfuryP Offline
          placidfury
          last edited by

          There have definitely been changes, I just can't find a list of what they are - my in-house plugin I've been using and coding for almost 2 years got totally busted by 2017. I'm getting all kinds of errors, including in some simple code operations that I wouldn't have expected changes in... kind of bummed. Now I'm going to have to figure it all out and fix... dang.
          Does anyone have a list anywhere of the API changes?

          As an example, one of my many tools is a shortcut to scoot objects around. It iterates through the selection, adding each entity to an array. Then, it groups them together, moves the group, then explodes the group. The grouping/ungrouping forces a deselection, so then I use selection.add(array) to re-select the original selection. SU 2017 errors on the code that works in 2016, telling me my array is the wrong argument type. I have tried to debug, testing that the array is indeed an array and contains objects, but then when selection.add(array) runs, it tells me it's the wrong argument type. Why? Works fine in 2016 and 2015.

          1 Reply Last reply Reply Quote 0
          • D Offline
            driven
            last edited by

            @unknownuser said:

            ...it groups them together, moves the group, then explodes the group...

            exploding now deletes all references to the group entities, i.e. they all are 'deleted entities' after the explode...

            in one of mine I 'now' store the face.bounds.center.z and then after exploding re-find faces using that as a conditional...

            I believe the former ability to 'hold' the reference was a SU 'hack' and some of these are being 'put right'...

            john

            learn from the mistakes of others, you may not live long enough to make them all yourself...

            1 Reply Last reply Reply Quote 0
            • placidfuryP Offline
              placidfury
              last edited by

              @driven said:

              @unknownuser said:

              ...it groups them together, moves the group, then explodes the group...

              exploding now deletes all references to the group entities, i.e. they all are 'deleted entities' after the explode...

              in one of mine I 'now' store the face.bounds.center.z and then after exploding re-find faces using that as a conditional...

              I believe the former ability to 'hold' the reference was a SU 'hack' and some of these are being 'put right'...

              john

              I discovered this in bug testing, can confirm. It kind of sucks, as it was nice to store a selection set in an object array, manipulate, then get your selection set back by selection.add(array) which you can't do now since it views the objects as 'deleted.'

              Alternately - and this may work well for your case, as even edges/faces/etc get these - each object now has a property called persistent_id, and by referencing back to that you wouldn't have to compare geometry (if I read your post right). My work around for now is to store the persistent_id's in an array, then go the the drawing objects and find the ones that have those id's when I need to reselect them. This is way, WAY slower than just being able to reference back to an array of entities, but I guess it is what it is... unless someone else knows of an easier way to get the selection set back.

              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