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

    Component instance name. req help

    Scheduled Pinned Locked Moved Developers' Forum
    3 Posts 2 Posters 210 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.
    • N Offline
      NewOne
      last edited by

      I'm using

      Sketchup.active_model.active_entities.add_instance(my_component, t)
      
      # my_component is component name and
      # t is applied transformation
      
      

      Sketchup appends #+number to component's name, for each instance. I want to be able to replace # in name with other character ('/'). Is there a way to do this?

      1 Reply Last reply Reply Quote 0
      • J Offline
        Jim
        last edited by

        The Component name is a String.

        
        ins = entities.add_instance(cdef, transf)
        name = ins.name
        name.gsub!(/#/, '/')
        ins.name = name
        

        Hi

        1 Reply Last reply Reply Quote 0
        • J Offline
          Jim
          last edited by

          I will add that the Definition name is different than the Instance name, but should work the same.

          
          ins = entities.add_instance(cdef, transf)
          name = ins.definition.name
          name.gsub!(/#/, '/')
          ins.definition.name = name
          
          

          Hi

          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