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

    Topics

    • R

      Find the midpoint of walls on a 2D DWG

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      1
      0 Votes
      1 Posts
      0 Views
      No one has replied
    • R

      Plugin to identify "Thermal Bridges"

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      2k Views
      C
      @rossthompson said: Hi, I'm afraid not. I wasn't able to find a solution. Ross OK thanks for the reply.
    • R

      Convert Array into Integer

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      3
      0 Votes
      3 Posts
      147 Views
      R
      Hi, that has sorted it. Thank you
    • R

      Apply Material to ALL Entities on a Layer.

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      17
      0 Votes
      17 Posts
      5k Views
      TIGT
      If you want the same material front & back... Change where it says ... e.material=ma if e.layer==la... To ... (e.material=ma;e.back_material=ma) if e.layer==la... The toolbar is another kettle of fish...
    • R

      Dividing Up a Window Frame

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      2
      0 Votes
      2 Posts
      215 Views
      TIGT
      My SplitDonut with split the ring face at the corners... Note too that SplitSausage does the same for 'non-rings' - you need to 'seed' a short edge so the splits proceed as expected. To find 'rings' [faces with ONE hole] in a selection use a filter like: m=Sketchup.active_model;s=m.selection;f=s.grep(Sketchup;;Face).find_all{|e|e.loops.length==2};s.clear;s.add(f); You can then use SplitDonut on the selection en mass... The command you could add to the end of the above code to automate things is m=Sketchup.active_model;s=m.selection;f=s.grep(Sketchup;;Face).find_all{|e|e.loops.length==2};s.clear;s.add(f);TIG.splitdonut(); To divide multi-holed faces you need to add a line to make one-hole 'rings' ...
    • R

      Save As Plugin

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      5
      0 Votes
      5 Posts
      290 Views
      R
      Aerilius thanks very much for this - that is a clever approach. I have tried running the module you have written. However it opens command prompt with an error message "The system cannot find the file specified. 0 file(s) copied". I have tried debugging through the ruby console (see attachment) and the script correctly identifies my custom template file and the path to my desktop. However line 8 returns 'false' when trying to copy the file. I don't understand why this would be the case. Do you have any ideas? Thanks Ross [image: BJDm_RubyConsole.jpg]
    • R

      Create Layers From Component Names

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      4
      0 Votes
      4 Posts
      117 Views
      TIGT
      @rossthompson said: TIG - thanks so much for that. Would it be possible to revise the code to ignore any nested components? I guess this could be done with a simple change to the definition? Also could the layer colour be fixed to black? Thanks so much for your help Ross When you say 'nested' I assume you mean you want to re-layer only instances within the 'model.entities'... This new version does that - but actually it re-layers all instances in the 'active_entities' context, so if you run it whilst editing a group etc only instances inside that group are affected, to affect only instances in the model.entities ensure that you are in the model.entities context before running it - this allows you the fullest flexibility, with the opportunity to edit certain nested instances separately, if so desired... m=Sketchup.active_model;m.start_operation('c');m.active_entities.each{|e|next unless e.is_a?(Sketchup;;ComponentInstance);n=e.definition.name;l=m.layers.add(n);e.layer=l};m.commit_operation Layer colors cannot currently be accessed/changed by the API, you'll have to do that change to 'black' manually. There are some convoluted workarounds [e.g. make layer.color= developers' method hack], but it'll be just as fast to do it manually in the Layer Browser...
    • R

      Select a Face and any Islands

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      3
      0 Votes
      3 Posts
      185 Views
      M
      Assign material 1 to all wall surfaces. Assign mat 2 to all window surfaces. Right click in material browser and get total surface area mat 1 is assigned to. Same with mat 2. Add, subtract as required to get the info you are after.
    • R

      Toggle Wireframe

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      3
      0 Votes
      3 Posts
      289 Views
      R
      Good spot. Thanks it is sorted now. Ross
    • R

      Toggle X-Ray Button Held Down

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      4
      0 Votes
      4 Posts
      1k Views
      thomthomT
      Oh I completely misunderstood the question! Never mind me!
    • R

      Rotate Axis About Origin

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      4
      0 Votes
      4 Posts
      305 Views
      thomthomT
      Are you still using SU6 as your profile indicate? As of SU8 the model axes updates with your component/group axis.
    • R

      Directly apply a material

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      4
      0 Votes
      4 Posts
      233 Views
      thomthomT
      Can also be written like so: m = materials['Door'] || materials.add('Door')
    • R

      Project Entities onto an off-axis face.

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      3
      0 Votes
      3 Posts
      156 Views
      TIGT
      Set up a Workplane as shown. Ensure it's large enough to 'catch' all of the projected edges [along the green-axis in your example] Select those edges you want to project. Use my "ExtrudeEdgesByVectorToObject" - drag the vector, constrained [with shift]... [to the green-axis in your example], with an end point that you must picked beyond the Workplane - note how red dots displayed on the Workplane or other objects will indicate the 'hits' and extent of the extrusion. The resultant group will have extruded faces/edges and a set of terminating edges located exactly on the Workplane. Edit that group and Erase all of the unwanted edges/faces, retaining the ones that are on the Workplane. Now you have a group containing the edges projected [in your example along the green-axis] onto the WorkPlane...
    • R

      File Path Problem

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      2
      0 Votes
      2 Posts
      134 Views
      thomthomT
      Initial / at the beginning of a path means the root of the harddrive. To correct it: c = File.join( File.dirname(__FILE__), 'CBG', 'clinetool_cursor.png' )
    • R

      Edit raw vertex data

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      4
      0 Votes
      4 Posts
      238 Views
      TIGT
      Find my DropVertices tool [image: oYHi_Capture.PNG]
    • R

      Rotation about the origin

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      6
      0 Votes
      6 Posts
      291 Views
      daikuD
      This already exists here: http://rhin.crai.archi.fr/rld/plugin_details.php?id=345 and here: http://forums.sketchucation.com/viewtopic.php?f=323&t=9739&hilit=rot90 Perfect for mapping to a shortcut key.
    • R

      Move points to a '3D grid'

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      26
      0 Votes
      26 Posts
      2k Views
      thomthomT
      This wasn't something I ever planned to publish. It was just a code snipped posted for anyone to grab.
    • R

      Create new layer with an RGB colour

      Watching Ignoring Scheduled Pinned Locked Moved Developers' Forum
      5
      0 Votes
      5 Posts
      255 Views
      Dan RathbunD
      If you are starting with a fresh new model.. ie, Sketchup.active_model.modified? == false && Sketchup.active_model.title.empty? == true && Sketchup.active_model.path.empty? == true .. then you could open a new file from a template, that had the layers already set up. Otherwise... ... you can create a component definition, that has nothing but cpoints on your preset layers (names and colors and visibility,) and then save the component to your local component library. Then anytime you wish to use those layers, either manually open the component library and click on that component (you do not actually need to insert it into the model.) Here's a little SKP that has EIA colors assigned to Layer1 thru Layer9. (These are the colors you see on resistors or capacitors, that indicate their value. Sometimes also used by rainbow ribbon cables, to indicate pin number.) EIA_Color_Layers.skp Or.. via Ruby, you can load that component (say from a plugin sub-folder.) module Author module CustomLayers class << self def add_landscape_layers() plugs = Sketchup.find_support_file("Plugins") path = File.join(plugs,"Author/CustomLayers/LandscapeLayers.skp") mdl = Sketchup.active_model() defnset = mdl.definitions() landscape_layers_defn = defnset.load( path ) trans = Geom;;Transformation.new() # default identity transform inst = mdl.entities.add_instance(landscape_layers_defn,trans) inst.erase! end # def add_landscape_layers() end # proxy class end # submodule end # Author's toplevel module One drawback is that the color for the default layer ("Layer0",) must be set in the template files.
    • R

      Name a Group after its Layer

      Watching Ignoring Scheduled Pinned Locked Moved Plugins
      3
      0 Votes
      3 Posts
      121 Views
      R
      Thanks Sam That works a treat. Your help is much appreciated. Ross
    • 1 / 1