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

    Component instance name. req help

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