Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X
Hi,
Is there any way to create the Representation for an EPMDocument by using your own file from local disk in Windchill 9.1M060.
Eg: If we have a pdf file, can we create a representation for EPMDocument by using this pdf.
Please share any experiences on this.
Thanks,
Karan Narang
Hi Swamy,
What you're trying to do sounds like it might be possible by using the representation loader APIs and creating your own mini-process. OOTB there's the ability to load representations, with whatever you want, and attach them to WTParts (wt.part.LoadPart.createPartRepresentation). I used that representation loader, and tweaked it so that we could load representations to WTDocs - I'm sure you could easily do the same with EPMDocs or step through to EDRLoader/EDRHelper/etc and go from there.
The only thing I'm not sure of though, is if this loader will publish thepdf's so that they are viewables, although I believe that should work if you have the publisher for that type. My requirement didn't call for them to be published, so I didn't have time to step into that piece more.
In Reply to karan narang:
Hi Swamy,
Hi Karan.
You may want to read this post on PlanetPTC. You can add the viewable to a document and then Copy to the clipboard and then Paste to the CAD Doc.
http://communities.ptc.com/message/178279#178279
Regards, Jim
Hi Chris,
Could you pl share any doc on this this if you have. I am hoping this will solve my requirement.
Thanks,
Karan Narang
Look into wt.part.LoadPart.createPartRepresentation, wt.part.LoadPart.loadRepresentation, and com.ptc.wvs.server.ui.RepHelper.loadRepresentation. They are the basis for all the subsequent calls that the rep loader needs. You can look at createPartRepresentation to see what needs to be passed into loadRepresentation. I would think that if you just do the work of getting the values needed to call loadRepresentation it might just work without much tweaking. You should have it easier than I did because the loadRep wasn't setup for adding representations to WTDocs OOTB, that I could find.
The one PITA thing I ran into, was that the 'repDirectory' variable is where the file, that will be the eventual representation, is stored on the filesystem. That file is the ONLY THING that can be in that folder, unless you look into a way to have the commandprocessor take an actual file name instead of the directory - I wasn't given the time.
In Reply to karan narang:
Hi Chris,
Could you pl share any doc on this this if you have. I am hoping this will solve my requirement.
Thanks,
Karan Narang