Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

check file version on open? 11

Status
Not open for further replies.

jagodragon

Automotive
Mar 2, 2009
61
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.
 
Replies continue below

Recommended for you

Nope. A much more energy consuming but still doable alternative is to right-click on the CATIA file and choosing "Open With" and then select Notepad. Then do a search in the Notepad window for, I'm going off memory, but I think CNEXT will do the trick within the first few search hits. Either that or you can try R16, R17 and so on until it finds a match in the text.

Certified SolidWorks Professional
 
Hello JagoDragon,
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
 
yeah, i was hoping that it could be writen into a script that functioned apon opening.

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
 
thank you Gelfs,

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?
 
Select the CATPart or CATProduct file in a windows explorer.
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
 
 http://files.engineering.com/getfile.aspx?folder=b189c15d-8c4f-4bb5-87cb-17c84a88caf8&file=CHECK_CATIA_VERSION.zip
For a start, the following code will tell you which version of CATIA you're currently using:

Sub CATMain()

Set SystemConfiguration1 = CATIA.SystemConfiguration

Msgbox "CATIA V" & SystemConfiguration1.Version & " R " & SystemConfiguration1.Release & " sp " & SystemConfiguration1.ServicePack

End Sub


-
 
thanks ntweisen and dbezaire,

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.
 
Nick, I believe question was clear enough, using a CATIA version is not the same thing like in which version was saved last time a CATIA file, your code is good if you have more CATIA releases installed and you don't use a launcher or a specific shorcut and you don't know what you launched...

In my opinion best program I found on net about this issue is what I found in , 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
 
Thanks to all,
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...
 
Yeah, that means run a macro to open an external CATIA program , check there CATIA file and give the answer in CATIA...I believe is easier just drag and drop the file and see the result (to open the attached program from CATIA it can be done very easy with a macro).

Inside CATIA, with what you normally have at your disposal, is not possible.

Regards
Fernando
 
Give it up already, stop trying to make CATIA behave like SolidWorks ;)

Certified SolidWorks Professional
 
After some thinking I believe it can be done. Haven't tested anything, just an idea. It cannot be done in catia short of using CAA to develop your own open function.... but if you have a PDM system, smarteam?, I think a trigger can be set during open or check out.

Anyone with PDM experience?
 
Hi,

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
 
Hi Ferdo
Can you please share the code, i want see them.
 
ferdo, That sounds like excactly what i esd thinking. the only problem is that i don't know how coing works in catia...
 
Code in CATScript to run a vbs file (see path and name for vbs file)

Code:
Language="VBSCRIPT"
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:
Dim objShell
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:
dim wshShell
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
 
append a _r18 and _r19 to the catpart if possible. (or the directories)
 
Spoke with a smarteam admin guy during the easter holidays, with some beers, that believes that a check can be set up when opening from smarteam. I have no experience here but according to him an event (a code) can be set up in the script manager to execute before executing defined function like the open operation.
 
Hello JagoDragon,
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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor