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!
    Urasik Extensions | Lots of new extensions to check out Learn More
    Online
    • Profile
    • Following 0
    • Followers 13
    • Topics 265
    • Posts 19,821
    • Groups 6

    Posts

    Recent Best Controversial
    • RE: Attributes - Export / Create More / Linking with Database ?

      @gata said:

      TIG, I made all your edits and still get your csv files in RpTools directory.

      I used to have the old ComponentReporter.rb, but renamed it with TXT then removed it from the Plugin directory altogether.

      And I forgot, RpTools Model Report does produce an announcement message after its file is created whereas your plugin only announces where the file will go.

      Seems like RpTools is screwing up the model's folder-path which is what my script uses so as to know where to save the model's reports. It's clear from you screen-shot that your model 'gata' isn't in the RpTools reports folder.
      Please copy and paste the following into the Ruby Console and publish what is given.
      First:
      Sketchup.active_model.title
      This should given the model name without the .skp extension - e.g. 'gata'

      Second:
      mpath=Dir::pwd
      This is your working directory, and should normally be the model's folder - I suspect that RpTools is changing this to suit itself.

      Third:
      Sketchup.active_model.path
      Check that RpTools doesn't mess with this...
      This is the model's folder - I will change my script to use this by default.

      posted in SketchUp Discussions
      TIGT
      TIG
    • RE: Attributes - Export / Create More / Linking with Database ?

      @gata said:

      I'm getting your files now - in C:\Program Files\Render Plus Systems\RpTools

      RpTools reports go to the same directory. Their files are named test_report.txt (and csv).

      No error messages appear in the Ruby console.

      I did not get a closing saying the files were written - even the first time I successfully tried it here. I had opened the files in Excel to see how they look (had to move over the column a bit) then closed Excel.

      I ran your script a second time and still did not get the closing message. The only message I get is one saying it will save the files to the RpTools directory.

      XP Pro, SP2.

      The older/simpler ComponentReporter.rb made a csv [comma] and a txt [tab] file, BUT that went into the model's folder and were named as the ModelName-ComponentReport.XXX
      The new version only makes the csv file and has a '+' sign after Component in the file name. Clearly what you are running isn't my script. I don't have the RpTools so I don't know what they do. If there is 'Class' clash it might cause my menu item to run something in their script...
      To test this make a backup copy of my ComponentReporter+.rb script, open the original in Notepad [or another plain text editor BUT NOT a word-processor !]. Find and replace Reporter (which is the Class) with say ReporterPlus for every instance thus:
      ...
      class Reporter >>> class ReporterPlus
      ...
      def Reporter::components_plus >>> def ReporterPlus::components_plus
      ...
      def Reporter::miner(ents) >>> def ReporterPlus::miner(ents)
      ...
      xlist=Reporter.miner(elist) >>> xlist=ReporterPlus.miner(elist)
      ...
      full_list=Reporter.miner(all_list) >>> full_list=ReporterPlus.miner(all_list)
      ...
      UI.menu("Plugins").add_item("Component+ Report"){Reporter.components_plus} >>> UI.menu("Plugins").add_item("Component+ Report [TIG]"){ReporterPlus.components_plus}
      ...
      Note when you scroll to near the end and find the menu string - you should add something onto the text like [TIG]. Save the file and re-run.
      You should now get an item in the Plugins menu with the [TIG] in itthat runs my script alone...

      posted in SketchUp Discussions
      TIGT
      TIG
    • RE: Attributes - Export / Create More / Linking with Database ?

      @unknownuser said:

      TIG,
      Thanks for putting this mining ability into the Reporting Tool.
      However, I'm also getting a similar error message to the one described by gata
      (see attached)
      ...
      Regards
      Howard L'

      Well at least you are getting that error !!! - I've been trying to get it for some time - without success ! It's not a clash with other scripts (I think) - where was the 'test' skp saved ?

      I added an extra bit in when I made the 'miner' that tries to check if the report file is open before you start to write to it. For example you make a report and open it, you leave it open and try to make a second report - this time it can't write to the file since you already have it open in another program. It fails dumping errors into the Ruby Console. I've tried to trap this in an error message - with little success.

      Here's v1.3 that has that part disabled till I get it going better. Meanwhile it works as advertised. IF it doesn't end with the closing message saying what it's written where then chances are it's failing because the older report is still open and you forgot to close it...

      301 Moved Permanently

      favicon

      (www.sketchucation.com)

      posted in SketchUp Discussions
      TIGT
      TIG
    • RE: Attributes - Export / Create More / Linking with Database ?

      I decided that adding the 'mining' ability wasn't too hard... so here's v1.2

      301 Moved Permanently

      favicon

      (www.sketchucation.com)

      You now get the chance to 'mine' down through nested-groups/components to get a report on all instances found - either 'all' or in an initial selection.

      posted in SketchUp Discussions
      TIGT
      TIG
    • RE: Attributes - Export / Create More / Linking with Database ?

      @unknownuser said:

      TIG,
      V 1.1 really is excellent.
      It's extremely useful being able to run this script on a selection from a model.
      I think many people will find this script useful
      For an example see:
      http://www.sketchucation.com/scf/viewtopic.php?f=22&t=3429
      (your script could now be in Siberia !!!)
      ...
      Currently I'm running the script on a model containing many components.
      Originally some of these components were contained within other components (nested) others were grouped together.
      ...
      I found that the script does not drill down into nested components or grouped components.
      Not a huge problem as a workaround is to explode the larger components and groups.***
      However, would it ever be possible to have the script drill down into more complex (nested) components and groups to get at the buried ones ???
      ...
      Thanks once again for all your help
      Regards
      Howard Leslie

      The script first reports ALL component definitions and how many times they are placed/used, of course this might include components nested inside other components etc. It then makes a report of all placed Instances that are accessible directly within the model. An alternative is to select a collection of objects containing some instances and it'll offer the option of reporting just on those.

      ***No need to explode anything... IF you have component instances inside groups or within other components then you can simply edit that group/component and select all - you then run the script and will get the chance to make a report of just the instances in that selection.

      It COULD mine down into all component instances definition or groups and report on the internal bits... but you have to stop somewhere. Simply clicking the group/component to edit and Ctrl+A to select all before running it will give you a list of what instances are there...

      I have previously made 'group_miner.rb' that does just that iterative delving into nested things BUT unless there's a massive clamour for it I won't be adjusting this script immediately...

      posted in SketchUp Discussions
      TIGT
      TIG
    • RE: Attributes - Export / Create More / Linking with Database ?

      @unknownuser said:

      TIG,
      Thank you very much for updating your ComponentReporter Script - it's really good.
      Hugely appreciated.
      Adding the extra fields is brilliant - this is so useful.


      The only other adjustment you could make to the script would be to make the script report out all geometry (by default) - as now.
      HOWEVER,
      If you make a selection, then only the selected items will be reported upon.


      The above is really a nice to have (if you had time)- it's not essential.


      Thanks once again for modifying yor script.
      Regards
      Howard Leslie

      I think this is what you want ?
      http://www.sketchucation.com/forums/scf/viewtopic.php?p=6684#p6684
      (v1.1)

      301 Moved Permanently

      favicon

      (www.sketchucation.com)

      posted in SketchUp Discussions
      TIGT
      TIG
    • RE: Attributes - Export / Create More / Linking with Database ?

      @unknownuser said:

      TIG,
      I've tried out your Component Reporter - Works Pretty Well (also VERY fast).
      I do, however, have a couple of requests.....
      If you have time, could you expand the CSV to include the following fields:
      Layer
      Name
      Definition Name
      Material(ie Colour)
      ... If Poss ...
      SU Geometry ID No (if it exists) ~ Acad Handle
      Any other useful attributes
      ...................................
      Currently the Name field in the CSV is actually what the Entity Info Dialog Box calls the Definition Name. It would be good to have these the same for consistency.
      ...
      Regards
      Howard Leslie

      Something like this ?
      http://www.sketchucation.com/forums/scf/viewtopic.php?f=153&t=1524

      posted in SketchUp Discussions
      TIGT
      TIG
    • RE: Attributes - Export / Create More / Linking with Database ?

      Here's away of making a CSV that I was involved in a while ago...

      You could expand it to include whatever you like - geometry, layers, attributes, materials etc...

      ComponentReporter.rb

      posted in SketchUp Discussions
      TIGT
      TIG
    • RE: Array

      As well as the in-built tools for linear and polar arrays, using Ctrl-key + Move and Rotate respectively, followed by xNumber to multiply or /Number to divide; there are several Ruby Plugins - e.g. my Matrix+Proximity does 2D and 3D arrays, with the added possibility of randomized offsets, rotations, scaling etc. There are also others out there if you need them [e.g. Grow.rb]...

      posted in SketchUp Discussions
      TIGT
      TIG
    • RE: How the RUBY apply a dimension(with label, dimension line wi

      There is a trick that could do this...

      I'll use 'metres' in the example below but you can adjust this to suit whatever units you want...

      Make a 1m long dimension (X) against a horizontal edge - in a 'flat' XY orientation, with a 1m long leader offset (Y).
      Highlight the dim and make it into a component - called let's say 'Dim'.
      Save it externally as its own 'skp' - into a logical folder path.
      In a model, your script then inserts an instance of Dim.skp from the folder.
      In your model/script you have the required edge...
      The edge has a knowable length (let's say 2.1m), so your script transform scales the instance proportionately by x2.1 in X.
      The figured dimension will automatically adjust to 2.1m to suit.
      You can also adjust the leader scale (Y).
      Transform the instance location and rotation to suit the edge's.
      You now have a dimension that reflects the edge's length and orientation. You can also use this method to script a 'dimension' between any two known points...

      You might also be able to change the 'orphaned dim' colour to match the normal dim's colour ? Not sure how to access/set this ???

      The dim's arrow heads will scale in the X... too so you might want to make a set of Dim skps - say 1-100mm, 100mm-1m, 1m-3m, 3m-10m etc and then insert instances of them to match nearest to the edge's length - so that the subsequent scaling of them wouldn't distort the dim-compo's arrow heads too much...

      You could also 'connect' the edge and component-dim using attributes and observers, so if the particular edge changed, then the associated dim-compo could be adjusted automatically to suit... It would then behave very much like a normal associated dimension.
      This could be all very convoluted to achieve, BUT it's still possible...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Is instancing possible?

      Pick one of the 'tree-to_go' instances.
      Use 'Entity Info' to get the Compo'Definition name [if you don't know it already].
      In the Comp'Browser 'In Model' tab hover over that compo's icon.
      Right-click to get the context-menu.
      Choose 'Select Instances'.
      All of the 'tree-to_go' instances are now selected [highlighted].
      Now still in the Compo'Browser find and hover over the compo 'tree-to_swap' icon.
      Right-click to get the context-menu.
      Choose 'Replace Selected'.
      All of the 'tree-to_go' compos have become 'tree-to_swap'.

      Done.

      This Ruby-less method lets you select and work on / swap compos etc quiet easily...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Is instancing possible?

      Look for my Matrix Proximity script(s).

      Matrix lets you place 2D/3D arrays of components at set XYZ spacings and with randomized spacing, rotation, and scaling/handing etc as desired. It then lets you 'drop' these onto any surface below the matrix.

      If you have a family of components called tree01+.skp, tree02~.skp and tree01-.skp for components that are near(+), mid-distance(~) and far-away(-) - with appropriate degrees of complexity in their modelling, then you could use the '-' version for all modelling - whether it's by matrix OR manual placement...

      Then when you are done and you have set up your views you can use Proximity. This lets you set the range of near-mid and mid-far from the camera and swaps any nearby components with the more detailed ones as specified - For example only trees within 10m of the viewer might have leaves etc and 10m-30m might be simple 3D but beyond that the '-' version could be a 2D lollipop with face-me set...

      Take your images... swap all to '-' trees again then change view re-run Proximity etc etc...

      This minimises the file size and speed of regens etc...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Vector.angle_between() -- Direction?

      If you have pathcopy.rb you get vector.flat_angle.rb...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: How can I assign a keyboard key as a SketchUp shortcut

      It IS possible to modify and add shorcuts to the PC registry using SketchUp Ruby methods [search other recent threads on this] BUT I would not recommend it unless it's for 'in-house' use only. As TBD says imagine the chaos it'd cause if your script messed up everyones pre-set shortcuts...

      IF you want to do this then at least offer the choice - make your script with an installer [part] which checks to see if the shortcut has already been used, and with a dialog that asks something like, "Would you like to assign 'Q' as the shortcut key for this tool ?" and if it's already pre-set, "\nNote that 'Q' is currently used for xxxxxxxxxx."; Yes/No. If Yes then you make / change the shortcut. The installer only auto-runs once - on exiting the dialog it also writes something into the registry that is checked by it when it's about to run again, and if that's found then doesn't even ask.

      This way the user has the option - and at least then knows that a key has been assigned...

      posted in Developers' Forum
      TIGT
      TIG
    • RE: Mover does not go

      You should have a script called 'JimFoltz.rb' in the Plugins folder that loads everything else...
      Inside the Plugins folder you should have a folder called 'JimFoltz'.
      Inside that you should have three sub-folders. These are called:
      'files' - containing 'mover.html'
      'images' - containing 6 jpg images for the buttons (e.g. 'arrow_blue_dn.jpg')
      'scripts' - containing 'mover.rb'

      THEN it will work and appear in the Plugins menu...

      posted in Plugins
      TIGT
      TIG
    • RE: Shortcuts Plugin Possible?

      There are already some threads about this...
      Dead link

      On a PC there is a Registry entry for the shortcuts - run Regedit to see it.

      MyComputer...
      HKEY_CURRENT_USER\Software\Google\SketchUp6\Settings

      Num_Shortcuts >>> contains number of short-cuts as a 'number' e.g. '999' (not sure if it's in decimal or hex ?)
      named thus:
      Shortcut_1 to Shortcut_999 etc...

      each contains the shortcut entered thus:
      "0 0 0 A selectArcTool:"
      where the first three are the three modifier keys Ctrl:Alt:Shift [on:off=1:0], the next is the key itself [ABC etc] and then the action...

      If it's not a built in SUp action then the path to the Menu item shows thus:
      "1 0 1 S Plugins/Steel Sections"

      With some ingenuity you could script something that'd re-write this using the built in:

      Sketchup.write_defaults("section","variable","value")

      (there is also a read_defaults method to find what's already set)...

      posted in Developers' Forum
      TIGT
      TIG
    • [Plugin] PipeAlongPath

      PipeAlongPath
      TIG (c) 2005 - 2014
      All rights reserved.
      Description : Creates circular faced 'followme' pipe extrusions along a path -
      Use it to make pipes, ducts etc, starting from a selection of joined edges
      Usage :
      Select joined lines, arcs, circles, curves, etc.
      Select "Pipe Along Path" from the Plugins menu.
      In the dialog choose:-
      Outside diameter: in current units or use suffix for other, default 110mm/4"
      Inside diameter: in current units or use suffix for other, default 110mm/4"
      Number of segments: default 24
      Cpoints?: [Yes/No, default=true to add cppoints at the pipe's vertices]
      Cline layer: [layer for the path, default="XCLINE", make blank for 'none']:
      In group?: [Yes/No to move selected path into pipe's group, default=true]
      OK.
      Last used setting are remembered across sessions.
      The pipe-extrusion is made*.
      The pipe-extrusion is grouped so it does not interact with adjacent surfaces -
      afterwards just explode it if appropriate.
      Edit it to intesect with model and tidy up to make tees etc...
      The pipe also has construction points added at vertices if you set Cpoints=true.
      These can be used for snapping, if not wanted 'erase construction geometry'
      will remove them globally or just within a group that you are editing.
      One Undo to remove the construction points, a second to Undo the Pipe itself.
      The default for extrusion face segments is 24, the minimum is 3.
      The alignment is always 'Centroid' - along the pipe's centre line.
      The diameter is always measured square to the vector of the
      first path's line. A diameter that is less than the length of pieces of path
      edge might give correct but unexpected extrusions, which might need manually
      tidying...
      Closed loop paths are fully extruded in a loop.
      Multiple arcs and other complex 3D paths might give unexpected results.
      Note that SketchUp can't handle very small faces in its FollowMe mode - so any
      Arc bends of 8" radius or less that have the same radius for the pipe (o/d)
      applied will almost certainly cause a crash / "bug splat" and are trapped out
      BUT note that similar radii in 'welded' Curves are NOT easily trappable and so
      they may always cause a crash with a "bug-splat", so avoid using these type of
      path with small radii bends/pipes - or you can keep it but use 'scale' as
      explained below...
      IF you must have this matching small diameter pipe and arc or welded elbow
      bends then to get it to work you can make the path a
      group, scale it by a factor so it's larger (say x10), then
      edit it and use this tool within it applying the diameters x10,
      after it's all made scale the group back down by x0.1 and
      explode it and it'll all be OK.

      Both diameters cannot be zero and will return an error.
      If one of the diamaters is zero then you get a 'tube' rather
      than a pipe.
      If the diamaters entered are equal the inside one is taken as
      zero and you will then get a 'tube' rather than a pipe.
      If the inside's diameter is greater than the outside's then
      they are swapped.
      A branching path returns an error as 'FollowMe' can't decide
      which path to take.
      Selected edges that are not joined (i.e. they don't all have
      common ends-starts) will not be extruded - only the first edge
      or joined group of edges will extrude.

      Version :
      1.0 18/9/5 first release.
      1.1 18/9/5 visual segmenting of arced sections etc addressed.
      1.2 9/2/6 centrepoints added at vertices of non-looped paths,
      occasional reversed faces on single 'up' line fixed.
      1.3 16/2/6 undo of cpoints fixed, diam <8" with matching arc
      elbow bend radius bug splat trapped (but not curves).
      1.4 2/5/6 group name -> OD=xx ID=nn with " or mm as units.
      1.5 3/5/6 Transposed ID/OD fixed (sorry!).
      1.6 12/5/7 @error=0 ### fix
      1.7 20121019 Rehashed to modern standards, dialog based options to add cpoints
      at nodes, put selected path onto a specified layer and move the
      path inside the pipe-group.
      1.8 20130115 Fixed typo glitch when path was lone vertical downward line.
      1.9 20140303 Lockup weirdness trapped. Any units format now allowed.
      Last used options remembered across sessions and globally.
      2.0 20140304 Lockup skewed warning improved. Graphics glitch fixed.
      Name reflects if internal_diam == 0.
      2.1 20141111 Slight skew in path - trapping improved.

      Get the latest version from the PluginStore http://sketchucation.com/pluginstore?pln=PipeAlongPath

      posted in Plugins
      TIGT
      TIG
    • RE: [Plugin] Align 2d

      Will look and get back to you a.s.a.p...

      Edit: After an hour I'm 'stumped' - I'll sleep on it and get back to you [on year]...

      posted in Plugins
      TIGT
      TIG
    • RE: [Plugin] Align 2d

      Thanks Didier, it works OK but sometimes gives an error =

      Error: #<ArgumentError: Cannot convert argument to Sketchup::Point3d>

      referring to the line:

      translate = Geom::Transformation.translation( origin.vector_to( inters_point ) )

      Can't see immediately why ?

      The 'test for selection' doesn't give you the context-menu IF only one object is selected - why have the test for "and ss.length==1" ? Is this connected to the error message ?

      posted in Plugins
      TIGT
      TIG
    • Sectioncutface.rb

      Yes v6 is OK: until you prove otherwise !!!

      posted in Plugins
      TIGT
      TIG
    • 1
    • 2
    • 987
    • 988
    • 989
    • 990
    • 991
    • 992
    • 989 / 992