🏒 PlaceMaker | 25% off for February including new Google Earth data imports! Learn more
  • Default save as v7?

    12
    0 Votes
    12 Posts
    998 Views
    TIGT
    If you are working in a model that's been opened in 'v8' then whenever you 'save' it will be as in the 'v8' format. Whenever you use 'save_as' it will be saved in the 'selected format' at the point you press OK: this defaults to 'v8' format every time: so you have to change it manually each time to another earlier version format - e.g. 'v7'... Sorry, but your "dream" hasn't / won't come true...
  • How to call method added to SU?

    9
    0 Votes
    9 Posts
    508 Views
    honoluludesktopH
    For other beginning ruby writers like myself: model = Sketchup.active_model @entities = model.active_entities @selection = model.selection . . . # Group entities inserted. sel = @selection sel_ents = sel.to_a first_entity = sel_ents[0] while sel_ents.length > 0 if ((sel_ents[0].is_a? Sketchup;;Edge) or (sel_ents[0].is_a? Sketchup;;Face)) and sel_ents[0] == first_entity new_group = sel_ents[0].all_connected sel_ents = sel_ents - new_group group = @entities.add_group(new_group) else sel_ents = sel_ents - [sel_ents[0]] end end model.commit_operation C&C is welcomed:-)
  • Mac32API.so ?

    5
    0 Votes
    5 Posts
    973 Views
    J
    Here's some related info: http://forums.sketchucation.com/viewtopic.php?p=66969#p66969
  • Page "Include in animation" flags

    4
    0 Votes
    4 Posts
    558 Views
    thomthomT
    Oh - so there is a difference between label and name... Hurray for documentation...
  • Pack Up Multiple Files into a Single .rb File?

    8
    0 Votes
    8 Posts
    478 Views
    tbdT
    I did something like that in timetrack.rb - here is the uncompress part zap_files = <<EOL {"tt_stop_l.png"=>"... removed ...", "tt_go_s.png"=>"... removed ..."} EOL if not FileTest.exists?("tt_stop_l.png") eval(zap_files).each_pair do |x,y| File.open(File.join(Sketchup.find_support_file("Plugins"), x),"wb") do |f| f.write y.unpack("m") end end end
  • Windows: Moving Floating Toolbars

    20
    0 Votes
    20 Posts
    2k Views
    J
    One problem is that some of the floating toolbars do not remember their shape after re-starting Sketchup. Using the new "Save Toolbar Positions" does not help, and I haven't figured how to resize them.
  • Invoke draw(view) method on tool startup

    5
    0 Votes
    5 Posts
    239 Views
    T
    @thomthom said: What I end up doing is: > def activate > Sketchup.active_model.active_view.invalidate > end > Thanks. It has done the trick. I've been trying def activate draw(Sketchup.active_model.active_view) end , but it has not worked.
  • Whutwhut? UTM class?? Since SU6??

    4
    0 Votes
    4 Posts
    238 Views
    Dan RathbunD
    Here's the link again: from Wikipedia search on "UTM": Universal Transverse Mercator coordinate system, a grid-based method of mapping locations on the surface of the Earth. http://en.wikipedia.org/wiki/Universal_Transverse_Mercator_coordinate_system _ .
  • Extract Material thumbnail?

    17
    0 Votes
    17 Posts
    1k Views
    TIGT
    If you get a 'large' image there are Ruby tools to down-size it into a thumbnail ??? http://rmagick.rubyforge.org/ http://snippets.dzone.com/posts/show/3621 http://oldwiki.rubyonrails.org/rails/pages/HowtoCreateThumbnailImages etc etc............
  • Entity and Vertex

    7
    0 Votes
    7 Posts
    546 Views
    D
    I just wanted to put the vertex in the selection for drawing considerations, but I'll do it in an other way. For the moment, I'm trying to found a memory leak when I try to send my mouse coordinates to a Webdialog for displaying it using the InputPoint class and the position method. It takes me a lot of memory and then makes sketchup very slow.
  • Add a group to another group by rupy-code

    3
    0 Votes
    3 Posts
    241 Views
    thomthomT
    @andreas said: Hi, I would like to insert "Group1" into "Group2" by ruby-code. What should I do to make this work? Are you talking about existing groups? If so, refer to TIGs post. If you are creating new groups via Ruby: group1 = model.active_entities.add_group group2 = group1.entities.add_group
  • Save Toolbar Positions

    2
    0 Votes
    2 Posts
    290 Views
    thomthomT
    When I last looked at the registry it appeared that the function was simply making a second set of registry keys. Originally you got lots of ToolbarsUser-Bar0 ToolbarsUser-Bar1 ToolbarsUser-Bar2 ... When you use SU8's Save Position you get an extra set: ToolbarsUserCustom-Bar0 ToolbarsUserCustom-Bar1 ToolbarsUserCustom-Bar2 ... So it's no easier to control their positions now, than what it was before.
  • Quick and easy ruby script?

    2
    0 Votes
    2 Posts
    321 Views
    P
    so if i understand correct you want a file with on each line: groupname1-location1 groupname2-location2 ? If so I think you need to: loop all SU entities check if entity is group if so: get the name get the location info store those in a array [[name,location],[name,location],[name,location]] or hash end of loop then put the array in a file with File.open Something like that i think
  • Does SketchUp delete empty groups?

    2
    0 Votes
    2 Posts
    363 Views
    thomthomT
    Yea - SU tries to clean up some times. If you for instance erase all the entities in a ComponentDefinition that definition will disappear. (Though I'm not exactly sure when SU does that.) Could you place a CPoint in it?
  • Sphere Create Ruby

    4
    0 Votes
    4 Posts
    454 Views
    thomthomT
    cheers!
  • Geosphere?

    15
    0 Votes
    15 Posts
    803 Views
    AdamBA
    There you go. http://forums.sketchucation.com/viewtopic.php?f=180&t=30694&p=269864#p269864
  • Check which plugins are enabled in Preferences-&gt;Extensions

    2
    0 Votes
    2 Posts
    178 Views
    thomthomT
    Sketchup.read_default Does appear to be limited, it won't read any Windows settings, nor SketchUp settings.
  • WebDialog - execute_script outside of add_action_callback?

    6
    0 Votes
    6 Posts
    522 Views
    thomthomT
    Another tip which I might not have mentioned in that article, I find using a javascript framework (like jQuery) takes the pain out of the cross-compatibility JS issues.
  • No Syntax Errors on Loading?

    9
    0 Votes
    9 Posts
    551 Views
    Dan RathbunD
    @jim said: I don't know, what happens? (because I'm not sure how to go about doing that.) here is a simple file that should load before all others: call it !!!aaa.rb # # file; !!!aaa.rb # # A snippet from my !loadpaths.rb - by Dan Rathbun # skp_info=true ruby_info=true load_paths=true global_vars=false # delay=0.5 # Sketchup.send_action("showRubyPanel;") UI.start_timer(delay,false) { puts "\n" puts '----------------------------------------------------'<<"\n" if skp_info # print Sketchup Info to console puts ' Sketchup has been Loaded...'<<"\n" puts ' Sketchup Version ; '<<"#{Sketchup.version}\n" puts '----------------------------------------------------'<<"\n" end if ruby_info # print Ruby Info to console puts ' RUBY has been Loaded...'<<"\n" puts ' RUBY_PLATFORM ; '<<"#{RUBY_PLATFORM}\n" puts ' RUBY_VERSION ; '<<"#{RUBY_VERSION}" puts ' RUBY_PATCHLEVEL ; '<<"#{RUBY_PATCHLEVEL}" puts ' RUBY_RELEASE_DATE ; '<<"#{RUBY_RELEASE_DATE}" puts ' RUBY_COPYRIGHT ; '<<"#{RUBY_COPYRIGHT}\n" puts '----------------------------------------------------'<<"\n" end # ruby_info if load_paths # print LOAD PATHS to console puts "\n LOAD PATHS ($LOAD_PATH | aka $;) array;\n" $LOAD_PATH.each {|x| puts " #{x}\n"} puts '----------------------------------------------------'<<"\n" end # load_paths if global_vars # print Global variables to console puts ' RUBY Global variables;'<<"\n" puts '----------------------------------------------------'<<"\n" global_variables.each {|x| puts " #{x} = "<<eval("#{x}.inspect"<<"\n")} end # global_vars puts '----------------------------------------------------'<<"\n\n" } #
  • What DHTML does WebDialog support?

    2
    0 Votes
    2 Posts
    198 Views
    thomthomT
    On Windows the webdialog uses the Internet Explorer version that is installed on the user's computer. On OSX it's webkit. The webdialog isn't a limited sub-set, but make use of that the OS has available.

Advertisement