Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Delete materials and subcategories not used in family

convect
Enthusiast

Delete materials and subcategories not used in family

convect
Enthusiast
Enthusiast

Hi all, I have a lot of families with material and subcategories not used and this increase file size. I was thinking to write a utility to remove all unused materials and subcategories in family editor, because Purge all doesn't work and all those entities remain in family.

Here are subcategories listed in Object Styles and some materials are mapped directly to them:

Sub1.jpg

 

Some of this subcategories are mapped to the solids in Materials and Finishes properties and should not be deleted:

 

Sub2.jpg

 

 

Remaining unused subcategories and materials could be removed:

Sub3.jpg

 

I realize that this is difficult task and was wondering if it's possible to clean up families via API. Thank you!

0 Likes
Reply
2,980 Views
4 Replies
Replies (4)

jeremytammik
Autodesk
Autodesk

Here is an example how to purge unused materials:

 

http://thebuildingcoder.typepad.com/blog/2017/04/forgefader-ui-lookup-builds-purge-and-room-instance...

 

The Building Coder has discussed several approaches to other purge functionalities as well:

 

http://thebuildingcoder.typepad.com/blog/2017/11/purge-and-detecting-an-empty-view.html#2

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes

convect
Enthusiast
Enthusiast

Thank you, Jeremmy!

I have seen Harry's solution, but it works only in project, not in family editor and not all unused materials are deleted. Also that solutions is not deleting unused subcategories.

frankholidayjunior
Advocate
Advocate

I want the same thing corvect

0 Likes

TripleM-Dev.net
Advisor
Advisor

Hi,

 

Import the Families into a Empty project file (don't need to be placed), then export them again.

All unused user created subcategories will be gone.

 

If the project is clean, (no materials attached to any category/sybcategory) the export will be relative clean of materials, you even can purge/delete unused materials in the project and export the families after.

 

See if this helps.

- Michel