Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Get CATIA V5R19 Object from a vb script and not R20

Status
Not open for further replies.

Milie

Computer
Nov 27, 2013
12
Hello!

I saw a lot of posts on how to get CATIA object in a vbscript and what's usually ok is to just do the following in a vbs:

Dim CATIA
Set CATIA = WScript.GetObject("", "CATIA.Application")

My problem is that I have several versions of CATIA on my machine and this script tries to get the latest version installed which is CATIA V5R20 64 bits. What I would like is to get the CATIA V5R19 32 bits. I though the script would get the CATIA that is currently launched but it's not the case...

My question is : how can I get a specific version of CATIA object?

Thanks a lot!
 
Replies continue below

Recommended for you

Hi,

I have also few versions installed but never acting like you described. It is a problem indeed if I have more then one CATIA opened, no meter what release but I always check first this situation and give warning to the user to close one session.

Maybe it can be done by checking the PID number in Task Manager or window name or location of the CNEXT.exe ?


Regards
Fernando

 
Hi,

try
Set CATIA = WScript.GetObject("", "CATIA.Application.1")
(This for sure will run the V5R20 64 bits version)
and then

Set CATIA = WScript.GetObject("", "CATIA.Application.2")
(This may run the V5R19 32 bits version)

Keep increasing the counter until you get an error message from your script.

If it is not working, then Export the key "My Computer\HKEY_LOCAL_MACHINE\SOFTWARE" of your Registry to a txt file, upload it here and I will have a look to your problem.



-GEL
Imposible is nothing.
 
Hi!!

Yesterday, before seeing your comments, I read something about register and unregisterversions of CATIA so I unregistered the R20 by doing :
1.CD to the unload directory of the version of CATIA to un-register
2.Run the command cnext.exe unregserver
I reboot my pc. I can see it worked cause when I check the component services (dcomcndf in the command)in the DCOM configuration, I see no CATIA.Application value. Before to unregister, there was one with the path to a CATIA install.

Then I want to registered my R19 version of CATIA by doing :
1.CD to the directory of the version of CATIA to register
2.Run the command cnext.exe regserver
I reboot my pc.
I go back to the DCOM conf and I still see nothing...
Of course when I launch my script, it does not work : "Automation class "CATIA.Application" not found" code 80020009.

I think if I re-install it will be fine but I would like to find another solution..

Do you know how to register the CATIA.Application ? Then I'll be able to try what you proposed.

Thanks!
Emilie



 
My bad, I did a mistake, : I typed cnext.exe regserver instead of cnext /regserver ...
Will do the tests you said now... :p
 
Hello Milie,

you have to resume your computer to the state it was before the ungegistration of V20.
You can do this by Restoring the Registry to an earlier Restore Point on your registry.
You can see how here.


-GEL
Imposible is nothing.
 
Hello guys!

First of all, thank you for your help :) I manage to register my CATIA V5R19 32bit again.

GEL, you proposed to have a look at my registry. Here it is :
Link
Cause I tried the
Set CATIA = WScript.GetObject("", "CATIA.Application.1")
and
Set CATIA = WScript.GetObject("", "CATIA.Application.2")
but I get an error with the second. With the first I have no error but it works with the first version of CATIA I launched.

Thank s a lot for this :)

Emilie
 
Hi Emilie,

Looking into the registry of your computer (ie a computer where two releases of CATIA are installed) my conclusion is that only one version of CATIA V5 can be registered with Windows at a given time.
I have an idea that may be a solution to your problem but in order to check it out I need you to do the following
1. Register again the release V5R20
2. Export the same key of your registry to a txt file and upload it here.



-GEL
Imposible is nothing.
 
Hello Gelfs!

I registered the V5R20 as you said (I didn't unregister the other one, should I?) and here is the link to my registry file Link

Thanks again!
Emilie
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor