SketchUcation Plugin Store

 

 

Solid Trim Tool

Solid Trim Tool

Postby ebelg2000 » Mon Aug 20, 2012 6:54 pm

I am trying to use the Solid Trim Tool to create a mortise from a tenon. When I do this I choose the component with the tenon as solid #1 and then the adjacent component as Solid #2. This seems to work well, however, Solid #2, the component with the newly created mortise is changed to a group named "difference". I was wondering if there was a way to maintain the original component designation?
ebelg2000
 
Posts: 16
Joined: Fri Oct 23, 2009 6:28 pm
Name: ebelg2000
Operating system: Mac
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Intermediate

Re: Solid Trim Tool

Postby TIG » Mon Aug 20, 2012 7:18 pm

Jim's "Solids Trim and Keep" fixes this glaring hole in the native Solids toolset...
viewtopic.php?p=356575#p356575 - it appears in the Tools menu.
TIG
User avatar
TIG
Global Moderator
 
Posts: 13903
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Solid Trim Tool

Postby ebelg2000 » Mon Aug 20, 2012 7:36 pm

Thanks for the quick response. This certainly works more efficiently.
ebelg2000
 
Posts: 16
Joined: Fri Oct 23, 2009 6:28 pm
Name: ebelg2000
Operating system: Mac
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Intermediate

Re: Solid Trim Tool

Postby Dave R » Mon Aug 20, 2012 9:27 pm

Jim's "Solids Trim and Keep" definitely makes it a lot easier although for creating mortises. I would really prefer it if the native Solid Tools didn't convert components to groups. It leads to much more work than cutting the mortises manually with the Rectangle tool and Push/Pull.
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 8958
Joined: Tue Nov 13, 2007 11:52 pm
Location: SE Minnesota
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Advanced

Re: Solid Trim Tool

Postby ArCAD-UK » Tue Aug 21, 2012 10:55 am

Plus it migrates the group to layer 0 :thumbd:
ArCAD-UK
 
Posts: 304
Joined: Tue Feb 08, 2011 11:21 pm
Location: SW Scotland
Name: Trevor B.

Re: Solid Trim Tool

Postby Dave R » Tue Aug 21, 2012 11:05 am

Trim and Keep does that, too.
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 8958
Joined: Tue Nov 13, 2007 11:52 pm
Location: SE Minnesota
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Advanced

Re: Solid Trim Tool

Postby TIG » Tue Aug 21, 2012 12:03 pm

To keep the layers unchanged edit Jim's script with Notepad or a similar plain-text editor, around line#81 you need to change this
Code: Select all
def_to_keep.name = @model.definitions.unique_name(name)
grp = @first_picked.trim(@last_picked)
to this
Code: Select all
layer=@last_picked.layer
def_to_keep.name = @model.definitions.unique_name(name)
grp = @first_picked.trim(@last_picked)
grp.layer=layer
The two extra lines saving/using the original's layer... so that it will retain the original layering of the now-trimmed-object.

Also, if you find yourself always purging the original unused untrimmed version, then you can further adjust the code, just before it says '@model.commit_operation' insert these lines of code reading
Code: Select all
if UI.messagebox("Delete Unused Definition?",MB_YESNO,"")==6
    def_to_keep.entities.erase_entities(def_to_keep.entities.to_a)
end
@model.commit_operation
On 'Yes' it will remove the earlier definition from the Component Browser's list after all instances of it have now been set to be 'new_def'... This will save you having to purge it later manually...
TIG
User avatar
TIG
Global Moderator
 
Posts: 13903
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Solid Trim Tool

Postby Dave R » Tue Aug 21, 2012 12:10 pm

Thank you TIG! Both of those work like a charm.
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 8958
Joined: Tue Nov 13, 2007 11:52 pm
Location: SE Minnesota
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Advanced

Re: Solid Trim Tool

Postby Robert Lang » Tue Aug 21, 2012 2:08 pm

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
Robert Lang
 
Posts: 6
Joined: Mon Jan 12, 2009 7:09 pm
Location: Cincinnati, OH
Name: Robert Lang

Re: Solid Trim Tool

Postby Dave R » Tue Aug 21, 2012 2:10 pm

That does work but it's extra steps.
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 8958
Joined: Tue Nov 13, 2007 11:52 pm
Location: SE Minnesota
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Advanced

Re: Solid Trim Tool

Postby TIG » Tue Aug 21, 2012 4:35 pm

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... :enlight:
TIG
User avatar
TIG
Global Moderator
 
Posts: 13903
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Solid Trim Tool

Postby Dave R » Tue Aug 21, 2012 4:48 pm

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.
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 8958
Joined: Tue Nov 13, 2007 11:52 pm
Location: SE Minnesota
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Advanced

Re: Solid Trim Tool

Postby Dave R » Tue Aug 21, 2012 4:53 pm

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?
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 8958
Joined: Tue Nov 13, 2007 11:52 pm
Location: SE Minnesota
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Advanced

Re: Solid Trim Tool

Postby TIG » Tue Aug 21, 2012 7:30 pm

Remove the two lines 'if...' and 'end' at the start/end of the added code, so that the only thing you add is def_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... :o
TIG
User avatar
TIG
Global Moderator
 
Posts: 13903
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Solid Trim Tool

Postby Dave R » Tue Aug 21, 2012 7:36 pm

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.
Inspecting mirrors is a job I could easily see myself doing.
User avatar
Dave R
Global Moderator
 
Posts: 8958
Joined: Tue Nov 13, 2007 11:52 pm
Location: SE Minnesota
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: woodworking
Level of SketchUp: Advanced

Re: Solid Trim Tool

Postby TIG » Tue Aug 21, 2012 7:41 pm

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 a model.start_operation()...model.commit_operation block
TIG
User avatar
TIG
Global Moderator
 
Posts: 13903
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

Re: Solid Trim Tool

Postby bmike » Tue Aug 21, 2012 9:30 pm

thanks TIG, marked to come back and tinker with code later....
User avatar
bmike
 
Posts: 487
Joined: Mon Dec 15, 2008 6:42 pm
Location: vermont

Re: Solid Trim Tool

Postby david. » Wed Aug 22, 2012 4:17 pm

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...
david.
 
Posts: 143
Joined: Wed Sep 03, 2008 10:08 pm
Location: USA

Re: Solid Trim Tool

Postby TIG » Wed Aug 22, 2012 5:15 pm

I've moved this thread into Plugins, which is probably a more logical home for it...
TIG
User avatar
TIG
Global Moderator
 
Posts: 13903
Joined: Mon Nov 12, 2007 7:24 pm
Location: Northumbria UK
Name: TIG
Operating system: Windows
SketchUp version: 8
License type: Pro
SketchUp use: architecture
Level of SketchUp: Advanced

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago

Keyframe Animation plugin - animate your SketchUp model by adding movement to any object.

Premium Members get 20% discount!

Ad Machine
Robot
 
Posts: 2012



 

Return to Plugins

cron

Who is online

Users browsing this forum: Dave R, majnun, qwertylin and 6 guests