Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

reading 2 files in pro program

harichennai

New member
dear all,


Iam new to this group, I am happy about the activities in this group.


iam working in PROE for the past 4 years


now my question is ..


Can a program GET INPUT option >READ FILE option be used for reading from more than one file, .txt file in my case..?


Iam trying to update the gear table in my drawing using new inputs from .txt file each time..


I hope i will get a good reply, or atleast someone will come up with alternate solutions...


Thanks a lot all


Hari Parthasarathy
 
Pro/PROGRAM can read inputs from a file as long as it follows the following syntax:


Parameter1 Value1


Parameter2Value2


Parameter3Value3


...


Where:


Parameter1, 2, 3 are the parameter names


Value 1, 2, 3 are the parameter values of the proper types for the named parameters.


From file can be used each time Pro/ENGINEER is regenerated. Butonly one file can be read for each regeneration.


So to answer your question, "FROM FILE" can only be used once per regeneration.This technique may cause regeneration failure depending on the passed values. If so, you can "FIX MODEL > REGENERATE > FROM FILE" again and read in the missing values. If this doesn't fix it, you will have to use another method.


If the values are already available, you can create a single text file with all possible parameters in it. Some parameters listed in the text filedon't have toexist in the Pro/ENGINEER model. Pro/ENGINEER ignoresany extra parameters in the input text file.


There are other options available depending on your automation scenario, but I need more information about what you are doing to make specific recommendations.


Hope this helps,


Matt
 
Thanks Matt,


So, I understand that pro program cannot read values from more than one file.


As you told, I have already tried to combine all values in a single file,


i give you the more information you have asked.


1. I have 2 .txt files , each file has the tooth details for a gear.


2. I have to read each file by pro program and fill in the gear table in my gear drawing.


3. I dont want to combine the 2 .txt files into one file, because they are directly genrated by kiss soft gear calculation software., so i want to use the combined data option [1file] as the last option.


i hope i am clear for you to suggest.


Thanks a lot.


Best Regards


Hari Parthasarathy
 
Hari,


What kind of information is in these text files? Are these point locations, parameters for curves by equation, etc? Can you save them as comma delimited files with the extension csv?


If you have behavioral modeling, you can create an Excel analysis feature that would read in the data and set specific Pro/ENGINEER parameters from the csv file.


I know it is your lastresort, but you can combine two text files (file1.txt and file2.txt)into a single text file (inputs.txt) using a batch file lile this:


@echo off
if exist inputs.txt del inputs.txt
for /F "eol=! tokens=1* delims=," %%i in (file1.txt) do (
echo %%i >>inputs.txt
)
for /F "eol=! tokens=1* delims=," %%i in (file2.txt) do (
echo %%i >>inputs.txt
)
@echo on
exit


Please let me know if this is going in the right direction.


Thanks,


Matt
 
Dear Matt,


The direction you gave is a good one.Because the easiest wasy is to use 2files and then combine the contents into a single one..


the thing is you have automated the process, so i can read only the input.txt..


i dont use behaviourial modelling..


and the file has the diameters ..namely addendum, dedundum, then it has thickness,pressure angle.





thanks Matt, the solution is sensible..


Hari Parthasarathy
 
Hari,


You might want a Pro/TOOLKIT application created to do what you want. There are several companies that will create custom Pro/TOOLKIT applications for you. I know FroTime (www.frotime.com) is one of those companies. You should check them out.
 

Sponsor

Articles From 3DCAD World

Back
Top