🫛 Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
  • Yet another script Idea

    2
    0 Votes
    2 Posts
    303 Views
    C
    @remus said: this is mre a long term wish if anyone's ever feeling really kind My limited knowledge of ruby tells me it should be possible, but i reiterate the limited part. So, what would be really cool is to have a ruby that could cut standard sized countersunk holes for you. Much like the holes wizard in solidworks if anyones used that before. ideally, it would kinda go like this: 1)start ruby 2)click where you want the hole 3)select hole size and wether or not to countersink it thanks I know this is an old post, but a search for "countersink" brings up nothing newer, so I'll second this! I guess it may be a variation on "holes" scripts, but the specific functionality of this script's understanding standard hardware sizes, the correct bevel angles (they're not 45) and countersink depths, etc. would be tremendous for those of us sending models to metal fabricators! I'd modify the requested functionality -- since holes don't copy easily, I think that starting the script, selecting the fastener, then click, click, click... to "drill" countersunk holes. To ice the cake the script would understand correct pilot hole diameters as well as clear-hole diameters -- so you'd set the screw size (ie #10 or M6), then toggle for Clear/Pilot, check box for countersink, and off you'd go! And while I'm wishing, it could place the appropriate screw component (or not). If wishes were horses... -Carl-
  • Structure of my Ruby files

    9
    0 Votes
    9 Posts
    260 Views
    Dan RathbunD
    require 'sketchup.rb' This is cross-platform, not Windows only. It belongs at the top of the file. # pull in the standard API hooks. This NOT true. The API "hooks" are always loaded (if embedded Ruby is loaded,) by the Sketchup executable. (sketchup.exe) 'sketchup.rb' adds a few global methods like file_loaded() and file_loaded?(), and does not need to be required, unless you will use methods from that file, in the specific script, you are writing. You should read the "Tools/sketchup.rb' file to see what methods it has that you can use.
  • Interaction with objects for simulation

    16
    0 Votes
    16 Posts
    549 Views
    Dan RathbunD
    @nickinwv said: "Do I need SU Pro to use dynamic components?" Not to use. You can can insert them (from say the 3D Warehouse, or the samples installed with Sketchup.) You can copy them, scale them, move them, etc. You can change their options. You can interact with them, via the Click Interact tool. (You'd need to turn on the DC toolbar.) Pro is only required if you wish to create or edit DCs via the app's GUI. Setting their options is somewhat involved (and there's a whole separate forum here for discussing DCs.) Advice... Learn Standard Ruby first. (The Sketchup API is just 3 modules, with encapsulated classes, that extends Ruby.) Then start with simple plugins and macros first. (Learn to crawl, before you try to walk, and before attempting to run.) Study what others have done first. (Stand on the shoulders of giants. Pay attention to the work of the most prolific coders in the Code Snippets index, and the Plugins Index (Plugins Forum).) Animation is an advanced catagory. Make sure you visit the Code Snippets index. (Jim Foltz posted an animation example I believe.)
  • How to install a Ruby Gem for use in SketchUp

    27
    0 Votes
    27 Posts
    10k Views
    Dan RathbunD
    Good job Derek ! 1) Now can you d/l and install gems from within Sketchup embedded Ruby ?? 2) You are running OSX Lion, so I assume your machine is Intel based. I wonder why you need to add platform dir paths for a PowerPC (MacOS9) platform ?? 3) The following dir paths should not have files in them, only subdirs. Why add them ?? " /Library/Ruby/Site" " /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/vendor_ruby" 4) You also add the current working directory, ie: " ." (which can change from time to time, via calls to Dir.chdir in other author's plugins.) So, is this necessary for RubyGems ?? 5) After require('rubygems') returns (sucessfully,) has it added any paths to the $LOAD_PATH array ??
  • Undocumented Geom::Transformation methods?

    2
    0 Votes
    2 Posts
    111 Views
    Dan RathbunD
    They are added by the DC extension.
  • SketchUp developer IRC channel - #sketchup-dev

    6
    0 Votes
    6 Posts
    439 Views
    RichMorinR
    I was out of town for a couple of weeks, so the channel went away, but I've restarted it.
  • Auto-running a Mac '.command' File from Sketchup?

    15
    0 Votes
    15 Posts
    3k Views
    Dan RathbunD
    Well I am NOT an expert on threads. Doc: http://www.ruby-doc.org/core-1.8.6/Thread.html What we DO know is that they were CRAP on PC with Ruby v1.8.0 They are better, in v1.8.6-p287, likely even better in v1.8.7 branch. But they are still Green threads, not native threads (at least on PC.) I'm not sure if Apple tweeked the Ruby editions they install on Macs, and what 'kind' of threads you get, on Apple platforms. If you want your "thing" to work on older SU versions, the API's thread-like UI.start_timer() block method may be a better choice. Otherwise... if the rdocs are too techno.. check out all the books on Ruby. Maybe tutorials on the web. We've avoided them on PC because they were too problematic (... likely because PC Sketchup was running Ruby v1.8.0 for so many versions.) I never (on my machine,) ran Sketchup with the obsolete initial release of v1.8.0; always something >= v1.8.6-p111 ~ If YOU get comfy with Threads on Mac (under Sketchup,) a tutorial may help others out.
  • [Code] orient_faces.rb v1.2

    9
    0 Votes
    9 Posts
    5k Views
    Dan RathbunD
    @dan rathbun said: This code extends API base class **Sketchup::Face** ... There should be warning, in the OP, and probably the file header doc. @dan rathbun said: without checking to see if the methods exist first, I knew you'd fix it promptly. @dan rathbun said: despite that fact that TIG always tells others not to do this. Couldn't resist teasing. (I DID notice it was 4 years old.) I still believe that adding methods like this, belong in a community project, like SKX. (I still have hopes of reviving that project, or starting a similar one.) @dan rathbun said: This script is going my API doghouse list. I really do not have a "script dog house" list. (Have thought of doing one though.)
  • Getting unexpected result when setting material color

    7
    0 Votes
    7 Posts
    239 Views
    thomthomT
    @dan rathbun said: As I recall, only materials took (or used to take,) alpha. Colors did not. They do, and did. It's just that they wheren't used until SU let you draw to the viewport with transparency.
  • SketchUp as a Game Editor?

    2
    0 Votes
    2 Posts
    137 Views
    thomthomT
    @alz said: How does SketchUp handle a scene with thousands of objects in it? That depends on the objects... it's a bit ambiguous question. Got some specific examples? @alz said: I'd love a reason to spend more time inside of SketchUp if I think it can deal with a variety of primitive objects that represent game logic objects and the intertwined game data they hold. You mean physics simulation? Like SketchPhysics?
  • Mac Ruby Console is multi-line

    9
    0 Votes
    9 Posts
    1k Views
    D
    Hi all you avid followers... For the record, I've been using the modified nib constantly for a over a week now and thought I'd make some comments. The cursor is a little hard to spot in 'hud' mode as I can't change it from the normal text input 'black', but being able to see through to the model more than compensates. It's hard always remembering to Alt/Return for newLine as Return is Submit. I have it set to always stay on top, very handy when working with an external editor, but I'd rather be able to toggle that. I discovered last night that it has a back/forward function, i.e. using the arrow keys you can go back 1..3 inputs, tweak and re-submit. This makes a inputing instead of newLine error a bit less of an issue. If there are any mac users interested in trying this out 'speak up' or is it t'ype up'. I'm happy to PM my 'findings' for your perusal, but I won't be attaching NIB files to this post. john
  • Syntax error + no sleep + crummy suspension = please help!

    11
    0 Votes
    11 Posts
    334 Views
    TIGT
    Assuming your code goes before the face is made mat1 = mats.add("Wood_Plywood_Knots") makes a new material named "Wood_Plywood_Knots". It will be 'black' [0,0,0] with NO texture as you haven't [yet] specified a color or a texture-image... If that material already exists it gets a numeral suffix... If you haven't defined 'mat1' when you assign it to the face it's like writing face.material=nil which is saying use the default front_face_material, which it already has! OR it cause a crash - what's in the Ruby Console... Ensure a material is made before you use it... IF you were to read/understand my earlier notes... they explain step by step how to make/use a material, give it a color and give it a texture [image-file]; then adjust that texture-image and match the material's color to it etc...
  • [Help] Straight Skeleton Implementation

    5
    0 Votes
    5 Posts
    441 Views
    TIGT
    The 'Housebuilder' plugin does the framing for roofs and floors/walls/openings etc... See the Plugins Index or the 'crai' Depot [Didier Bur's]... Thrre are two versions - one for metric and the original for feet/ins...
  • How to batch modify description of sketchup file?

    3
    0 Votes
    3 Posts
    215 Views
    dereiD
    thank you very much, TIG ! I will look over your plugin!
  • Icon to layer connection?

    6
    0 Votes
    6 Posts
    179 Views
    Dan RathbunD
    I know what AutoCAD can do (I've been using it for over 25 years.) Suddenly your talking menus (which I have no problem creating in Sketchup. I can even using system calls create a toplevel menu, if I wish to. But Google does not seem to want us to do this in a general sense. They want everyone's main menubar to look the same, for tutorial purposes, I suppose.) Back, on saubject. Commands. The API allows us to create commands. I even told you how I would do the specific one you ask about. I am in the process of creating my own Cline tool, so perhaps I'll expand it a bit to Text, Dimension, and 3Dtext; .. since I was gonna have a default Cline Layer. It would be just adding in some more elsif clauses, and so forth.
  • [Bug] model.valid?() on PC

    3
    0 Votes
    3 Posts
    84 Views
    Dan RathbunD
    I do not know if it is new. I just ran across it. Could not find a bug report, so I filed one. This post is just a "head's up" notice.
  • Storing attributes?

    10
    0 Votes
    10 Posts
    382 Views
    T
    thanks Dan and Tig I will have a look at that!
  • A Question on Making a GUI

    4
    0 Votes
    4 Posts
    161 Views
    thomthomT
    Here's a topic I've written with practical info about the WebDialog class: http://forums.sketchucation.com/viewtopic.php?f=180&t=23445#p198883
  • PdScript-interpreter for GUI Scripting in SketchUp-Ruby

    14
    0 Votes
    14 Posts
    6k Views
    H
    Hello, I made a small page for the sketchup plugin on my website. I updated the above link for the download. Hans-Peter
  • NewLISP-interpreter in SketchUp-Ruby

    16
    0 Votes
    16 Posts
    3k Views
    H
    Hello, I made a small page for the sketchup plugins on my website. I updated the above link for the download. Hans-Peter

Advertisement