Jump to content

Pandurang

Members
  • Content Count

    142
  • Joined

  • Last visited

  • Days Won

    3

Reputation Activity

  1. Pandurang liked a post in a topic by Imoto in keep mesh option using script   
    Hi @Pandurang
     
    Topology revision can change with "*deleteelementsmode 0".
     
    Thanks,
    Imoto
  2. Pandurang liked a post in a topic by Q.Nguyen-Dai in keep mesh option using script   
    "*deleteelementsmode"  is "Deprecated Commands"

    So it's better to use:
    *setoption delete_elements_mode=<value> The remesh setting for topology revision. 0 - Keep mesh 1 - Delete mesh 2 - Remesh 3 - Advanced remesh 4 - 2D + 3D (tetra) remesh  
  3. Pandurang liked a post in a topic by brahmadev in run VBS from TCL   
    Hello guys,
     
    Thanks for your response.
     
    Actually, the cscript was working perfectly, thing was I didn't keep a reference file as input for the VBS file because of which error has occurred.
     
    Thanks and regards,
    Brahmadev.
  4. Dhairyasheel liked a post in a topic by Pandurang in GUI Problem   
    .dialog buttonconfigure  ok -command {}
  5. Pandurang liked a post in a topic by Livil Lyle in How to get elements inside Database cross section plane   
    Hi, 
     
    *createmark elems 1 "on plane" "x y z i j k tol plane touching"
     
    "
  6. Pandurang 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
  7. Pandurang liked a post in a topic by Manjunath MD in How to set multiple result files in Hyperview using TCL/TK   
    Hi Team,
     
    I wanted to set multiple result files to one window using TCL/TK in hyperview. Is there any command to set multiple result files in hyperview customization. 
    I tried using "model2 SetResult static_derivedloadcase_2.h3d" API but its overriding the previous file.
     
    Thanks
    Manju   
  8. Pandurang liked a post in a topic by Livil Lyle in How to set multiple result files in Hyperview using TCL/TK   
    Hi Manjunath, 
     
    You can do it via:
     
    modelHandle AddResult $resultfileloc
  9. Pandurang liked a post in a topic by tinh in project nodes on nearest surface   
    1.Don't *createmark surfs 1 displayed  every loop !
    2.Use *nodemodify is faster than *projectmark
    3.Ignore associated nodes
     
     
    *createmark elems 1 displayed
    *findfaces elems 1
    *createmark nodes 1 "by comp name" ^faces
    *createmark surfs 1 displayed
    *createmark nodes 2 "by surface on mark" 1
    *markdifference nodes 1 nodes 2
    set nd_list ...
     
     
     
    => i think much faster
  10. Pandurang liked a post in a topic by tinh in project nodes on nearest surface   
    Hi
    the script is thought about long time ago
    There are some ways but not actually efficient.
    First i toggle all green lines to form 1 surf only => project easily, don't need script
    But sometimes mess up the mesh!
     
    Then i loop with each surf to project nodes on them. Mesh is not mess up
    But script very slow because large number of small surfs
     
    Then loop with each node to find closest surface, faster as surf list as shorter (appliable because we can limit surfs in a comp)
     
    A script like this
     
    Createmark surfs 1 all (or $slist , example: surfs in a comp => faster)
    Foreach node $nlist (
       Createmark node 1 $node
       Lassign [hm_measureshortestdistance surfs 1 0 0 nodes 1 0 0] => closestSurf x y z
       Nodemodify $node $x $y $z
    )
     
    Then i ....
    am thinking other ways because above one still too long (so usually, i let it run finally, overnight.
     
     
     
    Tips:
    If you can divide a big model file to many files, each file has a few comps, above script will run much faster. And by dividing model you can run files on hm sessions simultenously.
  11. Pandurang liked a post in a topic by tinh in How to select all nodes by path in a Closed Loop by scripting   
    Try *findloops
    https://forum.altair.com/topic/20793-finding-a-closed-loop-free-edges/?tab=comments#comment-47179
     
    Once getting loop elems, use hm_getvalue to return their nodes (will be ordered as by *nodelistbypath)
  12. kandiyal liked a post in a topic by Pandurang in Error in Tcl/Tk Macro to create multiple material   
    Use this code:
     
    variable  templatefilename [hm_info templatefilename];
    proc createMat {name E G Nu RHO id} \
    {    
        variable templatefilename
        *collectorcreate materials "$name" "" 35
        *createmark materials 1 "$name"
        *dictionaryload materials 1 "$templatefilename" "MAT1"
        *attributeupdateint materials $id 3240 1 2 0 1
        *attributeupdatedouble materials $id 1 1 0 0 $E
        *attributeupdatedouble materials $id 2 1 0 0 $G
        *attributeupdatedouble materials $id 3 1 0 0 $Nu
        *attributeupdatedouble materials $id 4 1 0 0 $RHO
        *clearmark materials 1;
    }
    createMat Steel 54000 72000 0.36 0.0000000065 1;
    createMat "Al 2024" 72000 80769.2 0.33 0.00000000785 2;
    createMat "Al 6065" 54000 72000.2 0.36 0.0000000065 3;
    createMat "ttl" 34000 71000.2 0.37 0.0000000067 4;
  13. Pandurang 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
  14. Livil Lyle liked a post in a topic by Pandurang in Adding Custom button to HyperMesh Utility Window   
    HI
     
    Create one userpage.mac file.
     
    code in that file to create button:
     
    *createbutton(5, "Deflection of Cantilever",   -1, 0, 10, YELLOW, "Launch Solution To Cantilever Beam.", EvalTcl, "C:\Users\pdd914713\Documents\Test.tcl")
    *beginmacro("CantileverBeam")
    *endmacro()
     
    keep this file in current working directory...then restart the Hm.
     
    You can find this info in HW help as well.
     HyperWorks Desktop Applications > HyperMesh > HyperMesh Tutorials > Customization > Scripts:
  15. sixz liked a post in a topic by Pandurang in Adding Custom button to HyperMesh Utility Window   
    HI
     
    Create one userpage.mac file.
     
    code in that file to create button:
     
    *createbutton(5, "Deflection of Cantilever",   -1, 0, 10, YELLOW, "Launch Solution To Cantilever Beam.", EvalTcl, "C:\Users\pdd914713\Documents\Test.tcl")
    *beginmacro("CantileverBeam")
    *endmacro()
     
    keep this file in current working directory...then restart the Hm.
     
    You can find this info in HW help as well.
     HyperWorks Desktop Applications > HyperMesh > HyperMesh Tutorials > Customization > Scripts:
  16. Pandurang liked a post in a topic by tinh in Auto change current component after excuting a command from pushpanel   
    A right programming flow is : make the script to create loads instead of clicking
  17. MOHAMMED ABDULLA T liked a post in a topic by Pandurang in Get step names in Hyperview   
    why it is needed?
  18. Pandurang liked a post in a topic by tinh in Python   
    You can find a lot of hm template example to summary data in folder ../altair/.../templates/summary
    those can summary cog, moi,... of comps or other entities
    if we loop through big data and use hm_getentity... to access data, use expr to calculate, or * commands, it is very slow
    but looping by template, it is very fast.
    example i have to check face-face angle of solid elems, tcl can do:
    foreach elemid $elemlist3d {
        set angle [p_calculateFaceFaceAngle $elemid]
        if {$angle>$criteria} {lappend failedlist $elemid}
    }
    => it's slow with plenty of solid elems
    now using template:
    set TplString {
    *elements(204,,,)
         //calculate angle...
         ...
         *if([#angle>#criteria])
              *markfailed()
          *endif()
    *output()
    }
    #write it to a text file
    set fpt [open demo.tpl w]
    puts $fpt $TplString
    close $fpt
    #call template processor
    *usercheck demo.tpl demo.out 0
     
    => so hm will loop through elems and calculate angle (very fast), tcl just calls template processor
     
     
  19. Pandurang liked a post in a topic by Imoto in body centred cubic creation   
    Hello @LFM1995
     
    If you still have the hexa elements, please try this.
     
    hm_entityrecorder elems on;
    *createmark elems 1 "by config" 208;
    foreach elemid [hm_getmark elems 1] {
     lassign [hm_entityinfo centroid elems $elemid] X Y Z;
     *createnode $X $Y $Z;
     set center [hm_latestentityid nodes];
     foreach nodeid [hm_getvalue elems id=$elemid dataname=nodes] {
      *createlist nodes 1 $center $nodeid;
      *createelement 2 1 1 1;
     }
    }
    hm_entityrecorder elems off;
    set newplot [hm_entityrecorder elems ids];
    if {[llength $newplot] != "0"} {
     hm_createmark elems 1 $newplot;
     *configedit 1 "bar2";
    }
    hm_markclearall 1;
     
    Download --->>> CreateBeamForCentroidHexElements.tcl
  20. Pandurang liked a post in a topic by tinh in Retrieve entities based on Solver Keyword   
    First createmark by card image,
    Then filter them by option
    Example
    *createmark sets 1 "by card image name" Part
    *createmark sets 2 "equal to value" \$LSD_TitleOpt 1
    *markintersection sets 1 sets 2
    puts [hm_getmark sets 1]
  21. Pandurang liked a post in a topic by tinh in Get all nodes on a outer circumference   
    Yes i think so. Uniform mesh is a special case, and we need 3 initial nodes
     
    Try reducing to 2: 2 init nodes form a vector, looking for an adjacent node that closest to the vector, repeat one by one will help in case of non-uniform
     
    And try reducing to 1: from 1 node find adjacents and looking for a theesome that form a minimum angle (feature angle along circumference is min, along cylinder axis is max)
     
     
     
  22. tinh liked a post in a topic by Pandurang in About *createmark   
    Open Hm--> Press F1 key--> under Help Tag You can find "Reference guide"
     

  23. Pandurang liked a post in a topic by tinh in line direction   
    Hi
    Use hm_getlinetangentatstartpoint
  24. Pandurang liked a post in a topic by tinh in Ho to install package in tcl   
    If files pkgindex.tcl are there, you need append package's folder path to ::auto_path
     
    and then load packages by
    package require WS::Client
     
     
    refer to my pkgindex.tcl and installer.tcl
    it helps install packages via $::env(HOME) without affection to hw installation.
    https://forum.altair.com/topic/16835-update-hypermesh-extensions/?tab=comments#comment-30266
     
  25. Pandurang liked a post in a topic by Imoto in How to get already created node or element set   
    Hi @Vikas Kumar
     
    Now I guess understood your point, it should be specify the poolname when get the Set handle.
    Like this -> modl$t GetSelectionSetHandle sels${t}_00${sid} "Set $sid";
     
    --- Correct example ---
    hwi OpenStack;
    set t [::post::GetT];
    hwi GetSessionHandle sess$t;
    sess$t GetProjectHandle proj$t;
    proj$t GetPageHandle page$t [proj$t GetActivePage];
    page$t GetWindowHandle wind$t [page$t GetActiveWindow];
    wind$t GetClientHandle clie$t;
    clie$t GetModelHandle modl$t [clie$t GetActiveModel];
    foreach sid [modl$t GetSelectionSetList "Set"] {
     modl$t GetSelectionSetHandle sels${t}_00${sid} "Set $sid";
     set name [sels${t}_00${sid} GetLabel];
     set list [sels${t}_00${sid} GetList];
     puts "Name = $name , IDs = $list";
    }
    hwi CloseStack;
     
    Thanks,
    Imoto
×
×
  • Create New...