cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

FW: Extract Parameters to a text file

Highlighted
Newbie

FW: Extract Parameters to a text file



Hi Greg,

We have looked into this already and have a method figured out on how to do
this. But I do not have the programming skills to complete it.

First off ... you must have the parameters "Designated" in ProE to see them
in the header. If not, this is easy to do with a batch file running a trail
file.

Then you will notice that each parameter has " 3 xx" in front of it and the
next line starting with " 4 (xx+3)" will be the value. There is actually a
nomenclature to the "X XX" format but I have not spent the time to decipher
all of it.

I had actually done this with a DOS batch file but it was terribly slow. We
parsed each file looking for a string match using the "FOR" command in
Windows 2000/XP (would not work in Win9X or NT).

If you would please send me anything that you come up with (including if
there is a lot of interest in this type of stuff) it would be greatly
appreciated. We have been discussing creating a ProE (and other software)
database file management tool something like PDM, using the GNU public
license scheme (freeware). It could lock files, generate BOM's, have release
schemes, ECO process, create PDF's, DXF's, etc. But we can not actually
change the ProE file itself or interact with ProE live (PTC licensing
violation) unless each user buys Pro/Toolkit.

At this time we are looking for someone who knows JAVA or C++ and who will
work for free until we have customers that are interested in paying for
support or customization.

Please call me if you would like to discuss this.


Thanks again.



Kevin J. Brault
Sharp Technologies and Design Group
Mechanical Engineering and CAD Administrative Services
410 East Crescent Place
Chandler, Arizona 85249
1 REPLY 1
Highlighted

RE: Extract Parameters to a text file

The following batch file will go through an entire directory of
part/assembly files and spit out your parameter of choice. I just
tested it and it processed about 250 files in 30 seconds on my machine
(2.8GHz). This batch file will essentially 'give up' looking for the
parameter once it sees the phrase "#END_OF_P_OBJECT" in the model file.
Without this, it would run much slower.

You can customize the output to suit your needs.

This will only work on NT/2000/XP, and the parameter in question must be
designated. If there is no designated parameter in a given model '---'
is returned as the value.

To run it, just type "extract PARAMNAME". In your case, you would
execute it like this:

C:\> extract rev

Enjoy...

Brian M. Adkins
PV&V Engineer & PTC Sys-Admin
John Deere Turf Care, Inc.
919/567-6669 - phone
919/567-6650 - fax
-
http://www.johndeere.com




extract.bat
+++++++++++++++++++++++++++++++++++++++++++++++++++++
@echo off

::
:: initialize variables
::
setlocal enabledelayedexpansion
set PARAMNAME=%1
set PARAMNAMEFLAG=3
set PARAMVALUEFLAG=4
set TEMPVALUE=
set FOUNDIT=0
set I=0
set DONEWITHFILE==0

for /r . %%a in (*.*) do (

set FILENAME=%%~nxa

for /f "tokens=1-3" %%k in (!FILENAME!) do (

if !DONEWITHFILE!==0 (

if /i "!FOUNDIT!"=="0" (
if /i "%%m"=="%PARAMNAME%" (
if /i "%%k"=="%PARAMNAMEFLAG%" (
set FOUNDIT=1
)
)
)

if /i "!FOUNDIT!"=="1" (
set /a I=!I!+1
)



if /i "!I!"=="4" (
if /i "%%k"=="%PARAMVALUEFLAG%" (
echo !FILENAME!,%PARAMNAME%,%%m
set DONEWITHFILE=1
)
)


if "%%k"=="#END_OF_P_OBJECT" (
echo !FILENAME!,%PARAMNAME%,---
set DONEWITHFILE=1
)

)

)

set FOUNDIT=0
set I=0
set DONEWITHFILE=0

)
+++++++++++++++++++++++++++++++++++++++++++++++++++++

Announcements