Component Ruby question
-
Sorry if this has been asked before, but I have done a prety good search on the forum and internet.
How do you make a component like you would use the group = entities.add_group. Is there a way to make a component instead of a group and asign it a name in a ruby script?
Thanks
Matt
-
http://download.sketchup.com/OnlineDoc/gsu6_ruby/Docs/ruby-definitionlist.html#add - adds a Definition to the Model then...
http://code.google.com/apis/sketchup/docs/developers_guide/index.html - lets you manipulate the definition's entities...
Then you have to add instances etc...Alternatively I'd make the Group, do the entities etc and then use...
group.to_component
to get the component definition and instance.
-
TIG,
Thanks so much, I don't know why I could not find this, but I am new to Ruby. It seams very easey, can I ask what is the editor of choice when scripting in Ruby for Sketchup?
Thanks,
Matt
-
I use "Notepad++.exe" with appropriate ruby settings for .rb files - BUT there are many other apps...
-
On PC, I prefer EditPlus. You can get a ruby syntax highlighter from their website, too.
-Scott Lininger
Google SketchUp Engineer -
Welcome to the forum Scott.
Welcome to the forum Scott.
Advertisement