Aug 17

    method for CATIA environment

    COE Administrator
    [Admin Group]

    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

    Atul Sharma
    [Cognizant Technology]
    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.

    Jim Strawn
    [Textron Aviation]
    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
    [Cognizant Technology]
    Yep I suppose that would complicate things...didn't see his second question till after I responded to this one.
    COE Administrator
    [Admin Group]
    Have you tried using the SystemConfiguration object. It has several properties that might be useful to you:


    I haven't tried these, so I can't vouch for them. I have used the OperatingSystem property before though.
    COE Administrator
    [Admin Group]
    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
    [Admin Group]
    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:


    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
    [Admin Group]
    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


    Anoop Karumanchi
    [Textron Aviation]


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

    Thanks in Advance


    Little Cthulhu
    [Sikorsky Aircraft]


    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)

    All Times America/New_York

    Copyright © 2016 COE. All Rights Reserved
    800-COE-CALL - 330 N. Wabash Ave, Suite 2000 - Chicago, IL 60611 USA
    All material, files, logos and trademarks within this site are properties of their respective organizations.
    Terms of Service - Privacy Policy - Contact