Jump to content

vipin

Members
  • Content Count

    108
  • Joined

  • Last visited

  • Days Won

    8

Reputation Activity

  1. Sahithya liked a post in a topic by vipin in Adding buttons to the Utility Menu without administrator access   
    Move your custom macros under 
    // User Page Macro Definitions it will appear.
     
     
     
     
    // HWVERSION_2017.2_Jul 25 2017_20:5:5
    /////////////////////////////////////////////////////////////////////////////// 
    // Filename: userpage.mac
    // Purpose:  Macro menu 'User' page definitions.
    // Version:  HyperWorks
    // Altair Copyright:
    /////////////////////////////////////////////////////////////////////////////// 
     
    //    User Page Widget Definitions
    //
    //    Note: Since relative row locations are used, the menu page is built from
    //          the bottom up.
    //
    //    The following templex test is used to see if the Tcl support buttons
    //  should be added.
    //{ if ( getenv("HM_DEBUG") == "ON" ) }
        *createbutton(5, "TkCon ...",   -1, 0, 10, BUTTON, "Launch the Tk Console.", EvalTcl, "tkcon.tcl")
        *createbutton(5, "GUI Toolkit ...", -1, 0, 10, BUTTON, "Launch the GUI Toolkit.", LaunchWidgetTour)
        *createbutton(5, "ProDebug", 0, 0, 10, BUTTON, "Connect to the TclPro debugger.", ConnectToDebugger)
    //{ endif }

    //    User Page Macro Definitions
    *createbutton(5, "Add Washer", -1, 0, 10, BUTTON, "Adds a washer to the existing hole in the mesh.", "EvalTcl", "macroAddWasher.tcl")
    *createbutton(5,"SaveFile TCL",-1,0,10,GREEN,"Save file using TCL macro", "EvalTcl","E:\vipin\savefile.tcl")
    ///////////////////////////////////////////////////////////////////////////////
    *beginmacro("ConnectToDebugger")
        //  Purpose:    To connect to a remotely running ProDebug session.
        // 
        //  Note:          The pathname to the 'prodebug.tcl' script may need to be 
        //                modified to    reflect your installation of TclPro.
        *evaltclstring("source /Program\ Files/tclPro1.4/win32-ix86/bin/prodebug.tcl; debugger_init;",0)
    *endmacro()
    ///////////////////////////////////////////////////////////////////////////////
    *beginmacro("LaunchWidgetTour")
        //  Purpose:    Launch the HyperWorks Widget Tour dialog.
         *evaltclstring("::hwt::WidgetTour",1)
    *endmacro()
  2. vipin liked a post in a topic by MOHAMMED ABDULLA T in Set Note Attachment at Maximum point of curve   
    Thanks Livil
     
    I got the solution
  3. vipin liked a post in a topic by llyle in Set Note Attachment at Maximum point of curve   
    Hi Mohammed
     
    I haven't done this yet, you can try:
     
    pltINote_handle SetAttachment curve
    pltINote_handle SetAttachToCurveIndex $curveID
    pltINote_handle SetAttachToPointIndex point_index
     
    to find point_index you can GetVectorHandle and from vectorHandle GetValuesList  list. Find at what index the maximum value occurs in the value list.
     
     
  4. MOHAMMED ABDULLA T liked a post in a topic by vipin in Find specified number of nodes nearest to the selected node   
    Hi,
    Check "by sphere" option in *createmark
     
  5. vipin liked a post in a topic by MOHAMMED ABDULLA T in Get step names in Hyperview   
    Thanks for the reply 
    I got the solution
    resultHandle GetSimulationLabel sub_id  step_no
  6. MOHAMMED ABDULLA T liked a post in a topic by vipin in Problem with OpenFileEntry API   
    Hi @Jeffersondhv,
     
    It is because you have already defined cmd_btn with the value 'Nothing'.
    The value of textVar is actually changing. Replace the line like this, it should be working.
    button $lbl_ref.import_ref -text $textVar -command {tk_messageBox -message $textVar -type ok} -bg #60C060
     
  7. vipin liked a post in a topic by Jeffersondhv in Problem with OpenFileEntry API   
    That solved it. Thanks @vipin!!!
  8. Jeffersondhv liked a post in a topic by vipin in Problem with OpenFileEntry API   
    Hi @Jeffersondhv,
     
    It is because you have already defined cmd_btn with the value 'Nothing'.
    The value of textVar is actually changing. Replace the line like this, it should be working.
    button $lbl_ref.import_ref -text $textVar -command {tk_messageBox -message $textVar -type ok} -bg #60C060
     
  9. vipin liked a post in a topic by MOHAMMED ABDULLA T in createcirclefromcenterradius   
    set vec_id [hm_getmark vector [*createmark vector 1 -1]]
     
    You will get the id of last created vector.
  10. hugo_c liked a post in a topic by vipin in TCL/TK script : get entity type Slave/Master   
    Hi,
    Try this dataname. Similarly for slave.

  11. Ondrej liked a post in a topic by vipin in Predefined userprofile   
    Usually it works. Try deleting hmsettings,hmmenu files in your working directory(by default my documents)  and restart hm.
  12. vipin liked a post in a topic by llyle in Predefined userprofile   
    Hi,
     
    Deleting those files usually helps, Or you can write a .bat files like below:
     
    "C:/Program Files/Altair/2017.3/hm/bin/win64/hmopengl.exe" -nouserprofiledialog -uOptiStruct
     
    Search HyperMesh Startup Options in Altair Connect or in Help doc for more info. 
  13. llyle liked a post in a topic by vipin in Boolean operations. Creating general surfaces   
    Hi
    Try simple loops like this. 
     
    for {set i 1} {$i<6} {incr i} {
    for {set j [expr $i+1]} {$j<6} {incr j} {
    *createmark solids 1 $i
    *createmark solids 2 $j
    *boolean_merge_solids 1 2 14 2
    }
    }
  14. vipin liked a post in a topic by AlexanderP in Boolean operations. Creating general surfaces   
    Thank you. It works 
  15. AlexanderP liked a post in a topic by vipin in Boolean operations. Creating general surfaces   
    Hi
    Try simple loops like this. 
     
    for {set i 1} {$i<6} {incr i} {
    for {set j [expr $i+1]} {$j<6} {incr j} {
    *createmark solids 1 $i
    *createmark solids 2 $j
    *boolean_merge_solids 1 2 14 2
    }
    }
  16. Vikas Kumar liked a post in a topic by vipin in To get node id attached to a system through CELAS2 Element   
    @Vikas Kumar,
     
    Is this something you are looking for?
     
  17. tinh liked a post in a topic by vipin in How to convert mesh into separete surfaces   
    Hi
    Goto 2d >> detach elements(check detachall).
    Now create surface from FE.
  18. vipin liked a post in a topic by tinh in Get mid-side node   
    I remember there is a relevant command but can't find it.
     
    Example to get mid side nodes of quad8:
    *createmark elems 1 "by config" quad8
    set NodeList [hm_getvalue elems mark=1 datanames=nodes]
    set MidNodes [join [regsub -all {\{[0-9]+ [0-9]+ [0-9]+ [0-9]+ } $NodeList \{]]
  19. llyle liked a post in a topic by vipin in TCL/TK script : get entity type Slave/Master   
    Hi,
    Try this dataname. Similarly for slave.

  20. vipin liked a post in a topic by tinh in Control (focus) another HM screen based on movement in first HM.   
    Because zoom in/ zoom out not recorded in command.tcl, you cannot catch that event
    So I think periodically monitor viewmatrix, if it is changed we will send message to 2nd hm
     
    A timer is created by command 'after'
    A proc like this will self-repeated by a timer:
     
    proc ::MonitorViewMatrix {Period Callback} {
         if {![info exists ::MonitorViewMatrix(matrix)]} {
              set ::MonitorViewMatrix(matrix) [hm_winfo viewmatrix]
         }
         set matrix [hm_winfo viewmatrix]
         if {![string equal $matrix ::MonitorViewMatrix(matrix)]} {
              catch {eval $Callback}
         }
         if {[info exists ::MonitorViewMatrix(timer)]} {
              after cancel $::MonitorViewMatrix(timer)
         }
         set ::MonitorViewMatrix(timer) [after $Period [list ::MonitorViewMatrix $Period $Callback]]
    }
     
     
     
    You have to prepare a callback proc, example ::SendTo2ndHm
    Then start monitoring view changes by:
    ::MonitorViewMatrix 2000 ::SendTo2ndHm
     
     
    To send a message to 2nd hm, you should use dde facility, or socket (need administrator account)
     
    Are you familiar with client-server programming?
    Refer to dde commands in Tcl/Tk manual.
     
    Example::
    Open a server on 2nd hm:
    package require dde
    dde servername -handler eval -- HM2
    (HM2 may be changed if another already opened)
     
     
    A simple ::SendTo2ndHm on 1st hm:
    package require dde
    proc ::SendTo2ndHm args {
         dde eval -async HM2 *viewset {*}[hm_winfo viewmatrix]
    }
     
     
  21. vipin liked a post in a topic by llyle in Show elements in a pre-defined set in hw   
    Hi Roche,
     
    You can try the below commands to Set you need:
    set setHandle [$modelHandle GetSelectionSetHandle setH1 "Set $id"] set nameSet [setH1 GetLabel] # Can also be: set setHandle [$modelHandle GetSelectionSetHandle setH2 "User_Set $id"] set nameSet [setH2 GetLabel] # User_Set or Set are called pool can be found through GetPoolList # Refer documentation for more info.  
  22. Bachelor22 liked a post in a topic by vipin in Creating a label in the utility menu   
    Hi,
    It is *createtext()
  23. MOHAMMED ABDULLA T liked a post in a topic by vipin in Get highest set ID number   
    Yes Hypermesh does that for you. In case you need, try with hm_entitymaxid.
     
  24. vipin liked a post in a topic by llyle in Create Dictonary of Nodes And their corrosponding Coordinates   
    Hi Sanket,
     
    try,
     
    foreach node $lst_nodes { dict set mydict $node [join [hm_nodevalue $node]] }  
  25. vipin liked a post in a topic by tinh in Get highest set ID number   
    Don't do that, 
    Use hm_latestentityid to return created set id
    It could not be max id if includes are there (from version 13)
×
×
  • Create New...