Select based on Entity Info
-
Hello All,
Is there way (existing script or developing ) of saving groups of features as an individual SketchUp model based the name stored in the Entity Info (see attached jpeg). The problem I have a single model that has a number of models within it and I want to save each of the individual models as their own model, without having to do this manually.
Thanks...
-
You can save all of the Model's component definitions 'outside' using the Component Browser > Model tab and choosing the pop-out/drop-down menu's 'Save as local collection' item...
All components are then saved as individual SKP files in the folder you specified...
You can also use 'Save_as' on individual component's icons in the Browser [context-menu]... or even do the same on a selected instance in the Model by using the main context-menu equivalent item...
This is the way you save parts of your Models for reuse in future projects - making coellctions of them... -
Thank you TIG, that is really helpful. I am hoping to do this in a more automated fashion, do you know of a way to make things components? My models are not saved as components (as it is not in the workflow). Would there be a way to make all the groups into components based on the Name stored in the Entity Info?
Thanks....
-
Why not change the workflow to make components instead of groups? It isn't any more difficult than making groups and you can save all the components as a local collection if you wish in one step.
-
Because the plugins in that I am using saves them as Groups, so its out of my control.
-
It's entirely within your control. You could easily convert the groups to components. It's a small thing to do if the things are worth saving.
-
This one-liner copy+pasted into the Ruby Console +<enter> will make all groups currently in the model into components, using each group's name [or #1 etc if already existing]. Unnamed Groups become a component called Group#1 etc... It is one step undo-able.
m=Sketchup.active_model;m.start_operation('g2c'); m.definitions.each{|d|next unless d.group?;d.instances.each{|i| next unless i.valid?;n=i.name;c=i.to_component;next if n.empty?;c.name=n;c.definition.name=m.definitions.unique_name(n) } };m.commit_operation;
BUT don't use it as an excuse for not modeling 'right' in the first place...
-
Thanks TIG. I agree with the "right way" comment, but when you are bound by something, you are bound by it.
Advertisement