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.

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