Solid Trim Tool
-
Without the plug in you can simply select the new group and explode it. After the explode, all the geometry is selected so you can right click and select "Make Component". Give it the exact same name it had to begin with and all is well.
Bob Lang
-
That does work but it's extra steps.
-
Also you'd need to reassign the original layer manually [if you remembered it].
So Jim's tool - with my tweaks - means the trimmed component >> group is automatically made back into a component of the same name [including all instances updated], it's kept on its original layer, and you have the option of removing the now unused component from the browser or keeping it if you might like to reuse it somehow...
-
And after exploding, you'd have to move the geometry back to Layer 0 where it should be.
I have a keyboard shortcut for Jim's plugin and now, with the modification it is absolutely painless for even the most simple trim operations.
-
TIG, out of curiosity, assume that there would never be a need to keep the original version of the component. what would the code be to make the script automatically purge the unused version?
-
Remove the two lines '
if...
' and 'end
' at the start/end of the added code, so that the only thing you add isdef_to_keep.entities.erase_entities(def_to_keep.entities.to_a)
before the@model.commit_operation
Then there's no choice - the original object's shape is lost...
-
Thanks, TIG.
If I were using other tools to do the same thing I would do with Trim and Keep I wouldn't have the original shape either. So far that's never been a problem.
-
OK...
If you ever need to delete a group/component in code you can use
*defn.entities.erase_entities(def_to_keep.entities.to_a)
or to be even shorter
*defn.entities.clear!
!!!Calling it *
def_to_keep
is somewhat whimsical as it's the one to go !
Which is actually the same thing - but perhaps easier to grasp ?!
Always provided that it's inside amodel.start_operation()...model.commit_operation
block -
thanks TIG, marked to come back and tinker with code later....
-
LIL
Seems like this thread is a more general topic than Woodworking. I was wondering if it should/could be moved to the SU Discussions subforum? Just a thought...
-
I've moved this thread into Plugins, which is probably a more logical home for it...
Advertisement