This script adds a new method for a ComponentDefinition...
component_definition.delete
It mimics deleting a component-definition from the component-browser.
All instances of the component-definition are erased (including any locked ones)
and the component-definition itself is then purged.
However, any other 'unused' component-definitions remain unaffected...
unlike "definitions.purge_all", which purges everything that's unused...
[EDIT: AlexM has written a better version - recommend you get it here - viewtopic.php?p=145255#p145255]
I have removed my 'code' 20090402...
[code] ComponentDefinition-delete
9 posts
• Page 1 of 1
[code] ComponentDefinition-deleteLast edited by TIG on Thu Apr 02, 2009 9:43 am, edited 5 times in total.
TIG
Re: [Plugin] ComponentDefinition-deleteYeah, thats great. Thanks TIG!
Chris
Re: [Plugin] ComponentDefinition-deleteI wonder what the performance impact is if there's many unused components in a model. Where I work I've seen models which has been worked on for years without every being purged... But until we get a native function this is the only way I can imagine it working.
Thanks for looking into this TIG. Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: [Plugin] ComponentDefinition-deleteYou could also use my Purge.rb that purges all Components, Layers, Materials and Styles in one go... Then your model would be 'trim'... Later on a few unused things won't give much of an overhead...
I've tried "definition.delete" with 30+ unused definitions and it took 'no time at all'... Last edited by TIG on Sun Mar 29, 2009 6:51 pm, edited 1 time in total.
TIG
Re: [Plugin] ComponentDefinition-deletePersonally I purge like every five minutes. Hooked up to a hotkey. But I'm a bit afraid to just purge stuff from other people's model when I write my plugins. But your method is a fine workaround in any case. I expect that's what I'll be using.
Thomas Thomassen — SketchUp Monkey & Coding addict
List of my plugins and link to the CookieWare fund
Re: [Plugin] ComponentDefinition-deleteThanks Tig! Will come in usefull when rendering with Vray since getting rid of any component instances should make render times quicker (after a file copy of course).
Re: [code] ComponentDefinition-deleteA better version has been written by AlexM viewtopic.php?p=145255#p145255
I recommend you change to that and I have added a note to the initial page on this thread... TIG
Re: [code] ComponentDefinition-deleteAlexM has found the basis of doing this without a new method at all...
I'm removing my 'code' and rewriting ComponentInstance-add_entites.rb to suit... TIG
9 posts
• Page 1 of 1
|
Who is online
Users browsing this forum: No registered users and 13 guests