🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

Running a script using tcl\tk

User: "Vikas Kumar_22189"
Altair Community Member
Updated by Vikas Kumar_22189

Can we run a script using tcl\tk script so it will provide all Hypemesh api's without opening Hypermesh.

 

Or can we import package related to Hypermesh script without opening hypermesh or running tool from command prompt.

 

 

image.png.6be8301f322d736f487b8495ceeae5b7.png

Find more posts tagged with

Sort by:
1 - 22 of 221
    User: "tinh"
    Altair Community Member
    Updated by tinh

    I am not sure. Maybe we can load some *.dll file containing hm api into tcl interp

    try command 'info loaded' to see them

     

    Instead, we can open hm in background so you don't see its GUI but all functions are available.

    User: "Jouher_20929"
    Altair Community Member
    Updated by Jouher_20929

    Yes, I have tried this using batch file

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    Hi Jouher,

     

    How it can be done using batch file please let me know.

     

    Thanks and regards

    Vikas Kumar

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    Hi tinh,

     

    While loading any .dll file from hyperworks tclsh stops working and giving error.

     

    image.png.044f339dc130f361060285efeda060eb.png

     

    I am using command     load 'C:/Program Files/Altair/14.0/hm/bin/win64/hwatnetworkdiagram_tcl.dll'      and i am using tclsh 8.6 version.

     Thanks

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hi,

    maybe the file is loaded by hm. it needs other dependent libraries

    I don't see any tcl command loading it

    so other tcl version is also not able to load it.

     

     

    User: "Jouher_20929"
    Altair Community Member
    Updated by Jouher_20929

    Hi Vikas,

    Create a batch file by Following this procedure:

     

    d: (drive where Altair HM is installed)
    Altair\14.0\hw\tcl\tcl8.5.9\win64\bin\wish85 \\PATHofTCL\Main_file.tcl

     

    Thus it will look like

    d:
    Altair\14.0\hw\tcl\tcl8.5.9\win64\bin\wish85 \\XYZ\Main_file.tcl

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    Hi Jouher,

     

    After that how to call .batch file and what will be content of batch file.

    I have given this but it's not working i am running .bat file by using command  'exec batFile.bat' in tclsh prompt.

     

    C:\Program Files\Altair\13.0\hw\tcl\tcl8.5.9\win64\bin\wish85\\D:\Vikas\Backup\TCL_TK\checkExit.tcl

     

    It is showing 

    image.png.ce7649881cc5b7ea089dd83584e7182a.png

     

     

    Thanks

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hi Vikas,

    it is clear that you need quotes because your path has a space

    'C:\Program Files\Altair\13.0\hw\tcl\tcl8.5.9\win64\bin\wish85' D:\Vikas\Backup\TCL_TK\checkExit.tcl

     

    if path of your tcl file has spaces, you need to quote it, too

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    Only in C directory altair path has space but i kept it like

     

    'C:/Program Files/Altair/13.0/hw/tcl/tcl8.5.9/win64/bin/wish85.exe' 'D:/Vikas/Backup/TCL_TK/checkExit.tcl' 

     

    still it's not working

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Please show your 'checkExit.tcl' content?

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    A simple code ..

     

    wm protocol . WM_DELETE_WINDOW chk_exit
      proc chk_exit {} {
        set ans [tk_messageBox -type yesno -icon question -message 'Are you sure you want to quit?']
        if { $ans != 'no' } {
             exit
           }
      };# chk_exit

     

     

    User: "tinh"
    Altair Community Member
    Updated by tinh

    I tested. It worked!

    what is error in your case?

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    It is showing 

     

    image.png.2c69bae7daae1d3efb3ef6e6ebe9e32c.png

     

    But file exist at given location .

     

    My batch file I am attaching with this.

    Unable to find an attachment - read this blog

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Hi,

    there is abnormal characters in your path:

    Capture.PNG.a8c44b2196f8314bcd2b5ce4f2e3558d.PNG

     

    Maybe, encoding problem.

    Try open notepad and edit batch file again

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    Hi tinh,

     

    i have uploade batch file too you can see there is no such character available

     

     

    Unable to find an attachment - read this blog

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    Hi Tinh,

     

    It's working if i am changing format of directory name to 

     

    'C:\Program Files\Altair\13.0\hw\tcl\tcl8.5.9\win64\bin\wish85.exe' 'D:\Vikas\Backup\TCL_TK\checkExit.tcl'

     

    instead of 'forwad slash ( / )' i am using 'Back slash (\)' .

     

    Thanks for your support

     

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    Hi Tinh,

     

    Now i am trying to run same .tcl file as file -> Run -> TCL\TK Script in HM by using this command

     

    'C:\Program Files\Altair\13.0\hm\bin\win64\hmopengl.exe' 'D:\Vikas\Backup\TCL_TK\checkExit.tcl'

     

    but it's only opening the Hypermesh. And not running the checkExit.tcl file.

    tinh or jouhar could you help me out to run the script.

     

    Regards,

    Vikas 

    User: "tinh"
    Altair Community Member
    Updated by tinh

    The target command should be

    (has ' -tcl ' with spaces before the tcl file)

    'C:\Program Files\Altair\13.0\hm\bin\win64\hmopengl.exe' -tcl 'D:\Vikas\Backup\TCL_TK\checkExit.tcl'

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    Hi tinh,

     

    Thanks for your support now it's working.

    Thanks alot.

     

    Best regards,

    Vikas

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    Hi tinh,

    May i get some more information on this.

    How you identified that there will be '-tcl' in between please if it is possible explain or share the link i will go through

     

    Regards 

    Vikas Kumar

    User: "tinh"
    Altair Community Member
    Updated by tinh

    Well, this question is much more difficult than your previous question !

    I know it for really long time ago (maybe version 8), so looking for it again was so tough :wacko:/emoticons/default_wacko.png' title=':wacko:' />

    You should spend your time to read all hm help documents!

     

    in hm help > altair help home > hyperworks desktop applications > getting started >

    hyperworks desktop overview > startup procedures and customization > starting hyperworks desktop application > hypermesh startup options

    User: "Vikas Kumar_22189"
    Altair Community Member
    OP
    Updated by Vikas Kumar_22189

    @tinh

     

    Thanks