1

Just wondering is it possible to launch Catia from a web page. I also wanted the web page to be able to display a list of people who currently have a license. This web page will eventually be deployed on the company intranet. We currently have 19 Catia licenses in our office. Most of our users are using R19

any help much appreciated.

David Egan
  • 424
  • 2
  • 8
  • 23
  • Browser security (thankfully) doesn't allow a web page to launch a program. If you can host your web content on network storage rather than over http, you might be able to do something with an `.HTA` file. Or it might be possible to write a browser plug-in to handle launching the application. [FireBreath](http://www.firebreath.org/) might interest you, although the future of this project [is questionable](http://www.firebreath.org/display/documentation/Browser+Plugins+in+a+post-NPAPI+world); or perhaps [Silverlight](http://stackoverflow.com/questions/14436437/) (I wouldn't know). – rojo Dec 08 '14 at 18:06
  • Yes the web pages would be deloyed on the company network. Not on the internet. – David Egan Dec 09 '14 at 08:40
  • I'm interested to see if you figure this out. The license manager interface is a bit clunky to see who's using which licenses. Do you use floating/share-able licenses as well? – GisMofx Dec 09 '14 at 14:13
  • Yes I finally developed the above project. It's web based as the original spec indicated. In addition it also tracks Catia usage time. The core technologies I used was HTML5, XML, CSS3 and PHP. To over ride browser securities I developed a click once application in visual studio. The click once application launches a batch file which in turn launches Catia and our PLM. We call this project S.L.A.M. S.L.A.M. also allows the user to choose any one of 6 versions of Catia we use in the office. S.L.A.M. is used by some 40 engineers. – David Egan Oct 14 '15 at 10:36

3 Answers3

0

You can launch CATIA from a hta application as already was mentioned here. With this you can handle specific CATSettings for licenses (also for different CATIA environments) but you have to convince your users to use the hta. You can find also some CATIA launchers already done on Internet.

In this way, you can avoid to let users to get a separate license which can be included also in another one (for example a separate MD2 and a HD2 - which has included a MD2 near some others).

The list of the peoples which are using a license and what license they have can be taken from LUM software but you need to read the documentation of that software (and this will not solve the problem of multiple taking of the licenses by users).

ferdo
  • 178
  • 4
0

I wouldn't recommend hta for launching Catia. You can write a pretty simple launcher in C# with forms or wpf. On the license front you're on your own as well. There are a few products out there that cost money. If you're using LUM, you can write a script that queries the server and spits out the license information, and then write a webpage that shows that data.

I've written both and can give you more specific tactics.

Eugene
  • 115
  • 1
  • 4
0

If you are running this from an intranet (and you said you are) you can use VBscript from IE. I know it's not the best browser, but since in my company it's the official one, i provided some tools to my colleagues to do some actions like this. My best solution (the least worst I found), is to run a batch file, which call Catia

To run the batch file from VBscript (still works on intranet): shell.Run "C:\foo\startCatia.bat"

And the Batch File should contain CNEXT, which should open Catia

But then you might have issues with environment variables, and licence. I wasn't able to avoid this, until I found a way to write them in the batch file (of course this has to be done from Catia, so I create in the background of other macros, and it cannot work before the user has launch one of my tool to create this batch). Here is the code to run in Catia to write this batch file:

Sub catmain()
    Set oFileSys = CATIA.FileSystem

    temp = oFileSys.TemporaryDirectory.Path
    envpath = temp + "\env.txt"
    GetPath = temp + "\getenv.bat"
    runpath = CATIA.SystemService.Environ("USERPROFILE") + "\Desktop\StartCatia.bat"

    On Error Resume Next
    oFileSys.DeleteFile envpath
    oFileSys.DeleteFile GetPath
    oFileSys.DeleteFile runpath
    On Error GoTo 0

    Dim defaults(1111, 2) As String

    Set defaultslist = CreateObject("WScript.Shell").Environment

    Set GetFile = oFileSys.CreateFile(GetPath, False)
    Set getStream = GetFile.OpenAsTextStream("ForWriting")
    getStream.Write "set > " & envpath
    getStream.Write Chr(10)
    getStream.Close
    CATIA.SystemService.ExecuteProcessus (GetPath)

    Set RunFile = oFileSys.CreateFile(runpath, True)
    Set RunStream = RunFile.OpenAsTextStream("ForWriting")

    Set envfic = oFileSys.GetFile(envpath)
    Set envStream = envfic.OpenAsTextStream("ForReading")
    line = envStream.ReadLine
    While line <> ""
        l1 = InStr(line, "=")
        envvar = Left(line, l1 - 1)
        dest = Right(line, Len(line) - l1)
        defcontent = defaultslist.item(envvar)
        If defcontent <> dest Then
            'Set each environment variables
            RunStream.Write "set " & line & Chr(10)
        End If
        line = envStream.ReadLine
    Wend
    envStream.Close
    'Add a command to launch Catia
    RunStream.Write "CNEXT" & Chr(10)
    RunStream.Close

    On Error Resume Next
    oFileSys.DeleteFile envpath
    oFileSys.DeleteFile GetPath
    On Error GoTo 0
    MsgBox "StartCatia.bat created on your desktop", vbInformation, "hjn fast launcher"
End Sub
Rafiki
  • 604
  • 6
  • 19