Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Inf files --model

Status
Not open for further replies.

cadcamguy

Industrial
Feb 23, 2005
348
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;
 
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

 
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 :)
 
Anyhow... got the revved up version that will spit out all parts, sub assy in a assy.... if any one is interested
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor