check file version on open?
check file version on open?
(OP)
I need to know if there is a setting in catia that will warn if you are opening a file from an earlier R level then what your running.
For example:
We have a customer that runs at r18 and our office runns at r19. i would like to know if there is a way to check on opening the file if it was from r18. so that the prints we do in r18 can't accidentally get saved in r19 and have to start over on them.
For example:
We have a customer that runs at r18 and our office runns at r19. i would like to know if there is a way to check on opening the file if it was from r18. so that the prints we do in r18 can't accidentally get saved in r19 and have to start over on them.





RE: check file version on open?
Certified SolidWorks Professional
RE: check file version on open?
You may do the following to find the CATIA Version, Release and Service Pack used to save a CATIA Document.
1. Open the document with your CATIA Installation.
2. Click [File]>[Document Properties]. The |Properties| dialog box will display.
3. In the |Properties| dialog box you may read between others what you are looking for.
Notes:
1. The document properties are not exposed to automation but can be retrieved easily by a programmer (with WinAPI in CATIA or by reading directly the stored file).
2. If you need this info to be displayed on Open, then you need to overload the CATIA Open command.
I hope it helps
-GEL
RE: check file version on open?
similar to how the file open can be redirected to a script to open from your document control system.
I am not skilled in scripting so i have no clue where to start even
RE: check file version on open?
that is kind of what i needed to hear.. at least i know it's possible now...
is there any direction on how to overload the catia open command?
RE: check file version on open?
Right click --> Open with
Browse to where you unzipped the CHECK_Version.exe
This will display, version, service pack, and hotfix levels.
Regards,
Derek
Win XP64
R20/21, 3DVIA Composer 2012, ST R20
Dell T7400 16GB Ram
Quadro FX 4800 - 1.5GB
RE: check file version on open?
Sub CATMain()
Set SystemConfiguration1 = CATIA.SystemConfiguration
Msgbox "CATIA V" & SystemConfiguration1.Version & " R " & SystemConfiguration1.Release & " sp " & SystemConfiguration1.ServicePack
End Sub
http://excelspreadsheetshelp.blogspot.com - http://scripting4v5.com
RE: check file version on open?
i will look at both of those, as soon as i can
I just got into work @ 9:15 (i love flex schedule) so i don't know when i'll get the chance today though.
RE: check file version on open?
In my opinion best program I found on net about this issue is what I found in www.catiav5forum.de , done by calin (by the way, did someone know what was happening with that forum, I cannot access it).
See attachment, just drag and drop your CATIA file over the program window.
Regards
Fernando
RE: check file version on open?
but, actually i think perhaps i wasn't clear enough...
i think what i need to do is replace the open comand or rerout it to a modified open command that check the files r level while opening and prompts if not from the same rev.
so i try to open an r18 with r19 and i get a prompt that asks if i really want to open this file...
RE: check file version on open?
Inside CATIA, with what you normally have at your disposal, is not possible.
Regards
Fernando
RE: check file version on open?
Certified SolidWorks Professional
RE: check file version on open?
Anyone with PDM experience?
RE: check file version on open?
Kevin, I was in your position few years ago, when I switched from SW to CATIA v4 (which is far away more unfriendly). It was a shock for me....but in any case you can do much more things in CATIA than in SW (especially with surfaces), price is talking himself, isn't it ?
Azrael, I'm working with Enovia 3DCOM (VPM) , but I don't know if such operation can be done, I'm not aware about this.
Coming to jagodragon question, maybe is it possible with vbs script, I was thinking of a scenario like this: run a CATIA macro (input here the name of the part to be checked and path) which could trigger a vbs script, opening with this a text editor, search those strings necessary to identify the release, then a message box with approval or not to open the part , finally opening the part or not (from vbs you can input commands in CATIA). Parts of all those codes I've already done it, if someone wants to see them, I can post here.
It seems a little complicated but it can be done...and I still say is much easier to drag and drop and see result...
Regards
Fernando
RE: check file version on open?
Can you please share the code, i want see them.
RE: check file version on open?
RE: check file version on open?
CODE
Sub CATMain()
call CATIA.SystemService.ExecuteBackGroundProcessus("WScript.exe c:\CAT\Open_CATPart_in_Notepad.vbs")
End Sub
Code in vbs file to open a CATPart in Notepad (check path and name for CATPart)
CODE
Set objShell = CreateObject("WScript.Shell")
objShell.Run("notepad " & "c:\Temporar\2DTest.CATPart")
In Notepad you need code to search string MinimalVersionToRead (this is what I didn't do it, maybe someone else can post some code)
Code to maximize CATIA and input a command, all in a vbs file
CODE
Set wshShell = WScript.CreateObject("WScript.Shell")
Set oWMI = GetObject("winmgmts:\\.\root\cimv2")
Set Processes = owmi.ExecQuery("select processid from Win32_Process where name ='CNEXT.exe'")
For Each Process In Processes
iPID =Process.ProcessID
wshShell.AppActivate(iPID)
wshShell.SendKeys "+(%" & space(1) & "r)"
Next
Set WshShell = WScript.CreateObject("WScript.Shell")
wshshell.AppActivate ("CATIA V5")
WshShell.SendKeys "c:" & "Open" & Chr(13),True
Of course, these pieces of codes has to be assembled (and modified where is need it) to create a whole. If someone has time it would be great to see the result here.
Regards
Fernando
RE: check file version on open?
RE: check file version on open?
RE: check file version on open?
The following is an answer to the question placed by you on 15/03/2002.
The Last Save Version Watcher
Here below you may find the methodology I used to implement a Last Save Version Watcher (LSVW) on CATIA V5.
Step 1: Preparation
First of all, we have to auto-run the LSVW every time we open a CATIA session. To do this, we need to write a script file (AutoRun.CATScript) which will load our application ie the Watcher
Next, we need to copy and paste our desktop icon of CATIA V5 and rename it to "My CATIA V5R20". In the [Properties] dialog box of it and in the [Target] field of the [Shortcut] tab we need to modify the text so as to run our AutoRun.CATScript script file.
Having done these, we have succeeded to run our application (LastSaveVersionWatcher.exe) every time we start a new CATIA session. When we click the customized CATIA icon, it will load CATIA. At the end of it, CATIA will run the AutoRun.CATScript. AutoRun.CATScript will run our application.
Step 2: The Application
What we need to do inside our application is that on load of it we need to install an appropriate hook to the already open CATIA window. (Can be done with the aid of SetWindowsHookEx API function) Now our application is able to intercept Windows messages sent to CATIA window, such as user selection of Open or Save menu item.
Step 3
In case of selection of Open menu item, we need to open our own[Open] common dialog box to allow the user to browse and select the file to open. On close of it we need to check if the user closed it with [Open] or [Cancel] button.
In the first case,
• read the last save version info stored in the selected file,
• read the version of the running CATIA session, and
• display them in a form where we can choose to open or cancel the operation
• in case we decided to open the file, use the CATIA open command to open the file in CATIA, otherwise do nothing.
In case of selection of Save menu item,
• read the last save version info stored in the CATIA active window reference file,
• the version of the running CATIA session, and
• display them in a form where we can select to save or cancel the operation
• in case we decided to save the file use the CATIA save command to save the file, otherwise do nothing.
Note: An advanced interface of the above solution is to display the last save version info as a tooltip text while user hoovering over a CATIA file in the Open common dialog box.
I hope it helps
-GELFS
RE: check file version on open?
1 question though...
where is the "LastSaveVersionWatcher.exe" located at, that is where can i dl it from? I did try to find it my self first but i can't seem to locate that one...
RE: check file version on open?
The intention of my post was to expose to the forum the methodology I used to deploy a last save version watcher on CATIA V5.
The LastSaveVersionWatcher.exe file is the file name of the application I developed. It is not shared software.
-GELFS