6 messages in com.googlegroups.sketchuprubyRe: Create Components from Ruby Script
FromSent OnAttachments
ktkoh06 May 2007 15:54 
TIG11 May 2007 12:25 
Jim11 May 2007 21:21 
ktkoh13 May 2007 04:39 
ktkoh13 May 2007 05:27 
Jim13 May 2007 07:06 
Subject:Re: Create Components from Ruby Script
From:Jim (jim.@gmail.com)
Date:05/11/2007 09:21:43 PM
List:com.googlegroups.sketchupruby

Hi Tig, welcome to the groups. I emailed the OP a modified version of the box script days ago but never herd back. Oh well.

-- Jim (jnorm)

On May 11, 3:25 pm, TIG <tant@yahoo.co.uk> wrote:

The method is barely covered!!!

Let's assume your model is reference as 'model' and the group is 'group'...

component_instance=group.to_component layer_name=model.active_layer component_instance.definition.name=layer_name ### is this what you want to name - the component itself ??? component_instance.name=layer_name ### or is it this one only ??? the one instance ???

On May 6, 11:54 pm, ktkoh <kbkr@charter.net> wrote:

For woodworking I start most parts with the Box.rb script which ends by creating a group. I want these parts to be components so the first thing after running Box I select and make it a component. For some reason this step does not let me name the component at that time and requires a second step. I looked in the ruby help files but did not find example of creating a component. I would like to modify the box script to finish by creating a component and naming it the same as the active layer. This would save steps and insure that I don't forget to do the necessary steps.