method for CATIA environment

COE Administrator

method for CATIA environment
Hi,

Can somebody tell me what is the VB method for retrieving CATIA environment Name
Say for example to retrive default CATIA Env name: CATIA.V5R15.B15

Thanks,
Srini

Atul Sharma

method for CATIA environment
(in response to COE Administrator)
You can find that in the EnvName.txt file located in the Catia installation directory...Mine is in C:\catiap3\R15\intel_a...

All you have to do is read that file for the information you need. Look in the VB help for the FileSystemObject, or a section called Working With Files. I'm not sure if it's available in VBA or not, but I'm sure there is something like it if there it isn't.

Nate

Jim Strawn

method for CATIA environment
(in response to COE Administrator)
Yes, but I think the question is, if there are several Environment Files, how do you know which one is being used?

Perhaps you could set another Environment variable in this file that you could then read? In otherwords set the following environment variable:

My_Environment = CATIA.V5R15.B15.MYENV

And then see if you can grab that variable from within VB. I don't know if this will work, but it might be worth a shot. Please let us know if it works.

Atul Sharma

method for CATIA environment
(in response to COE Administrator)
Yep I suppose that would complicate things...didn't see his second question till after I responded to this one.

COE Administrator

method for CATIA environment
(in response to COE Administrator)
Have you tried using the SystemConfiguration object. It has several properties that might be useful to you:

Release
ServicePack
Version


I haven't tried these, so I can't vouch for them. I have used the OperatingSystem property before though.

COE Administrator

method for CATIA environment
(in response to COE Administrator)
Sorry, I re-read some of the other postings and I realise that my suggestion would only work if you had a single env file for each release, and it followed a predefined naming scheme.

Over here, we use a little tcl gui to select the required CATIA env and to start catia with that selection, so we can set env variables to do the job. (you would get the value via the SystemService.Environ function).

COE Administrator

method for CATIA environment
(in response to COE Administrator)
Using what Jim Strawn said in the above post in combination with the CATIA.SystemService.Environ function you will know exactly which Environment your CATIA application is using.

In the environment file create a new variable:

CATEnv=CATIA_FORUM_TEST

Then in your code call:

Dim myEnv as String
myEnv = CATIA.SystemService.Environ("CATEnv")

The variable myEnv will now equal "CATIA_FORUM_TEST"

COE Administrator

method for CATIA environment
(in response to COE Administrator)
Hi everybody

I have one more simple method :

Dim myEnv As String
myEnv = Environ("CATEnvName")

the var "CATEnvName" is already defined in the environment file

regards

Anoop Karumanchi

RE: method for CATIA environment
(in response to COE Administrator)

Hi,

Is there any method to identify CATIA  V5 Session environment directory path

Thanks in Advance

Anoop

Little Cthulhu

RE: method for CATIA environment
(in response to Anoop Karumanchi)

Hi.

Have you tried retrieving CATEnvName variable as it was suggested in the previous post of this thread? For me it holds full path to environment file (i.e. C:\CATIA\CATEnv\env1.txt) so retrieving directory path is trivial (look at CATIA.FileSystem object)