Removing the group after group.to_component
-
The following:
my_def = definitions.add "My Selection" my_inst = @master_group.to_component new_inst = my_def.entities.add_instance(my_inst.definition,my_inst.transformation) my_inst.erase! repeat = false #make true for repeat insert model.place_component my_def, repeatcreates a component from a group. I was unable to find a method that would keep the component, without the group. Do I have to break up the group into its entities by
temp_entities = @master_group.explode, then create a instance of them by looping through the array, bymy_inst.entities.add_...for each entity? -
?
group.to_componentdoes not preserve the original group. -
It doesn't? hmmm.....OK, I'll take a better look at my code to see where I made the group.
-
I just converts the group.
-
Turns out that although my original code appeared to work, it did not properly create my_component. I have corrected the code as noted below:
` my_instance = @master_group.to_component
new_instance = entities.add_instance(my_instance.definition,my_instance.transformation)
my_definition = new_instance.definitionmy_definition.name = my_file_name
my_instance.erase! #although not part of problem,
new_instance.erase! #ended up with stray instances.
repeat = false
model.place_component my_definition, repeat`tt, thanks for helping to point me in the right direction.
-
Stray instance? From to_component?
This should not be - something else must be going on. -
Right again:
my_instance = @master_group.to_component my_definition = my_instance.definition my_definition.name = my_file_name my_instance.erase! repeat = false model.place_component my_definition, repeatCan I just say that I must have been sleep deprived.

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