Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations waross on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Modify model in proe with text file 4

Status
Not open for further replies.

joltinjohn

Aerospace
May 7, 2003
20
US
I'm looking for some options. I want to write a script that will read a text file, open proe, modify a model based on the text file and save the model. I dont want to actually see proe I just want it to run in batch mode.

Seems simple and I have looked at j-link, p-shell, toolkit.....but no easy answer.

It seems that this could be acomplished with just a simple start-up file that is correctly set...like starting with a trail file and running a mapkey???

I'm just looking for some options from this bright group.

Thanks in advance,
John
 
Replies continue below

Recommended for you

A trail file and a mapkey might be the answer.

Here's a few alternatives:

Pro/Web.Link allows you to create an HTML page with Javascript commands which allow it to connect to a Pro/E session and modify a model.

There is also an option in the relations editor to Link a model to a C program. You can use C's file I/O capability to feed in whatever parameters you need with relative ease, and then pass these back to the model.

Now... I'm suggesting these, never having made them work myself. I've tried both in the form of pre-existing demos, so I can say that they work, but these are two areas that are seriously lacking documentation, so I've never been able to reproduce something from scratch.

Also, I'm not sure if either of these can be executed with Pro/E in the background.

A toolkit program would probably do it, but last I checked a license for toolkit costs more than I make in a year. Which isn't much, but it makes learning toolkit rather prohibitive.
 
dgallup,

I thought I'd give that a try just for the learning experience. One question arises. Where is that "Read File" command hidden in Wildfire? I've searched and can't seem to find it. Then I tried the mapkey and it just does the regenerate.
"mapkey input #REGENERATE;#MODEL;#READ FILE;c:\files\data.txt;"

TIA,
<tg>


 
Just to let you guys know I have some of this working well. Here is a sample Proe Start command:

proe2001.bat pro_wait -g:no_graphics PROE.txt

Explanation:

The 'pro_wait' will wait until "pro" is done before it
continues and the "pro.bat" exit command will not close the parent batch file.

-g:no_graphics - Self explanatory

good luck
 
joltinjohn,

Curious, what are the contents of the PROE.txt file? Is this the file that contains your variable product data?

Would you be able to elaborate a bit more on how it worked? Do you end up with a Pro/E file configured as per your specs in your working directory?

And finally, is there a source for finding out all of the command line arguments?

I've never done this sort of thing, but something came up recently where this may be of use.

Cheers
 
Here is how it works:

1) I created a simple model of a beam.

2) In pro engineer create your parametric model

3) Change the symbol of the dimensions of interest to a name that can be easily remembered and used during a
simulation:

------------------------------------------------------
A) Part -> Modify -> DimCosmetics -> Symbol
B) Select the symbol to change and rename
C) Program the model to include inputs for the dimensions names ( this is how we input variables from the outside world)
D) Program -> Edit Design
E) A editor window will pop-up, add the input variables to this program window between the 'Input / End Input' lines.
Example Program Input:

F)

Was:

Input
End Input
----------
Is:

Input
wdt Number
thk Number
End Input



G) Do you want to incorporate your changes into the model? 'Yes'

H) Get Input -> Current Vals

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

4) Save this Model and exit

5) Create a text file called data.dat (or what ever) with the following.

wdt = 5
thk = 2

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

6) Re-open the model and regenerate. Pro will ask you if you want to read a file. Select the data.dat file you created and the model will update.

Note: Pro will not ask for a file if the model is not programed.

7) Now Save and Exit again.
----------------------------------------------------------
Now you have a trail file that will:
Open pro
Open the model
Regenerate based on data.dat
save the model
and finally close Pro.....

I think you can do this in session I just cant remember how
----------------------------------------------------------
8) You can now run pro in the batch mode to modify the model

proe2001 pro_wait -g:no_graphics my_new_trail_file.txt (make sure you rename the trail file and suffix it with *.txt or it will not work)

----------------------------------------------------------
9) with a little smarts you can now create a program that will generate the trail file with the appropriate files and location build in :).

I have been performing particuar tasks and saving them for future inclusion.

 
Ah I see now...

It wouldn't be too hard to make a VB application to make the trail/dat file and run Pro/E in the background after you've done this.
Thanks for the tip! [cheers]
 
joltinjohn,

This is a great thread. You should consider compiling it into a FAQ.

Best regards,

Matthew Ian Loew


Please see FAQ731-376 for tips on how to make the best use of Eng-Tips Fora.
 
Hej There,
I have a model completly controlled by parameters in ProE.
I control the model by entering parameters in an excel file and create automatically a text file with parameters.
Using trail files, ProE starts in no graphics mode and creates pictures of the configured model.

Until now nothing new...

I am making now a web application using php to send the parameters directly and the application will show the pictures of the model in the web application..

Anybody did that before ??

The application allows the creation of any 3D representation within seconds to anybody just buy using a web interface
 
Wow, sounds pretty cool.

I tried to get Pro/Web.Link to work at a past job, but time wasn't on my side when I was trying it out. It sounds similar to what you are doing (minus the PHP)...

The Web.Link demo featured a trailer that one could configure by entering in some parameters, and it returned an image of the customized trailer.

If I remember correctly, however, the limitation to Web.Link was that you had to do it from within Pro/E's web-browser interface. Sounds like you're on to a good solution using PHP.
 
Status
Not open for further replies.
Back
Top