Is there a way to find unused parts in PDM?

I was wondering if there's a way to find parts with no "where used" in PDM either through Search, Report or SQL Query? ie. Parts that haven't been used in an assembly/drawing before.

Any ideas would be much appreciated!

SolidworksSolidworks Pdm/enterprise Pdm
Answers 7
JN
JN 2021-04-09 Best Answer

Hi John,

you should be able to do thins with a report generator, something like this :

<p>SELECT *</p><p>FROM Documents</p><p>LEFT JOIN Xrefs ON Documents.DocumentID = Xrefs.XrefDocument</p><p>WHERE Xrefs.XrefDocument IS NULL AND Documents.Filename LIKE '%.SLDPRT'</p>
JP
JP 2021-04-09

Ah! Thanks for that, that's much cleaner I managed to hack it together using another script and your code to get the result I was after but that's much better

JN
JN 2021-04-09

Hi John,

of course there is a way ! but we need a few more join, because the path of the file is not in the 'documents' table.

This should do the trick :

<p>SELECT *</p><p>FROM Documents</p><p>LEFT JOIN Xrefs ON Documents.DocumentID = Xrefs.XrefDocument</p><p>INNER JOIN DocumentsInProjects ON Documents.DocumentID = DocumentsInProjects.DocumentID</p><p>INNER JOIN Projects ON DocumentsInProjects.ProjectID = Projects.ProjectID</p><p>WHERE Xrefs.XrefDocument IS NULL AND Documents.Filename LIKE '%.SLDPRT' AND Projects.Path LIKE '%Projects%'</p>

Change Projects.Path LIKE '%Projects%' to whatever you want for the folder name.

WP
WP 2021-04-09

but just because part isn't used anywhere in assembly doesn't mean it's not needed. It might be used on it's own

JP
JP 2021-04-09

Thanks Jeff,

I think that would take a long time to check each part individually so trying to come up with a script to help report this

Cheers

JP
JP 2021-04-09

Hi Jerome,

This is perfect!

Do you know if there is there any way to limit it to a certain directory? Something along the lines of..

P2.Path Like '\Projects\'

Thanks so much

JW
JW 2021-04-09

If you have a specific part number, you can use the Where Used function in SolidWorks PDM Search.

If the list comes up empty, it's safe to say it isn't used any where.

comment imagecomment image