sketchucation logo sketchucation
    • Login
    1. Home
    2. TIG
    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!
    Check out Febhouse | New extensions for Shadow Analysis in SketchUp Download
    TIGT Offline
    • Profile
    • Following 0
    • Followers 13
    • Topics 266
    • Posts 19,853
    • Groups 6

    Posts

    Recent Best Controversial
    • RE: Section cutters with marker flags

      Interesting idea... My SectionCutFace script finds the selected section cut plane and then fills in a section face, BUT it can't link to it for later use... so I expect that if we wrote a script that 'marked' each current section AND put it onto a layer you could switch off etc, then it'd fall over IF you moved the section plane later on... IF you can add an observer to a section plane then it'd work... I'll look into it over the holidays...

      EDIT: After some brief delving into methods... it seems that although sectioncut planes have few methods listed under the SUp API, you CAN give them enduring attributes and observers... Thus we can link section cuts to tags and also faces to section cuts etc... exciting new ideas for 2008...

      posted in SketchUp Discussions
      TIGT
      TIG
    • RE: [Tutorial] How to Model Tapered Columns or Cylinders

      To use simple scaling to taper something like a column, you can pushpull a cylinder as in the first example tut, then select the top circle, scale it by pulling a corner handle WHILE you are holding down the Ctrl-key, this is so the centre-point becomes the scaling origin, then pull it in a little inwards, THEN type 0.5 in the VCB to make the original 800mm into 400mm [OR type 400mm - note units suffix]...

      The two tuts below and this scaling way are all pretty easy and straightforward...

      posted in SketchUp Tutorials
      TIGT
      TIG
    • RE: Volume Calculator v2...

      Howard

      I am working on solutions for the issue of v2.2...

      1. It's a mystery why the Sup upgrade might have caused somethings to work differently.

      2. The misplacement of some volumes did occur in testing BUT I thought I'd ironed that out. I'll try a more robust methods. Basically the complication is that when we get the faces in a group inside a group inside a component instance etc we need to work out the transformation(s) and * them together so that the new volume's faces we make are in the place they should be. Sometimes if a group is edited in place then made part of something else it can recall its earlier transformation...

      3. Forms with holes in (donuts) are now fixed - volumes are faced and calculated correctly - It was an easy fix... I forgot that some face edge loops could be internal and not needed to make the main face initially... now after the main face is made these inner loops are faced and immediately erased to make the holes.

      4. I'll try using AdamB's ideas about 'manifold' checking before volume making, and your ideas about reporting etc...

      It might not get sorted this side of Christmas though...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: TextTag

      Here's v1.2 of TextTag.rb

      Dialog allows 'stand-off' of tag to be set, default=0.1"/1mm: this allows you to stand text-tags above the surface they snap to for visibility reasons...

      Cast/receive shadows can now be set: so if standoff needs to be quite large for visibility reasons and shadows need to be on the text-tag won't cast shadow onto the face behind it...

      A Proto TextTag >>. DXF exporter has been started... BUT I've stripped it out of this release as it's still too flaky - probably see next release for this...


      TextTag.rb

      posted in Developers' Forum
      TIGT
      TIG
    • RE: [Plugin] Slicer v4.3 20110619

      @unknownuser said:

      I get this error message with Slicer.rb (version 3.0), see image attached.

      [attachment=1:1k4woufo]<!-- ia1 -->slicer error.JPG<!-- ia1 -->[/attachment:1k4woufo]

      I apologise. I uploaded a version that's customized to my menu setup by mistake ! Of the 40 or so who've viewed it so far you are the only one to point it out... Here's v3.1 that's fixed to suit all.

      posted in Plugins
      TIGT
      TIG
    • [Plugin] Slicer v4.3 20110619

      Moved from the 'Roof' thread...
      @matt77 said:

      Excellent Script. Many thanks -- works a treat for me!!!
      I must commend you also on another of your scripts that I find invaluable at work. It's your slicer ruby. It comes in very handy for working out the floor space across very large master-plan massing models. It has saved me so much time. Thank you. I'm not sure it was ever intended for this, but if you set the floor to ceiling height say 3 metres, but don't give the slices any thickness, then run the script across a large grouped area of buildings then explode the floor slabs within the main group, by using the area tool with all faces within that group selected you get a total floor space for that whole area. You may have to delete the top slices so that you don't include the roofs. But very, very handy indeed...
      Whilst using your most recent roof script I was impressed in the way that you could assign a material and a layer to the new roof.
      I have a request. (Not that your not busy enough as it is)
      Is it possible to implement this within in the slicer ruby? So that the when you create the new slices you have an option of also assigning a material to the new slices. In this way you could have separate materials for residential, commercial and retail space. This information regarding the areas assigned to the materials could be then exported to an excel sheet. Giving you a detailed breakdown very quickly regarding your model.
      Matt

      A few months ago we started using Slicer.rb for exactly the same thing - to get a rough idea of the floor-space in massing blocks on master-plans [although its original use was for making 3D card models from a Sketchup volume - cheap 3D-printer !]
      Not so long ago I added a make your own layer and pick materials on the fly option to VolumeCalculator.rb. Since this a son (or perhaps grandson ?) of Slicer it'll be pretty easy to implement (I hope)... I'll add it to the list of things to do.

      Here's an updated version - there's a more wide-ranging version on the back-burner [making components of slices etc]... but this one fixes some glitches to ensure that if your 3d form is not properly 'solid' at least each slice get made without the tool 'stalling' - even it some slices don't form/face/extrude/etc as hoped...

      Copyright 2005-2011, TIG

      Permission to use, copy, modify, and distribute this software for
      any purpose and without fee is hereby granted, provided the above
      copyright notice appear in all copies.

      THIS SOFTWARE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR
      IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
      WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.

      #-----------------------------------------------------------------------
      Name : Slicer.rb

      Description : A tool to 'Slice' up a volume - useful in real-model
      making and finding likely areas in master plan volumes...

      Menu Item : Plugins -> Slicer

      Context Menu: See menu-section at end on how to include it here: Slicer

      Author : TIG

      Usage : First select a Group or Component that has faces that
      form a volume, then use the Plugins Menu Item 'Slicer': you can aso
      pick the right-click Context-Menu and choose 'Slicer' IF you have
      enabled it (see menu-section at end)...

      A dialog asks for the Slice spacing, the Slice thickness and the
      Slice orientation (XYZ). The units are in current units...
      Entering 0 thickness makes just a face. Entering negative
      values reverts to default. Entering spacing less than thickness
      reverts to default. It also asks for the the Layer and Colour
      of the Slices. The layer choices are 'Layer0' (or <Default> in your
      local langauge), a unique name 'SLCE-nnnnnnn' (it will then make a new
      layer named 'SLCE-nnnnnnn', where nnnnnnnn is based on the date/time),
      '<Make New Layer>' (it will then open another dialog & ask for a new
      layer-name) and then it lists of all other layers in alphabetical order.
      The Colour choices are all of the default colours in alphabetical order.
      Tip: To scroll beyond bottom of list type the first letter of name and
      then search from there - e.g. W >> 'Wheat', then use arrow keys to
      scroll down to 'White'...

      A dialog asks if you would like the slices equalized - Yes/No - if
      'Yes' - spacing is apportioned into total dimension for even spacing
      of all slices at the spacing or just below, if 'No' then slices are
      spaced as entered and the last slice's spacing is adjusted to fit any
      remaining gap.

      A dialog asks you if you want to number the slices - Yes/No - if
      'Yes' - an incrementing number is added to the slice near its lower-
      left bounding-box corner.

      If you are making more than 25 slices you are warned because this
      might take some time to process.

      It then makes a series of slices through the selection's faces.
      If needed to fill the volume, an unevenly spaced last slice is added.
      Volumes with punched holes will get the slices formed around them but
      only to the 'accuracy' of the slice spacing and the slice thickness.
      The slices are named Slice-n-nnnnnnnn (where n is the slice-number)

      All of the slice-groups are combined into a group called Slice-nnnnnnnn.

      Before ending it checks if 'Xray Mode' was already switched 'on' at
      the start and if so there is no action and it exits. Otherwise the
      original selection is 'Hidden' so you can clearly see the slice-group.
      You are then asked in a dialog if you want to leave it 'Hidden'.
      If 'Yes' then it exits leaving it 'Hidden'. If 'No' the original
      selection is 'Unhidden' and 'Xray Mode' is then switched 'on' so you
      can see the slice-group inside of the original selection and a dialog
      asks if you want to leave 'Xray Mode' switched 'on'. If you answer
      'No' the normal view is restored and it exits (but then the slices will
      be obscured !). If you answer 'Yes' it exits leaving 'Xray Mode'
      switched 'on'.

      You are finally asked if you would like to make a 'flattened' copy.
      Answer 'Yes' to make another group. A dialog asks for the min. gap
      between 'flattened' slices in current units. The flattened-slices
      group is named 'Flat-Slice-nnnnnnn' on layer FLAT-+'Your_Layer_Name'.
      It is placed below the original slice-base with all slices put down
      'flattened' with equal Zs, arranged in order, in as near a 'square'
      pattern (n x n) as possible. Because the non-Z oriented slices have
      to be rotated 'flat' and when rotated they shouldn't overlap, you will
      find that sometimes the spacings between rows(Y) or columns(X) will
      exceed the minimum gap specified. You can always move the flattened
      numbered slices around by editing the flattened-slice group - this
      might then further optimise any real material use etc.

      'Slicer' can't be expected to be 100% foolproof ! It treats an open
      topped object as it if were filled with water, taking slices from the
      outer 'skin' inwards to work out which are the solid and which are the
      hollow volumes. With a little ingenuity you will be able to contrive
      a form with complex linked holes punched in, or a suitable array of
      thin volumes spaced apart so as to miss the sampling slices - which
      because it uses a series of slices, can produce unexpected results.
      Keep forms simple and build them up in bits for safety...

      Date : 12/2005

      Type : Tool
      PayPalButton
      Verison :
      1.0 18/12/05 First issue.
      1.1 18/12/05 Inches --> inch typo fixed.
      1.2 18/12/05 Circle def moved into class (Mac).
      1.3 19/12/05 X orienatation and last slice glitch fixed.
      1.4 19/12/05 Decimal . AND , trapped...
      1.5 19/12/05 Disc made larger...
      1.6 20/12/05 Pushpull made compatible with earlier version.
      Glitch with groups on -ve axes fixed.
      Option to equalize slice spacings added.
      1.7 20/12/05pm v5+ program only error added.
      1.8 21/12/05 Undo text corrected.
      1.9 22/12/05 Slice numbering option added.
      2.0 24/12/05 Glitches in number locations fixed.
      Slices and their Numbers are now grouped
      individually inside one bigger group.
      Option to make a 'flattened' copy added.
      2.1 16/12/06 'Layer0' removed - Spanish versions etc, now
      makes active_layer the default, whatever it's name -
      & puts text/slices on it before layering groups.
      3.0 09/10/07 Choose / make Layer on fly and select any 'Colour'
      options added. All geometry now on 'default' layer.
      4.0 20100201 Beta - Updated to add possible insets at start and end.
      Added possible 'lines' bisecting vertices onto faces.
      Arguments in () etc...
      4.1 20110206 Temp version to fix complex glitch.
      4.2 20110609 Several fixes; typename>>class, begin/rescue/valid? tests...
      4.3 20110619 Image option added, usage: preselect 'Flat-Slice-nnnnnnnn'
      group and type in Ruby Console: Slicer::images - it makes
      png image files named after each slice, in new folder with
      model named 'ModelName-Slice-Images-nnnnnnnn'.
      Please ensure that any earlier versions are removed from the Plugins folder [e.g. named Slicer32.rb] before you place this new version into that folder and restart...Slicer.rb
      THIS TOOL IS SUPERSEDED BY 'SLICER5', AVAILABLE HERE http://forums.sketchucation.com/viewtopic.php?p=374969#p374969

      posted in Plugins
      TIGT
      TIG
    • RE: Help with Observers

      @didier bur said:

      Thank TIG for the reply.
      One more question 😳 : how to associate reveals faces to the component instance, since there is no persistent entityID which can be set as an attribute to the component instance ?

      You can give the compo'instance an attribute and match this to the reveal's faces attributes, if you move it (observer kicks in)... it looks for any faces (reveals) with matching attributes and moves them too...
      Conversely if one of the reveal faces moves it too has attributes linking it back to the other related reveal faces and the compo'instance, by their matching attributes, and it moves them to suit too...
      Have an attribute for all related things... say it's called 'Cutter' and give it a random number key '1234567' when they are first connected by the tool.
      The window has the attribute 'Cutter' set to '1234567' and when the observer does its stuff the faces in the model are scanned for attribute 'Cutter' and IF its set to '1234567' it's a hit and they are moved to suit. This way all reveal faces and compo'instance are connected across sessions.
      You could also have a checksum in the key to check that there are still the original number of faces etc e.g. 4 faces >>> [4,1234567], when moving something IF the face count <4 then remove all of the face and compo'instance attributes so they're disconnected for good... OR try to make the missing face(s) and refix to suit ? - rather like erasing the wall face that the window is in... making a new window won't cut the face unless it's reglue'd (see my script fot this bit)...
      The 'Cutter' attribute can also containe the base face linked with an attribute if this helps heal or reglue, move reveals later on etc...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Help with Observers

      Here's some example code:

      ###
      class FaceWatch < Sketchup;;EntityObserver
       def onChangeEntity(entity)
         UI.messagebox(entity.to_s+"; Face Changed!")
       end#def
       def onEraseEntity(entity)
         UI.messagebox(entity.to_s+"; Face Erased!")
       end#def
      end#class
      pts=[[0,0,0],[100,0,0],[0,100,0]]
      face=Sketchup.active_model.entities.add_face(pts)
      face.add_observer(FaceWatch.new)
      ###
      

      Clearly the messages are only to show what it's doing - you can add other actions instead, such as affecting some other related objects ("attributed" together)... E.G. A window has an observer, you move the window and its associated reveal faces move too: the reveal faces each have an observer and if you move one the others move with it (like it's a group that's not a group !) AND their associated window moves too...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Volume Calculator v2...

      Here's v2.1

      http://www.sketchucation.com/forums/scf/viewtopic.php?p=16067#p16067

      ...

      Nested Groups/Components within Groups now 'mined' and each calculated.
      Dialogs combined into one and only one dialog per selection set.
      Reversed faces in some volume-groups now properly colored.
      [Note that 'Red' faces show a problem too]
      Warning at end if any ambiguous forms.

      ...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: [Plugin] Volume Calculator2...

      Here's v2.2

      Nested Groups/Components within Groups now 'mined' and each calculated.
      Dialogs combined into one and only one dialog per selection set.
      Reversed faces in some volume-groups now properly colored.
      [Note that 'Red' faces show a problem too]
      Warning at end if any ambiguous forms.
      Get its RBZ from here http://sketchucation.com/resources/pluginstore?pln=VolumeCalculator2

      posted in Plugins
      TIGT
      TIG
    • RE: Disability issues

      I don't know exactly how this might function - I've never tried it... I suspect that it's only one of many applications that could provide an overlay 'screen' that otherwise doesn't interfere with the main app' [much] as you use it, so that colours could be [re]set so they are perceptible to users with such problems...

      If it doesn't exist it should be invented - I don't think it's a necessity for SketchUp or Windows BUT 3rd party developers could make something that fills that gap ?

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Disability issues

      This has little to do with Ruby BUT it might help you...
      http://colorhelper.com/tutorial.php
      It seems quite comprehensive and inexpensive...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Workaround for disappearing &quot;explode&quot;-shortcut?

      @samtsham said:

      Hi everybody.
      I don't know about you, but even after the latest service release, on my Mac I cannont define a shortcut for "explode", which is as integral to my workflow as hardly another function. Well, more accurately, I can DEFINE one (Edit/Context Menu Flyout/Explode), but it doesn't do anything. I read way back when that I wasn't the only one with that problem, but protests have been few.

      Since Google still doesn't address this bug, and I have to use the bloody flyout menu 80 times a day, would any of you ruby wizards have an idea for a temporary quickfix/custumizable shortcut/workaround of any kind, to speed things up until that thing gets repaired?
      I realize that it can't be a problem on PCs, or you'd all have raised merry hell by now, but any long suffering MAC users with a few minutes to spare?

      I'd be eternally grateful.
      SAM from Vienna.

      You probably tried this anyway, but...
      Select an object that could be exploded - e.g. a Group - Open the Menu > Windows > Preferences [dialog] > Shortcuts [tab] and Filter for 'Explode', pick the 'explode' off the 'edit' menu and assign a Key - e.g. Shift+X - Now when you have something Explode'able selected using Shift+X should Explode it ... Avoid using just 'X' as this conflicts with Copy+Ctrl for Array xNNN...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Script User Options

      @unknownuser said:

      Is there a easy way to make options in a ruby script? I want to have a few user options that wont reset every time the script loads. The only way that I can think of is making a text file and somehow reading and editing it within the script.

      Making the tool as a 'Class' and then setting a user's choices as @xxx named class-specific variables remembers those for that tool during that session. Similarly, using $xxx variable names is set as global per session, BUT this is not recommended usually as these might clash with other global variables set by other scripts or extensions etc...
      Here's an example of @xxx use:

      ### PathMemory.rb
      require 'sketchup.rb'
      class PathMemory
      def PathMemory;;memorize
         model=Sketchup.active_model; @memory=[]; model.selection.each{|e|@memory.push(e)if e.typename=="Edge"}
         ### remembers just the edges in a selection in a persistent @xxx variable array called @memory.
      end
      def PathMemory;;recall
         model=Sketchup.active_model; model.selection.clear; model.selection.add(@memory)
      end
      end#class
      # add context menu items
      if( not file_loaded?("PathMemory.rb") )
        UI.add_context_menu_handler do |menu|
          menu.add_separator ### this adds a seperator line
          submenu=menu.add_submenu("Path Memory...")
          submenu.add_item("Memorize"){PathMemory.memorize}
          submenu.add_item("Recall"){PathMemory.recall}
        end#do menu
      end#if
      ###
      file_loaded("PathMemory.rb")
      

      If you want to remember a user's last-chosen general settings across different sessions then use variables that are written / saved as 'default settings' (which is in essence like writing/reading a text file of the settings BUT uses 'the registry') [ http://download.sketchup.com/sketchuphelp/gsu6_ruby/Docs/Ruby-Sketchup.html#read_default and http://download.sketchup.com/sketchuphelp/gsu6_ruby/Docs/Ruby-Sketchup.html#write_defaults ].

      If the variables relate to a specific instance of something that you are making/editing then writing/reading Attributes which are attached to that entity will persist across sessions too [ http://download.sketchup.com/sketchuphelp/gsu6_ruby/Docs/Ruby-Entity.html#get_attribute and http://download.sketchup.com/sketchuphelp/gsu6_ruby/Docs/Ruby-Entity.html#set_attribute ] - an entity can be anything, from the whole model, to a group or component, right down to just one face or edge.

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Volume Calculator v2...

      @unknownuser said:

      TIG,
      Just an idea ...
      With regard to the Volume faces that are reversed, what about applying the users chosen colour / material to BOTH the front AND back faces ???
      It's a bit of a workaround, but it might be the simplest solution ???
      ...
      Howard L'

      Had that and removed it BUT it is a solution...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Volume Calculator v2...

      @unknownuser said:

      TIG,
      See attached.
      I've tried out your new VolumeCalculator Script.
      Really good, very quick.
      ...
      A few Observations / Requests:

      1. Would it be possible to have the script mine down into Groups / Components similar to your Component Reporter - ie the Volume Script would work out the Volumes for the Deepest nested Groups / Components ??? Currently models have to be Exploded down before the script can be run. (This would be my Number 1 request).
      2. Currently when you make a selection and run the script, you are prompted with 2 dialog boxes:
        a. Volume parameters dialog - where you define Layer etc
        b. A dialog which asks "Do you want to leave the original selection hidden for now ?".
        These prompts come up for EACH Group / Component selected.
        It would be much better to have these 2 dialog boxes come up just ONCE for each Selection Set - much slicker. Currently you can get around this by keeping your finger on the Return Key on the keyboard - but I'm sure there is a better way !!!
      3. I've noticed that some Volume faces are reversed - it could be just the file that I'm using to test the script - but it appears OK.
        All Volume geometry does actually have the users chosen colour - it's just that some faces are reversed.
        ...
        If I find anything else I'll post the info here in this thread.
        Other than the items noted above, the script is great, you've done a really good job with it.
        ...
        Regards
        Howard L'

      Thanks for the feedback.

      1. Group/Compo Mining would be quite possible...
      2. A combined dialog for all options once for each selection is quite possible.
      3. The problem with AdamB's great/swift volume-calculator method is that it can give wrong answers if some of the faces aren't consistently oriented. That's why I invented orient_faces.rb at the weekend. I currently make the group and orient faces consistently and make a copy with all faces reversed take the larger volume by comparing them - one's outside-in and the other is outside-out - sometimes a negative volume is reported and this is trapped. Unfortunately, depending on the form of the tested objects tested, it can report the same volume for BOTH options and it then sometimes guesses the wrong one and gives you a reversed-face final volume-group. I have some ideas on how to trap for this so we always get the volume-group's faces the right way round...

      Watch this space...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Explode Into Groups?

      @daniel s said:

      Thank you TIG!!
      It works great!... this will save me a lot of time.
      And a question... because this i can´t done with sketchup.. i put an example on the attachment... is it possible with ruby?
      Thank you again!
      Daniel S

      Groups always have their bounding box square to the axes. Components do not. Try using components ?

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Explode Into Groups?

      See this thread for the answer to your dreams...

      http://www.sketchucation.com/forums/scf/viewtopic.php?p=15423#p15423

      ...

      posted in Developers' Forum
      TIGT
      TIG
    • Explode2Groups

      New script: http://www.sketchucation.com/forums/scf/viewtopic.php?p=15421#p15421

      It adds a context-menu if the 1st in a selection is a group - 'Explode to Groups'. All connected geometry within that group is grouped into separate sub-groups and the original group exploded...

      posted in Plugins
      TIGT
      TIG
    • [Plugin] Explode2Groups

      This script adds a context-menu if the 1st in a selection is a group - 'Explode to Groups'. All connected geometry within that group is grouped into separate sub-groups and the original group exploded...
      Get the latest version from the here...
      https://sketchucation.com/pluginstore?pln=Explode2Groups

      posted in Plugins
      TIGT
      TIG
    • 1
    • 2
    • 981
    • 982
    • 983
    • 984
    • 985
    • 992
    • 993
    • 983 / 993