Community Tip - Stay updated on what is happening on the PTC Community by subscribing to PTC Community Announcements. X
Dear All,
Trying to see if it's possible to achieve How can we have drawing number to same as cad model number in Windchill.
Are there any changes to be done in preferences?
Else how we can achieve it.
Any solutions would be appreciated.
Thanks in advance.
Regards,
Durga
Solved! Go to Solution.
It is a very common request to have model and drawing match except for the extension - repeated like clockwork very often. Not addressed by PTC.
With auto-number (system default), this is not provided.
With manual number, users can type in same for both; system will fill in .prt, .asm, .drw, etc. Don't have users type in the extension.
Enter: 123456 when creating prt, drw
System result will be: 123456.prt, and 123456.drw
note: For Rename, user needs to keep the extension
note: If you use WTParts, the WTPart should have the same number with no extension.
It is possible to have customization (relatively complex) that re-assigns the Number of the WTPart and related CAD.
Bottom line - choosing to auto-number or not is critical and using manual is currently the only straight-forward and simple way to have them match.
Very likely should add a human check (or could be done by code) to verify the match without the extensions (e.g. .prt, .drw). Can also use a query builder report to find mismatches.
Hi @Durga
The Number is unique EPM identification. So for drawing and model you need to use sufix as .drw .prt .asm if you need to see the same identification number for drawing and model.
PetrH
Yeah, we had the same desire, but it seems there is no way to do it. We add -DRW on the drawing. We do not add the model extension, as that would allow similar numbers for parts (.prt) and assemblies (.asm). We force those to be more unique.
It is a very common request to have model and drawing match except for the extension - repeated like clockwork very often. Not addressed by PTC.
With auto-number (system default), this is not provided.
With manual number, users can type in same for both; system will fill in .prt, .asm, .drw, etc. Don't have users type in the extension.
Enter: 123456 when creating prt, drw
System result will be: 123456.prt, and 123456.drw
note: For Rename, user needs to keep the extension
note: If you use WTParts, the WTPart should have the same number with no extension.
It is possible to have customization (relatively complex) that re-assigns the Number of the WTPart and related CAD.
Bottom line - choosing to auto-number or not is critical and using manual is currently the only straight-forward and simple way to have them match.
Very likely should add a human check (or could be done by code) to verify the match without the extensions (e.g. .prt, .drw). Can also use a query builder report to find mismatches.
Thanks mike
Hello,
As others have mentioned that since EPMDocumentMaster is the table for both CAD PRT/ASM and DRW and there are constraints setup in Windchill to not allow duplicate number in the Number column, you cannot have both CAD PRT/ASM and DRW as same number and as others have mentioned they have used various extensions like -DRW to retain the main number but with -DRW extension.
We have done the same, but we did minor customization so that users don't have to manually add -DRW extension to the drawing
We created a custom class that implements interface: EPMDocumentNamingDelegate and renumbered the CAD DRW in that, here is the code:
public class CompanyEPMDefaultDocumentNumberDelegate implements EPMDocumentNamingDelegate{
private static Logger LOGGER;
static {
try {
LOGGER = LogR.getLogger("ext.company.service.CompanyEPMDefaultDocumentNumberDelegate");
} catch (Throwable throwable) {
throw new ExceptionInInitializerError(throwable);
}
}
public void validateDocumentIdentifier(DocIdentifier docIdentifier) {
String modelFileName="";
String cadDocNumber="";
LOGGER.info("CompanyEPMDefaultDocumentNumberDelegate.validateDocumentIdentifier Start! ");
if(docIdentifier!=null){
modelFileName = docIdentifier.getModelName();
cadDocNumber = docIdentifier.getDocNumber();
LOGGER.debug("Model Name :: "+modelFileName);
LOGGER.debug("CAD Number :: "+cadDocNumber);
//This condition checks get the fileName type .DRW and .SLDDRW Drawing Number not having -DRW
if((modelFileName.toUpperCase().contains(".DRW") || modelFileName.toUpperCase().contains(".SLDDRW")) && !cadDocNumber.toUpperCase().contains("-DRW") ){
docIdentifier.setDocNumber(docIdentifier.getDocNumber()+"-DRW");
LOGGER.debug("CAD Drawing Renumber Successfully !"+docIdentifier.getDocNumber());
}
}
LOGGER.info("CompanyEPMDefaultDocumentNumberDelegate.validateDocumentIdentifier End! ");
}
}
register your delegate in service.properties:
<Service context="default" name="com.ptc.windchill.uwgm.proesrv.c11n.EPMDocumentNamingDelegate" targetFile="codebase/service.properties">
<Option cardinality="singleton" requestor="wt.epm.EPMDocument" serviceClass="ext.company.service.CompanyEPMDefaultDocumentNumberDelegate"/>
</Service>
Hit me up if you need more details.
Abhishek