Is it possible...
-
- 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.
-
No on both counts. I requested #1 back in June and again in October, so it's on the radar in Boulder. I like #2 as well. I suppose it could be handled in a webDialog, but it would be so much better as a native tool. I have officially requested #2 now...
-
Thanks Rick! (although not the response I was hoping for...)
-
Good info, TIG. Thanks!
Here's another one:
Is it possible to use the arrow keys to lock axis inference in a user-defined tool? -
@whaat said:
Is it possible to use the arrow keys to lock axis inference in a user-defined tool?
I am afraid you have to code it as part of your tool, which is not too complex in general.
Sorry for bad news, but maybe someone else has a trick.Fredo
-
@unknownuser said:
[I am afraid you have to code it as part of your tool, which is not too complex in general.
Sorry for bad news, but maybe someone else has a trick.I'm not quite sure how to do this...I guess I'll start experimenting.
-
@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###.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register LoginAdvertisement