1.] What Java 8 build do you use ?
On my PC, when you run java -version from command prompt I can see:
java version "1.8.0_161"
Java(TM) SE Runtime Environment (build 1.8.0_161-b12)
Java HotSpot(TM) Client VM (build 25.161-b12, mixed mode, sharing)
2.] Did you set PRO_JAVA_COMMAND environment variable ? How ?
java version "1.8.0_144"
Java(TM) SE Runtime Environment (build 1.8.0_144-b01)
Java HotSpot(TM) 64-Bit Server VM (build 25.144-b01, mixed mode)
Yes, PRO_JAVA_COMMAND is set in System Environment variables
Also PRO_COMM_MSG_EXE is set to
C:\Program Files\PTC\Creo 4.0\M030\Common Files\x86e_win64\obj\pro_comm_msg.exe
I think that is needed only for async apps.
I also have PFCLS_START_DIR set to
C:\Program Files\PTC\Creo 4.0\M030\Common Files\x86e_win64\obj
I don't know if that is needed or not.
Also have CLASSPATH set to
.;C:\Program Files\PTC\Creo 4.0\M030\Common Files\text\java\otk.jar;%CLASSPATH%
Also my Path variable has this as part of it
%ProgramFiles%\PTC\Creo 4.0\M030\Common Files\libs
thanks for sending information. Thanks to that I was able to compile and run my test application. You can find it in attached search_dimensions_CR4_2018-01-20.zip file.
1.] on my PC search_dimensions_CR4 sub-directory is located in D:\users\mh\creo4_parametric\PTC_JLink directory
2.] application source code ... D:\users\mh\creo4_parametric\PTC_JLink\search_dimensions_CR4\zdrojovy_kod\SDVApp.java
3.] compilation batch file ... D:\users\mh\creo4_parametric\PTC_JLink\search_dimensions_CR4\zdrojovy_kod\kompilace_1.8.bat
4.] Creo launch command ... D:\users\mh\creo4_parametric\PTC_JLink\search_dimensions_CR4\Creo4 M030.bat
5.] application startup file ... D:\users\mh\creo4_parametric\PTC_JLink\search_dimensions_CR4\protk.dat
Procedure to launch my application
a.] double-click Creo4 M030.bat
b.] open deska.drw drawing
c.] activate Tools tab > click Tools > File > Hledání kót
d.] the output is written in seznam_kot.csv file
e.] exception code (if exists) is written in seznam_kot_chyby.txt file
Thank you for the code and detailed instructions. I opened your java code
I see you are still using Dimension2D in 2 places,
Dimension2D dim = (Dimension2D)dims.get(i);
Dimension2D dim = (Dimension2D)drawingShownDimensions.get(i)
If I use that in my code I get error
Exception caught: com.ptc.wfc.Implementation.pfcExceptions$XToolkitObsoleteFunc
You really got it working under Creo4?
I checked the contents of search_dimensions_CR4_2018-01-20.zip archive and found out that the contents of protk.dat file is wrong - it points to Creo 2.0 version of my application.
I corrected protk.dat file - now it points to Creo 4.0 version of my application.
I also found out that using corrected protk.dat file Creo 4.0 is not able to start my application packed in mh_installtest.jar file. Therefore I deleted mh_installtest.jar file and replaced it with 3 class-files (MenuButtonListener.class, SDVApp.class, SDVApp2.class). Now my Creo 4.0 version application works well. You can modify paths in protk.dat file and Creo4 M030.bat according to your situation and test my application on your computer. See attachment search_dimensions_CR4_2018-01-25.zip.
I guess that Exception caught: com.ptc.wfc.Implementation.pfcExceptions$XToolkitObsoleteFunc can be thrown by other function ...
I can use mh_installtest.jar file, too. The problem with jar file was caused by missing path in CLASSPATH variable in Creo4 M030.bat.
The above setting resolved the problem.