ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
  • Windows and Mac...are the Ruby the same for both?

    8
    0 Votes
    8 Posts
    591 Views
    C
    Thanks for everyones input. I'll pass it on to my friend.
  • WebDialogs: To sub-class or not?

    3
    0 Votes
    3 Posts
    284 Views
    A
    a) subclassing and instancing b) instancing If you only need a window to display information, b) would do it. But if your dialog is more complex, subclassing seems to be a good choice, because you can let your class do a lot of things, i.e. generating the HTML by overriding the original set_html method: class AzubyDialog < UI;;WebDialog private def generate_html arg s = '' # TODO; implement your HTML generator code s end public def set_html arg super(arg.kind_of?(String) ? arg ; generate_html(arg)) end end azuby
  • Ruby challenge 2 ?

    18
    0 Votes
    18 Posts
    2k Views
    M
    WHOA, So I have to give a try to the free versionof SU7, but, I think my computer will begin to say ARRGHH... (quite old... )
  • Help with Copy Along Path....

    13
    0 Votes
    13 Posts
    596 Views
    C
    Done in 4 pcs.... [image: ZOfu_hose.jpg]
  • REQ: ANother camera

    31
    0 Votes
    31 Posts
    2k Views
    O
    hey guys.. you think that i'm crazy??
  • Joint Push Pull Question

    2
    0 Votes
    2 Posts
    306 Views
    ToboboT
    I think Fredo6 is the best to answer this question. I would post it here http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=6708&st=0&sk=t&sd=a&hilit=joint+push+pull
  • Sketchup game

    3
    0 Votes
    3 Posts
    451 Views
    chrisglasierC
    @dhruv said: How can I load different .skp files to my game from webdialogue?(I want to do this cause I dont want to go every time to drop down menu from plugins and load the map) Not truly professional I'm sure but this works #RUBY @dlg.add_action_callback("load") {|d, p| a= p.split(",") subDir ="Components/NamesetComponents/" fileName = a[0]+".skp" model = Sketchup.active_model entities = model.active_entities theX = Integer(a[1]).mm theY= Integer(a[2]).mm theZ = Integer(a[3]).mm point = Geom;;Point3d.new theX,theY,theZ txyz = Geom;;Transformation.new point path = Sketchup.find_support_file fileName, subDir definitions = model.definitions componentdefinition = definitions.load path instance = entities.add_instance componentdefinition, txyz theDegrees = Integer(a[4]).degrees theAxis = a[5] rv = Geom;;Vector3d.new(0,0,1) if theAxis == "z" rv = Geom;;Vector3d.new(0,1,0) if theAxis == "y" rv = Geom;;Vector3d.new(1,0,0) if theAxis == "x" tr = Geom;;Transformation.rotation(Geom;;Point3d.new(instance.bounds.center), rv, theDegrees) instance.transform! tr } //JAVASCRIPT function loadSkpFile(){ param = new Array(theFile,theX,theY,theZ,rz,theAxis) param = param.join(",") window.location.href = 'skp;load@'+param } @dhruv said: How can I open a web - browser by left clicking on the model? (Something like onclick function from maybe dynamic components) As I understand it, you can do it with a selection observer, but I haven't figured out the code for that. Hope this is useful. Chris
  • WebDialog crashes Sketchup

    5
    0 Votes
    5 Posts
    496 Views
    A
    Hm OK, you see me surprised. Till now I have used an HTML code similar to the following for my "Update" button: <input type="button" onClick="javascript&#058;window.location = 'skp;foo@'; return false" value="Update"> After I changed it to: <input type="button" onClick="javascript&#058;window.location = 'skp;foo@bar'; return false" value="Update"> Sketchup doesn't crash any longer. puts "Well, and now I'll clean up my Ruby code." what the f... =begin azuby =end
  • Is it possible...

    7
    0 Votes
    7 Posts
    811 Views
    TIGT
    @whaat said: Is it possible to enter 'component edit mode' with Ruby? Is it possible to prompt the user to browse for a file folder (not a file)? If not, consider these requests for the next service release of SU. Thanks. I used a trick to edit groups [PC only] - components could be done similarly... require 'sketchup' require 'win32ole.so' def edit_group ### an example of access SUp tools not otherwise available... ### make shortcut here if NOT set already = ctrl+alt+shift+G ### check that you have one group selected and if so do this... WIN32OLE.new("WScript.Shell").SendKeys("+^%{g}") end#def ### run it from within other tools ### the menu here for test only... if(not file_loaded?("edit_group.rb")) UI.menu("Plugins").add_item("Edit Group"){edit_group} end#if file_loaded("edit_group.rb") ### This is how I find a directory - you do need to pick a file in it though... require 'sketchup.rb' #----------------------------------------------------------------------------- def materialimporter model= Sketchup.active_model materials= model.materials model.start_operation ("Import Materials") ###undo - see commit at end pwd= Dir.getwd.split("/").join("\\")+"\\" ### fix for SU drctry= UI.openpanel "To Pick this Directory; Pick Any Image File + OK...", pwd , "*.???" return nil if not drctry drctry= File.dirname(drctry) return nil if not drctry cwd= Dir.chdir(drctry) images= Dir["*.{jpg,png,tif,bmp,gif,tga,epx}"]### for all supported image file types for image in images imgname= image.split(".")[0..-2].join(".") ### removes .jpg etc from end mat= materials.add(imgname) mat.texture= image end#for image### model.commit_operation ###undo all if needed end#def### .
  • Selection

    3
    0 Votes
    3 Posts
    308 Views
    R
    Thanks for the reply, but I still can't get it to work. #This works when I select everything with a mouse #I have the transform "t" defined elsewhere model = Sketchup.active_model.selection Sketchup.active_model.active_entities.transform_entities t,model ...... #I tried this to select everything without the mouse, but it does nothing model = Sketchup.active_model.selection.add(Sketchup.active_model.entities) Sketchup.active_model.active_entities.transform_entities t,model
  • Req script to draw squares by specifying the area

    6
    0 Votes
    6 Posts
    479 Views
    T
    I have a tile maker.rb file I created. It can be used to make cubes of uniform dimensions of a selected area. I don't know if this tool would be helpful for what your are describing. attached is a short wmv file. tile.wmv
  • Save as sketchup v6

    6
    0 Votes
    6 Posts
    468 Views
    thomthomT
    @cheffey said: I'm not sure how long it will be until we switch to 7, due to the economics of our industry. Will the free version of 7 work ok installed alongside the Pro version of 6? Yes.
  • Help! Ruby and Sketchup information required!!!

    3
    0 Votes
    3 Posts
    342 Views
    R
    I'm willing to help in any way I can, but I don't know of many articles or publications about customizing SketchUp via Ruby. I've done my share of scripting, but I just don't know of much written about what we rubyists are doing. There are some discussions on the old SU ruby forum (and some here) that get into some technical issues, but I don't know if that will meet the criteria for the types of sources you need. Feel free to contact me through Smustard if you have any specific questions. If I can, I'll be happy to help.
  • Scaling

    2
    0 Votes
    2 Posts
    253 Views
    Dave RD
    Now that would be an interesting plugin. Just think of being able to download all those models folks have drawn and uploaded to the warehouse without bothering to draw them correctly. Good luck with this.
  • Web dialog import/export

    3
    0 Votes
    3 Posts
    1k Views
    chrisglasierC
    That sounds interesting. Do you know of any better reference material, the one you tagged is mainly just headings. Please let me know if you have a moment to spare. Chris
  • Full ruby documentation for SU7?

    2
    0 Votes
    2 Posts
    355 Views
    R
    I think its currently being updated, you should be ale to find it here when its finished: http://code.google.com/apis/sketchup/
  • Right click suppression

    3
    0 Votes
    3 Posts
    310 Views
    R
    Well.. it looks like I need a ruby-predator that would kick others out.)
  • Review entity count per group/comp?

    3
    0 Votes
    3 Posts
    271 Views
    chrisglasierC
    Quite a different topic but have a look at the bit of code in this post: http://www.sketchucation.com/forums/scf/viewtopic.php?f=180&t=14299 As it walks through the groups and components, I guess you only need to add some code to count the faces and edges of each. Outputting to a webdialog would be good so that you could use some javascript to list rogues as links so you can identify and fix them one by one*. I would be interested to find out if this approach turns out to be useful. Chris edit: or in batches of same problem
  • [Help]How to get the path where SU6 is installed?

    3
    0 Votes
    3 Posts
    222 Views
    fredo6F
    Wikii in Ruby, use Sketchup.find_support_file "" Fredo
  • Advanced Ruby Sketchup

    2
    0 Votes
    2 Posts
    268 Views
    D
    Oh , I just saw Scott did upload his script, anyways we can have general discussions for developers around and feedbacks of what can be done further with this kind of simulation. Cheers, Dhruv

Advertisement