Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Hi all,
I am going to create WTParts for all EPM Documents in Windchill, what I'd like to know is how can I find out what parts and assemblies have the same name?
E.g root.prt and root.asm
Once I create the WTParts they will have the file extension for the number (root.prt) which is fine however I will be removing all extensions but the tool will run in to problems if a part and assembly have the same name.
Does anyone know how to produce a query/search in order to identify duplicate name parts and assemblies? Has anyone had to do this before so that they could integrate WTParts with their ERP/MRP?
Many thanks.
Best,
-=D
Deepen: The following sql will list all epmdocument .asm's and .prt's that have the same base number. This is using the "cadname" field (to find the number) however could be easily changed to use the documentnumber field.
select s2.partNumber
from
(select
substr(s1.cadname, 0, instr(s1.cadname, '.') - 1) partNumber,
count(*) numDups
from
(select distinct
edm.cadname
from
epmdocumentmaster edm,
epmdocument ed
where
ed.ida3masterreference = edm.ida2a2 and
(edm.cadname like '%.asm' or edm.cadname like '%.prt') and
classnamekeyc10 is not null and
ed.statecheckoutinfo = 'c/i') s1
group by
substr(s1.cadname, 0, instr(s1.cadname, '.') - 1)) s2
where
s2.numDups > 1
order by
s2.partNumber;