sketchucation logo sketchucation
    • Login
    1. Home
    2. nick9111
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    N
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 2
    • Posts 10
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: [Plugin] Eneroth Railroad System (v 0.1.21)

      I like to make different transportation zone models and I will play a lot with this plugin! If there will be a road and cars version it could just make me happy πŸ˜›

      posted in Plugins
      N
      nick9111
    • RE: Followme with distance

      Thanks to all who tried to help me. I'm just new to ruby and Sketchup API, but digging some deeper into it I solved this problem by myself now.

      posted in Developers' Forum
      N
      nick9111
    • RE: Followme with distance

      Also I've made a ruby which splits this curve to smaller curves (for the case if there is no way for 'followme by distance') by drawing lines from one point to all insertion/end points (and then erases this lines). How can I automatically select these smaller curves 1 over 1 with ruby code (on picture I selected them manually)


      pic2.PNG

      posted in Developers' Forum
      N
      nick9111
    • RE: Followme with distance

      @mitcorb said:

      Or use TIGs Pipe Along Path for that bend, but temporarily break the path for the distance of the result. Use 0 distance for inside diameter if you prefer.

      I'm not trying to do just a dashed pipe. I want to use it with any kind of face. I have tried some plugins like 'Profile Builder', 'Follow me and keep', 'Shape Bender', 'Upright extruder' but it seems none of them can make a dashed object from selected curve.

      P.S. 'Profile Builder' can make unique members along each edge, but

      1. when I split my long curve to small curves it's too hard to select all needed manually
      2. with this option PBuilder also splits each of these small curves to separate edges:

      pic3.PNG

      posted in Developers' Forum
      N
      nick9111
    • Followme with distance

      I've searched different topics and didn't find if is there a way do to 'followme' in ruby with not full length of the egde. With my code I can place faces along curve with some step and then I want to follow'em for some distance (I'm trying to do "dashed" 3d object).
      Maybe I should place new edges to the same points but in this case don't know what to do if some edges lies on turning of curve (see picture) thats why I'm looking for 'followme' by specified length


      pic.PNG

      posted in Developers' Forum
      N
      nick9111
    • RE: Rename texture image file inside *.skp

      So there is a ruby plugin I've done (based on TIG's post). It renames all texture files in model with a template.

      
      module VNV
      
      def VNV.rename_textures
      UI.messagebox("All texture file names will be changed with a template - mat000")
      model = Sketchup.active_model
      
      model.start_operation('Rename texture files', true)
      tw = Sketchup.create_texture_writer
      
      
      temp_path = File.expand_path( ENV['TMPDIR'] || ENV['TMP'] || ENV['TEMP'] )
      temp_folder = File.join( temp_path, 'Sketchup_tmp_mtl' )
      unless File.exist?( temp_folder )
              Dir.mkdir( temp_folder )
      end
      
      group = model.active_entities.add_group()
      
      Sketchup.active_model.materials.each_with_index{ |m,i|
      if m.texture then
      group.material = m
      tw.load(group)
      path_to_png = File.join(temp_folder, "mat#{'%03d' % i}"+".png") 
      tw.write(group, path_to_png)
      
      w = m.texture.width
      h = m.texture.height
      
      m.texture = path_to_png
      m.texture.size = [w, h]
      
      File.delete(path_to_png)
      end
      }
      
      group.erase!
      model.commit_operation
      
      end # def
      end # module
      
      if (!file_loaded?(__FILE__))
        menu = UI.menu("Plugins")
        menu.add_item("Rename texture files") { VNV;;rename_textures }
        # Let Ruby know we have loaded this file
        file_loaded(__FILE__)
      end
      
      

      RenameTextures.rb

      posted in Developers' Forum
      N
      nick9111
    • RE: Rename texture image file inside *.skp

      Thanks TIG, I'll check out this method πŸ‘

      @tt_su said:

      May I query why you want to change the filename property of a Texture object?

      I am working with a 3rd party program which directly imports *.skp files. My skp files have many textures with non-English letters in their file names. Program can't see those textures.

      posted in Developers' Forum
      N
      nick9111
    • RE: Rename texture image file inside *.skp

      @aerilius said:

      Export it to the new filename (in a temporary folder), import it again to the material ( material.texture=), delete the temporary file.

      Thank you for a quick answer, but I always do this work manually for many times and wondering if there's a way to rename it just with ruby command/routine 😐

      posted in Developers' Forum
      N
      nick9111
    • Rename texture image file inside *.skp

      Is there a way to rename texture image file inside *.skp? For example I can get name of such file using

      Sketchup.active_model.materials[0].texture.filename
      

      and when the result is filename with no path how to rename it and if it is possible keep association with material which using it?

      posted in Developers' Forum
      N
      nick9111
    • RE: Reading and drawing textures

      Hi, I am new to the community and also have a thing I don't understand how it should be done. For example, I can get filename of texture which is saved inside .skp file using

      Sketchup.active_model.materials[0].texture.filename
      

      Is there a way to rename it? (and keep reference of associated material to it)

      posted in Developers' Forum
      N
      nick9111
    • 1 / 1