×
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

Get CATIA V5R19 Object from a vb script and not R20

Get CATIA V5R19 Object from a vb script and not R20

Get CATIA V5R19 Object from a vb script and not R20

(OP)
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!

RE: Get CATIA V5R19 Object from a vb script and not R20

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

https://picasaweb.google.com/102257836106335725208
https://picasaweb.google.com/103462806772634246699...

RE: Get CATIA V5R19 Object from a vb script and not R20

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.

RE: Get CATIA V5R19 Object from a vb script and not R20

(OP)
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



RE: Get CATIA V5R19 Object from a vb script and not R20

(OP)
My bad, I did a mistake, : I typed cnext.exe regserver instead of cnext /regserver ...
Will do the tests you said now... :P

RE: Get CATIA V5R19 Object from a vb script and not R20

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.

RE: Get CATIA V5R19 Object from a vb script and not R20

(OP)
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 smile

Emilie

RE: Get CATIA V5R19 Object from a vb script and not R20

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.

RE: Get CATIA V5R19 Object from a vb script and not R20

(OP)
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

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