🏢 PlaceMaker | 25% off for February including new Google Earth data imports! Learn more
  • Catching the ready event for webdialogs on Mac?

    6
    0 Votes
    6 Posts
    169 Views
    thomthomT
    Thanks jeff. It didn't help for this, but it'll be useful for other stuff. I found the core of the problem. Well, there was two issues. On PC the webpage is created when you call .show. On Mac it seems to be called immediately as you add HTML to the Webdialog class. So in my case, the ready event was triggered when the ruby loaded and therefor was sent to the console while it was closed. My other problem was in the difference in how files where read between PC and Mac, I got some trailing whitespace on Mac while reading a file line by line. That caused a bug which mangled the JSON string I sent to the webdialog. On the Mac any JS error messages was suppressed so I got no feedback on this. (Unexpected as on PC I get a popup warning.) Now it all seems to work. Though - I'm not too happy that the Mac loads the HTML document when I create the Webdialog class. I'd like to behave as on Mac. Seems that I have a few things to report to the bugtracker tomorrow...
  • Additions to the sample Box.rb

    4
    0 Votes
    4 Posts
    182 Views
    K
    As I understand SU when I leave layer0 as the active layer then all of the components details or drawing information remains on layer0 and moving it to a new layer via the "I" information form only affects the visibility of the component. So that is what I want to do the same as if I selected the component pressed "I" and changed the layer to new layer I just created. I hesitated to use the term move the component to the new layer as I understand that is not really what happens. My layer management plan for woodworking projects is such that each part is made a component and has a Assembly layer (A01TableTop) and a part layer for the dimensioned drawing (P01TableTop). I also have an Assembly Scene that makes all the parts in the assembled position visible. My box.rb now creates these layers as hidden so they don't show up in scenes where they are not wanted. In a perfect world for me box.rb would also: 1.Place the first instance of the component on the new named assy layer. 2.Place a copy or second instance of the component on the new named part layer. 3.Add the assembly layer to the Assembly Scene. Thanks Keith
  • WebDialogs and JavaScript events

    2
    0 Votes
    2 Posts
    90 Views
    thomthomT
    I'm using jQuery to take care of such things.
  • Rotate Current View 2D (As though Z were out of the screen)

    18
    0 Votes
    18 Posts
    942 Views
    R
    @unknownuser said: can you post again in this thread when the update goes up? that's probably the easiest way for me to keep track. thanks so much Will do.
  • 'Error Loading File progressbar.rb' problem

    5
    0 Votes
    5 Posts
    1k Views
    I
    Thank you Chris
  • SelectionObserver and get attributes....

    3
    0 Votes
    3 Posts
    205 Views
    J
    Hi Pauline, the attributes for a Dynamic Component are in the the "dynamic_attributes" attribute_dictionary. # Check "dynamic_attributes" dictionary for a Dynamic Component identity = selected[0].get_attribute("dynamic_attributes", "identity") # the Definition may have the attribute, so... if identity.nil? identity = selected.definition.get_attribute("dynamic_attributes", "identity") end if identity.nil? # there is not attribute named "identity" else # Yes, we found "identity" end
  • Script request -- drop to touch

    11
    0 Votes
    11 Posts
    1k Views
    pilouP
    About Sketchyphysics A little trick if you want that your objets are still straight fall down at the end Just put 2 big boxes (one in front of, one behind) so objects are jamed in! [image: uixN_trick.jpg] About undrop just copy/past that in the Web console Select yours groups and press "Eval" Change z = z + 100.cm as you want (for copy all Code follow click blue "Select All" model = Sketchup.active_model model.start_operation("Move in Z") entities = model.entities selection = model.selection zeds=[] index=0 sorted_groups=[] groups=[];selection.each{|entity|groups.push(entity) if entity.kind_of?(Sketchup;;Group)} groups.each{|group|zeds.push([group.bounds.min.z, index]) index+=1 } zeds.sort! zeds.each{|z|sorted_groups.push(groups[z[1]]) } ### sorted_groups is now groups sorted by z z = 0.0 sorted_groups.each do |e| # update! # Now we process the groups t = Geom;;Transformation.new(Geom;;Point3d.new(0,0,z)) # Apply the transformation e.transform!(t) z = z + 100.cm end model.commit_operation return nil
  • Is there a Ruby for automatically showing segment ends?

    8
    0 Votes
    8 Posts
    219 Views
    pilouP
    The lack of the Chris Simple Loft is to erase a segment of a closed curve But its Random Painter is a very funny thing [image: 3Jga_funny1.jpg]
  • Looking for select ruby

    3
    0 Votes
    3 Posts
    115 Views
    R
    sounds like thomthom's selection toys, just do a search for it in this forum.
  • Scrambler.exe

    8
    0 Votes
    8 Posts
    1k Views
    T
    @fizgig said: I just realized that it is loading as I can click on the blank spot where the icon should be and the program runs. I just need to get the graphic into that button. SU unscrambles the file in a temp or virtual folder, so if you point your icons relatively to the script file, it simply doesn't find them. The problem is caused by a wrong path to the icons.
  • Looking for ruby that deletes extra lines on a plane

    4
    0 Votes
    4 Posts
    329 Views
    brodieB
    That looks perfect, thanks guys -Brodie
  • Ruby MySQL module in Sketchup

    2
    0 Votes
    2 Posts
    332 Views
    daikuD
    Hi Pauline. If I understand correctly, your problem is executing a "require" command from the console window? If so, here are 2 things to keep in mind: Specify the full path (note how in my example, the first fails, but the second works) Use the '/' character, not '' for the separator. @unknownuser said: require 'reglue.rb' false require 'C:/Program Files (x86)/Google/Google SketchUp 7/Plugins/reglue.rb' true
  • Plugin to move everything inside a group to specific layer?

    9
    0 Votes
    9 Posts
    8k Views
    Chris FullmerC
    Try NOT leaving the layers panel open. Turn on the Layers toolbar instead. And then ALWAYS stay on layer 0. And model things on zero, then turn everything into groups and components. And then move those onto the desired layer through the layer toolbar. That way you never change from layer 0. But you can move components and groups easily onto the correct layer. I like to do it that way, Chris Oh, and its still possible to get raw geometry to change layers accidentally. So then I use TIG's move all geometry to layer 0 plugin. It moves all loose geometry to layer 0, while leaving all components and groups on the layer they are on.
  • How do we view methods, (And their Arguments) of a Class

    4
    0 Votes
    4 Posts
    157 Views
    Chris FullmerC
    Thank you so much for that runnerpack. I really like how cleanly that outputs the methods. I've been trying to figure that out for a while. I think Jim or Todd showed me once, but I forgot where that thread was. I need to bookmark that line of code somewhere. It is quite lovely, Chris
  • Re-define SU Axis in Ruby

    5
    0 Votes
    5 Posts
    339 Views
    G
    To the best of my knowledge Chris. I find I need to create new geometry on non-existing planes. By not setting the Axis I can easily get my 2D sketch geometry off kilter. With the Axis aligned properly I get feedback. See the attached pic. The original Axis was at the lower left corner of the block. Picking the odd face (Which is planar to the block face) does not give me the desired X,Y Axis. Sure it defines the plane surface but not the way I need it. This is not the biggest issue though. The hardest one is where the Axis origin is in the correct position inside the part but I need to rotate it say.... about he Y axis. The only work-around I've found is to hide the entire model move (rotate) my Axis then un-hide the model. I don't eyeball my models I create to real world dimensions as best I can. [Edit]Should have done a screen capture. Export removed the Axis from my sample. (It was aligned with the bottom of the extruded feature.)[/Edit] [image: LheS_Sample_BadAxis.jpg]
  • What do you prefer? (about a function)

    3
    0 Votes
    3 Posts
    122 Views
    P
    A bit like the outliner in Sketchup. But, instead of a list based upon hierarchy/type of entity, the Sketchup entities are organized in another way (like Building 1-level 1 slab, Building 1-Level2 slab,...) So if you click on the text 'Building 1-level 1' in a window it highlights those entities.
  • Entity info: is it possible to add another drop down?

    11
    0 Votes
    11 Posts
    343 Views
    BepB
    @aadbuild said: Hey Bep glad to see you had a crack at a ruby. I will have a play with it and see if I can improve it (remembering I am a builder. I work mainly with timber, bricks, roofing and sketchup).. Can any one show me an example of a web dialogue? I will give that a go as well. It will help me get an understanding of the task at least. Bep do you want to try post your ruby here. Attach screen shot or 2 of the the exported data. Or PM it to me if you please. My wife is having a baby at 7 am in the morning (induced) so I may not get a chance to reply in the next couple of days. I hope its a boy. Give your wife all the love and support you can give. I wish all your and your wifes whishes will come true. Bep
  • Rubys not wokring...(RoundCorner+LibFredo)

    5
    0 Votes
    5 Posts
    1k Views
    GaieusG
    @unknownuser said: ...there should be two libfredo items in the plugin folder a folder named: LIBFREDO6_Dir_34 and a file named: LibFredo6.rb are both of those in there? OR they are wrapped into a Libfredo folder (Windows creates when you unzip something)? If so, move them up one level, straight under the Plugins folder.
  • Pipe along path question

    2
    0 Votes
    2 Posts
    345 Views
    TIGT
    Because PipeAlongPath effectively uses FollowMe it is fettered by that method's limitations. Didier Bur made a 'line to tube' tool [ http://www.crai.archi.fr/RubyLibraryDepot/Ruby/EM/line2cyl.rb ] that will add a cylinder to every selected edge irrespective of their branching etc BUT it doesn't tidy the ends up...
  • SketchUp Product Configurator Plug-in?

    3
    0 Votes
    3 Posts
    994 Views
    Roguer1R
    Thanks for the reply Chris, I think I may be able to do this whole thing with dynamic components...Now, just to figure out how the thing works...

Advertisement