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

    Group.make_unique (possible Ruby bug)

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 3 Posters 338 Views 3 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.
    • W Offline
      Whaat
      last edited by

      I have an odd situation where I need to make sure that a group's component definition has only one instance (i.e. is unique).

      I notice that the group.make_unique method is deprecated but it still works. However, I get a warning message every time it is called.

      The problem arises when a user copies a group, thus creating another instances of the group's definition. Then, let's say my Ruby script attempts to erase all the edges in the currently selected group. Instead of just erasing the edges in the selected group, all instances of the group are affected which is not what I want. This seems like a bug with the Ruby API. In my mind, if you do any manipulation to a group's entities using Ruby code, the group should automatically be 'made unique' by SketchUp (just like what happens when you enter group edit mode by double-clicking a group).

      My question is:
      Is it possible to make a group unique without using the group.make_unique method (using Ruby)?

      SketchUp Plugins for Professionals

      1 Reply Last reply Reply Quote 0
      • T Offline
        tomasz
        last edited by

        I am afraid it is a ruby bug. SU2KT users has reported similar behaviour of groups. SU sometimes treats them as instances! I am not aware of a different method to make group unique πŸ˜’ ?

        Add it to RubyAPI wish list, please. I mean a bugfix πŸ˜„

        Tomasz

        Author of [Thea Render for SketchUp](http://www.thearender.com/sketchup)

        1 Reply Last reply Reply Quote 0
        • TIGT Offline
          TIG Moderator
          last edited by

          A Group is a single Instance of a Definition - and of course there should only ever be one of them, but sometimes SUp with Ruby thinks that a copy of a Group is another Instances. The way round it in Ruby is to use make_unique on the copy of the group (instance) as you go. It will return an error but it should work anyway... It might get fixed one day...

          TIG

          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