Skip to main content
1-Visitor
May 11, 2010
Question

Drawings as PDF - Quick way to download them?

  • May 11, 2010
  • 95 replies
  • 33906 views
I have my drawings being published as a PDF by my Pro/e CAD worker. This is fine but in the end my users really need to be able to quickly download or email the PDF. Currently the only way to get the PDF out is to do the following:
1- Go to Drawing Details Page
2- Select "Display Representations List"
3- Click Actions>Save Representation
4- Save Representation out as .zip file to desktop
5- Extract PDF from .zip file and email etc

WAY to much work...does anyone know of a more efficient way to do this?

95 replies

1-Visitor
September 13, 2010

Lawrence,

I checked my recipe editor and it has the same settings as yours. Publishing to pdf is successful, its just that

on the actions menu (in search and information page) I no longer have the choice "open in ProductView", maybe its a 9.0 issue ?

If I go through the list representations menu I can open the published pdf in productview, I've noticed this issue after modifying the

two xml files, if I change the xml files back to their original versions, the menu pick "Open in ProductView" returns but of course

then there is no more download plt or pdf option. I'm going to try to contact tech support to see if this is a 9.0 issue. I'll post any

findings back to the forum.

I

1-Visitor
September 14, 2010

Did anyone experiment with retrieving multiple files through a batch file ?Particularly what is the syntax needed to retrieve

the files through the windchill shell ? I've noticed the command java ext.dlRep_main <location> <filename> <plt or=" pdf="> only runs through the windchill shell. Its been quite a while since I worked with batch files, my windchill shell command looks like this:

C:\>PTC\Windchill_9.0\Windchill\bin\windchill.exe -w "C:\ptc\Windchill_9.0\Windchill" --java="C:\ptc\Windchill_9.0\Java\jre\bin\java.exe" shell

Adding this line to bach file, calls up the windchill shell but the problem isgetting additional lines in the batch file to execute,

any ideas ?

1-Visitor
September 17, 2010

lawarence

Thanks for the response. I do have the menu working, even changed the icon to use a little PDF icon. What I am having an issue with is the batch file. I can run it through windchill shell with no problem, but creating a batch file I can not get to work. Java can not find the class

C:\PTC\Windchill_9.1\Windchill\codebase\ext>C:\PTC\Windchill_9.1\Java\bin\java.exe ext.dlRep_main c:\\share\drawings % pdf
Exception in thread "main" java.lang.NoClassDefFoundError: ext/dlRep_main
Caused by: java.lang.ClassNotFoundException: ext.dlRep_main
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
Could not find the main class: ext.dlRep_main. Program will exit.

I have even tied setting the class path as well. Have you been able to run a batch file?

in a batch file you need to use %% instead of %

1-Visitor
September 21, 2010

ED, as far as running any batch file that includes executing the windchill (wc) shell before executing the dlRep_main java class.

Just run your bat from a windchill shell. If your wc shell cant find the bat, add the path to the bat to your PATH var.

Keith: Same thing, run you dlRep_main from a wc shell window.

java ext.dlRep_main c:\share\drawings% pdf

should run fine from wc shell. from the wc shell, you dont need to add classpath (-cp or -classpath), you dont need to enter full path of java in command line,the windchill shell knows where java is. It also knows where ext.dlRep_main is.

L Jett

1-Visitor
September 21, 2010

Keith,

Here is what worked for me:

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

batch file - print_list_bat0

PTC\Windchill_9.0\Windchill\bin\windchill.exe -w "C:\ptc\Windchill_9.0\Windchill" --java="C:\ptc\Windchill_9.0\Java\jre\bin\java.exe" shell

----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Thisjust calls up the windchill shell

Then inside the windchill shell,

type "print_list_bat"

contents of print_list_bat:

for /f %%i in (c:\print_list.txt) do java ext.dlRep_main C:\TEST %%i.DRW plt

The one thing I still cant get to work isto how to have print_list_batautomatically runonce the windchill shell opens, any ideas ?

1-Visitor
September 21, 2010

I am so close now. If I type at a command prompt

C:\PTC\Windchill_9.1\Java\bin\java -cp C:\PTC\Windchill_9.1\Windchill\codebase ext.dlRep_main

I get what is expexted the usage text. Which means it does see it.

Usage: windchill dlRep_Main <path-where-file-should be=" saved="> <number search=" string="> <content type=">

But if I add the Paramaters I get the following errors:

C:\PTC\Windchill_9.1\Java\bin>C:\PTC\Windchill_9.1\Java\bin\java -cp C:\PTC\Windchill_9.1\Windchill\codebase ext.dlRep_main c:\ % pdf
wt.util.WTRemoteException: Unable to invoke remote method; nested exception is:
java.lang.NoClassDefFoundError: javax/servlet/http/HttpServletRequest
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getConstructor0(Class.java:2699)
at java.lang.Class.getDeclaredConstructor(Class.java:1985)
at java.io.ObjectStreamClass.getExternalizableConstructor(ObjectStreamClass.java:1297)
at java.io.ObjectStreamClass.access$1400(ObjectStreamClass.java:52)
at java.io.ObjectStreamClass$2.run(ObjectStreamClass.java:435)
at java.security.AccessController.doPrivileged(Native Method)
at java.io.ObjectStreamClass.<init>(ObjectStreamClass.java:413)
at java.io.ObjectStreamClass.lookup(ObjectStreamClass.java:310)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1106)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at wt.method.MethodArgs.writeExternal(MethodArgs.java:193)
at java.io.ObjectOutputStream.writeExternalData(ObjectOutputStream.java:1418)
at java.io.ObjectOutputStream.writeOrdinaryObject(ObjectOutputStream.java:1390)
at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1150)
at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:326)
at sun.rmi.server.UnicastRef.marshalValue(UnicastRef.java:274)
at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
at wt.method.MethodServerImpl_Stub.invoke(Unknown Source)
at wt.method.RemoteMethodServer.invoke(RemoteMethodServer.java:647)
at ext.dlRep_main.main(dlRep_main.java:111)
Caused by: java.lang.ClassNotFoundException: javax.servlet.http.HttpServletRequest
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
... 22 more

I have tried this command from different starting points, using double backslash in pathsetc...

If I open WC Shell and type

java ext.dlRep_main c:\\share\drawings % pdf

It works no problem. What am I missing?

thanks

10-Marble
September 23, 2010
Hi Keith,

You need to set a classpath variable in the same way that windchill shell does it.

First dump your current classpath variable to file: from a windchill shell type
set classpath>tmp_var.txt
Then open tmp_var.txt with a text editor and copy everything into your batch file addint the "set" prefix, mean
set CLASSPATH=......

Here is my simple script that works (you need change the path and letters to what you have).
In my case Windchill installed inside of d:\ptc\Windchill_9.1\Windchill
Also attached the text file for your reference.
1-Visitor
September 23, 2010

That is IT!!!!

Thank you very much Igor The key is you can not run a command from within shell through a batch file, so you have load all of the correct class in order for it to run.

The only thing I had to change was running the java from the java\bin directory, becasue I do not have a system path setup.

Thanks everyone for all the help.

1-Visitor
September 24, 2010
Keith & Igor & Lawrence - Thanks for all the help, got mine to work also now.
1-Visitor
September 26, 2010

Glad to see all have running batch now.

I did updatethe readme file, to included customRB info.

http://www.datajett.com/windchill/wc_dev/saverep/saverep_readme.txt

even if you are on wc9.1 & you can find the WVSactionsResource & place it there, the custom?? anything is probably best route, as to not mess with OOTB.

L Jett