×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Inf files --model

Inf files --model

Inf files --model

(OP)
One thing I have never cared for is the way ProE outputs these files. Depends on how many times you do a Info>Model as to what the ending extension is.... .inf.3,inf.4 and so on. Unless you config windows to open all the different numbers with your editor, it's a pain. Then to top it off you don't seem to be able to copy and paste from Pro's Information window..say to a note. So then you have to rename the inf.? file to .txt so you can copy and paste from that... another pain.

It's great that ProE outputs this Info. I just wish they had made it a little easier to use the info.If I have my config.pro file set to "display_full_object_path yes", it will output those paths in the inf file even if I am pulling a model for a drawing from another directory...it's there... I like the option to use that info without too much trouble.

So, with a little VBS here is a way, you have to make sure there in only one set of inf file in your work dir..doesn't matter if its the same with all the .2,.3,.4 etc.it will purge those away ... and my purge.bat is on my path so it's a one liner on code. The mapkey wd will output a file so VBS will know what folder you are in, then the script runs and renames the inf file to a txt file.... then this is set to grab the maodel name for a drawing.. trims out the extra info and returns just the modelmname with full path.

With a little bit of tweaking, you could set this to get all the paths-model names of a assy.
So any questions let me know, but here is the code, naming and locations can be changed to suit your setup
script is named vbsinf.vbs and the path it gets is called
from c:\workdir.txt
Additonal mapkeys can be added in to automate the Info>model and create note from file... but you have to edit the note key, by dropping the last couple of lines or it just sticks in the same text value each time

Happy inf'ing
-------------------------------------------------------
dim wdir,mypath
dim dirpath

set wdir=createobject("scripting.filesystemobject")
set mypath=wdir.opentextfile("c:\workdir.txt",1,true)
dirpath=mypath.readline
mypath.close


Dim FSO, oFile, oFolder, strFolder
Set FSO = CreateObject("Scripting.FileSystemObject")

strFolder = dirpath

For Each oFile in FSO.GetFolder(strFolder).Files
 If InStr(oFile.Name, "inf.") Then

If FSO.FileExists(FSO.GetParentFolderName(oFile) & "\fileinfo.txt") Then
 FSO.DeleteFile FSO.GetParentFolderName(oFile) & "\fileinfo.txt"
End If


  FSO.MoveFile oFile, FSO.GetParentFolderName(oFile) & "\fileinfo.txt"
  Exit For
 End If
Next



set mypath=wdir.opentextfile("fileinfo.txt",1,true)
dirpath=mypath.readline
dirpath=mypath.readline
trim(dirpath)


dirpath = mid(dirpath,instr(dirpath,"C:\"))

mypath.close

set mypath=wdir.opentextfile("triminfo.txt",2,true)
mypath.writeline dirpath
mypath.close





mapkey wd @SYSTEM cd>c:\\workdir.txt;
mapkey vb @SYSTEM purge;@SYSTEMwscript c:\\proe2001\\batch\\vbsinf.vbs;
mapkey av %wd;%vb;

RE: Inf files --model

CADCAMGUY,

This seems like a FAQ in the making.

Best Regards,

Heckler
Sr. Mechanical Engineer
SW2005 SP 3.1 & Pro/E 2001
Dell Precision 370
P4 3.6 GHz, 1GB RAM
XP Pro SP2.0
NIVIDA Quadro FX 1400
      o
  _`\(,_
(_)/ (_)

"There is no trouble so great or grave that cannot be much diminished by a nice cup of tea"  Bernard-Paul Heroux
 

RE: Inf files --model

(OP)
Heckler,

You know what I'm saying... they give you all this info and not much means to work with it.

FAQ I would think would be more VBS oriented and that's okay ... I prefer VBA and VB ... VBS is too wordy, but we all have it available.

I know a lot of user would like to have a &path_model parameter but it seesm that PTC is more concerned with making Pro look like S/W

There is another method to this.. using a relation to pass info to parameter.. create note from that etc.. but then your faced with opening models up to do it.. unless you put it in your start part... I'm typing too much again

RE: Inf files --model

(OP)
Anyhow...  got the revved up version that will spit out all parts, sub assy in a assy.... if any one is interested

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources