sketchucation logo sketchucation
    • Login
    1. Home
    2. renderiza
    3. Posts
    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!
    ๐Ÿšจ Skimp | 25% Off until March 30 Buy Now
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 98
    • Posts 783
    • Groups 2

    Posts

    Recent Best Controversial
    • RE: [req]rename objects with name of the layer

      The code below solves the issue mentioned above about the numbers...

      model = Sketchup.active_model
      ents = model.active_entities    
      groups = ents.grep(Sketchup;;Group)
      components = ents.grep(Sketchup;;ComponentInstance)
      num = 0
      
      groups.each do |group|
        group.name = nil.to_s
      end
      
      groups.each do |group|
        if group.name == nil.to_s
          num=0
        end
        
        groups.each do |g|
          if group.layer.name == g.layer.name
            if g.name == nil.to_s
              num+=1
              g.name = group.layer.name.concat(" - #{num}")
            end
          end
        end
      end
      
      components.each do |component|
        component.name = nil.to_s
      end
      
      components.each do |component|
        if component.name == nil.to_s
          num=0
        end
        
        components.each do |c|
          if component.layer.name == c.layer.name
            if c.name == nil.to_s
              num+=1
              c.name = component.layer.name.concat(" - #{num}")
            end
          end
        end
      end
      

      The code uses numbers like this "door - 1" and not like this "door - 001". Do you need it to be like :door - 001" or is it fine like it is?

      posted in Plugins
      renderizaR
      renderiza
    • RE: [req]rename objects with name of the layer

      Hi,

      The code bellow adds the layer name to each group that belong to the layer.

      model = Sketchup.active_model
      ents = model.active_entities 	
      groups = ents.grep(Sketchup;;Group)
      
      groups.each do |group|
        group.name = group.layer.name
      end
      

      You mentioned Components as well so will see if I can add that on next example. You also have incrementing numbers to the side so that is another thing to add.

      Note: To test code I recommend using [as] Ruby Code Editor - http://extensions.sketchup.com/en/content/ruby-code-editor but there are other good ones as well.

      Renderiza

      posted in Plugins
      renderizaR
      renderiza
    • RE: [req]rename objects with name of the layer

      Here is little update...
      Both Groups and Components are renamed given the layer they are on now.

      model = Sketchup.active_model
      ents = model.active_entities 	
      groups = ents.grep(Sketchup;;Group)
      components = ents.grep(Sketchup;;ComponentInstance)
      
      groups.each do |group|
        group.name = group.layer.name
      end
      
      components.each do |component|
        component.name = component.layer.name
      end
      

      Now the part I have not been able to solve is the number side of things. How to make each layer have their own numbers so that they don't conflict with each other like this;
      Don't want:
      door - 001
      door - 002
      door - 003
      window - 004
      window - 005

      Do want;
      door - 001
      door - 002
      door - 003
      window - 001
      window - 002

      Any ideas how to solve this?

      posted in Plugins
      renderizaR
      renderiza
    • RE: [Plugin] Selection Toys

      Thanks Dan Rathbun!

      posted in Plugins
      renderizaR
      renderiza
    • RE: Animation with Clock/timecode?

      It might be possible to create plugin that updates a text with the time. Not 100% sure if it will appear when exported though but if you have video screen capture software like "Fraps" it will.

      posted in Newbie Forum
      renderizaR
      renderiza
    • RE: Plugin Folder Permision Issue

      Thank you TIG I used your first suggestion and it works great.

      posted in Plugins
      renderizaR
      renderiza
    • RE: Count / selection count

      right click on selection and select entity info which will open a window and at the top you will see how many you have selected.

      posted in Plugins
      renderizaR
      renderiza
    • RE: Plugin Folder Permision Issue

      Running this auto fix from Microsoft Support solved some of the problem.

      http://support.microsoft.com/mats/windows_file_and_folder_diag

      I can install plugins with Plugin Store and Extension Warehouse again but the same problem persist that I can't change settings for Selection Toys. :S

      Note: Tested Plugin Store and I can Disable plugins now as well which before I couldn't so that is good news.

      posted in Plugins
      renderizaR
      renderiza
    • RE: [Plugin] Selection Toys

      Already did without even wanting to I think. ๐Ÿ˜ข

      Hope to find a way to undo it. ๐Ÿ˜•

      posted in Plugins
      renderizaR
      renderiza
    • RE: Plugin Folder Permision Issue

      @rich o brien said:

      Right click SketchUp icon and choose run as admin.

      It works great when I do what you suggested. Now I need to find a way to always to this without the need of right click.

      Thanks!

      posted in Plugins
      renderizaR
      renderiza
    • RE: [Plugin] Selection Toys

      TIG you are right there is something wrong with my folder permission. I made new topic here to take this discussion there instead... http://sketchucation.com/forums/viewtopic.php?p=489984#p489984

      Thanks

      posted in Plugins
      renderizaR
      renderiza
    • Plugin Folder Permision Issue

      Hi,

      Somehow I changed the plugin folder permission and I don't know how to fix it. Here is an image showing that the current setting for permission doesn't allow anything.

      http://s12.postimg.org/gu7trb7fx/Untitled_1.jpg

      This setting only showed on Plugins Folder but in trying to fix it now I have made all folder use this Creator Owner Permision which I can't delete. ๐Ÿ˜• This doesn't even allow Extension Warehouse to install plugins automatically.

      Can someone help me? Do I need to restore my computer factory settings or is there easier way.

      Thanks,
      Renderiza

      posted in Plugins
      renderizaR
      renderiza
    • RE: [Plugin] Selection Toys

      Ok this is weird... I went to my Plugin Folder and moved all of my other plugins except Selection Toys and it still is not working!

      The other test I did that made it work was the following...

      I copied my SketchUp Folder from Programs Files and pasted a new one to my Desktop. Doing this will make the plugin work.

      Any ideas what can this be...This means what is causing this is not another plugin but something else.

      IMPORTANT!

      I uninstalled & reinstalled SketchUp to see if it will fix it and it didn't so something is wrong with the SketchUp folder being on my Programs Folder!?... Not sure but this is definitely weird. ๐Ÿ˜•

      Maybe I need to restore my machine factory settings to see if it solves it. ๐Ÿ˜ฎ ๐Ÿ˜ข

      posted in Plugins
      renderizaR
      renderiza
    • RE: [Plugin] Selection Toys

      There is another plugin installed on my SketchUp that might be conflicting with Selection Toys. It is not letting me add more icons to the toolbar using UI Settings dialog. When I hit save it doesn't close the dialog.

      I tested Selection Toys Plugin without other plugins and it works fine... ๐Ÿ˜•

      There is also other plugins affected by this..."Plugin Store"!...When I try to disable a plugin for it doesn't do nothing.

      Going through all the plugins to find the one responsible for this will be hard work but will let you know if I find it.

      posted in Plugins
      renderizaR
      renderiza
    • RE: Scenes not behaving correctly?!?

      @agamemnus said:

      I created some code to render a helicopter. Unfortunately, for some blasted reason, most of the scenes are not being rendered correctly. Help!

      Can you be more specific when you say "rendered correctly" because I am not 100% sure what you mean by this. Do you mean the scene style rendering options where not updated?

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Modifying Web-Dialog content size possible?

      @aerilius said:

      Why do I reply here ๐Ÿ˜’ I'm not a godโ€ฆ

      I am currently building a temple on your honor...at least a SketchUp model of it for sure! ๐Ÿ˜

      Thanks!

      posted in Developers' Forum
      renderizaR
      renderiza
    • Modifying Web-Dialog content size possible?

      I ask for the SketchUp Gods to help me once again! ๐Ÿ’š

      I want to create a plugin where I can open a web-dialog that has a giving website assigned to it (example: Youtube) and I want the content size to be smaller right out the bat without the need of pressing (ctrl -). Here is an image showing what I mean...

      Original Size;

      http://s17.postimg.org/sym9gk6bj/h_2.jpg

      But I want this size;

      http://s10.postimg.org/swzjw32op/h_1.jpg

      Thanks in advance!

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Transformation.rotation help

      Hi,

      The following example code aligns the object axis with line axis pretty close, its a little off but not by much...not sure why this happens.

      Here is the code;

      model = Sketchup.active_model
      ents = model.active_entities
      sel = model.selection
      
      @rotx = 0
      @roty = 0
      @rotz = 0
      
      #change to see diferent line rotations
      edge = Sketchup.active_model.entities.add_line([0,0,0],[-400,700,200])
      
      line = edge.line
      lend = edge.end
      lendp = lend.position
      
      sel.each do |e|
          pi = Math.acos(-1)
          @rotx = Math;;acos(line[1].x)*(180/pi) #/
          @roty = Math;;acos(line[1].y)*(180/pi) #/
          @rotz = Math;;acos(line[1].z)*(180/pi) #/   
      end
      
      tobject = sel[0]
      
      
      tr1 = Geom;;Transformation.rotation(ORIGIN, Y_AXIS, @rotz.degrees)
      tr2 = Geom;;Transformation.rotation(ORIGIN, Z_AXIS, @rotx.degrees)
      tr3 = Geom;;Transformation.new([lendp.x, lendp.y, lendp.z])
      
      instance = ents.add_instance(tobject.definition, tr1)
      instance = instance.transform!(tr2)
      instance = instance.transform!(tr3)
      

      Note: before running code you need to have a group selected.

      posted in Developers' Forum
      renderizaR
      renderiza
    • RE: Dinamic colors or something like that ?

      Animatex Plugin can animate textures and if you see the second video on the topic there is an example of a cube that changes colors using a gradient image. Here is the link...

      http://sketchucation.com/forums/viewtopic.php?p=472554#p472554

      posted in Newbie Forum
      renderizaR
      renderiza
    • RE: Problem with face.normal directions...help!

      Thanks Chris Fullmer your example does the job as well.

      Here is another example that will select faces that are pointing to the top right...

      model = Sketchup.active_model
      sel = model.selection
      ents = model.active_entities
      faces = ents.grep(Sketchup;;Face)
      
      faces.each do |face|
      	f1nx = face.normal.x
      	f1ny = face.normal.y
      	
      	#Face looking top right 
      	if f1nx > 0 and f1ny > 0 
      		sel.add face
      	end
      end
      
      posted in Developers' Forum
      renderizaR
      renderiza
    • 1 / 1