Jump to content

vipin

Members
  • Content Count

    108
  • Joined

  • Last visited

  • Days Won

    8

Reputation Activity

  1. 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.
     
  2. MOHAMMED ABDULLA T liked a post in a topic by vipin in get all node ids at once   
    Hm_nodelist
  3. vipin liked a post in a topic by tinh in Matrix Browser   
    because surfaces do not have data name 'area', so you must calculate it.
    populate a column with data name 'surfaces'
    create a user data with type "procedure" and calculate area as:
     
    set col_data {} foreach surf_list [::MatrixBrowser::getColumn surfaces] {     set area 0     foreach surf_id $surf_list {set area [expr $area+[hm_getareaofsurface surfs $surf_id]]}     lappend col_data $area } return $col_data  
  4. vipin liked a post in a topic by MOHAMMED ABDULLA T in Filling the holes with mesh   
    *createmarkpanel nodes 1 "Select a node on the edge" 4
    set nodes_aroundhole [hm_getmark nodes 1]
    eval *createmark nodes 1 $nodes_aroundhole
    *createstringarray 4 "Remesh: 1" "AdjacentComp: 2" "CurvedFill: 1" "DefineMaxWidth:0"
    *fill_fe_holes 1 1 0 1 4
  5. Bachelor22 liked a post in a topic by vipin in Catching An Error   
    Hi,
    You don't need to write *plotnodelist again inside the else condition. Else will be executed when the initial code is successful.
  6. vipin liked a post in a topic by tinh in search a componet using loop   
    Hi
    Example csv file:
     
    CompId,Thickness
    1001,1.0
    1002,1.2
    2001,2.0
    2002,2.2
    2004,2.5
     
    This is a sample code
     
    set myfile c:/afile.csv
    set fpt [open $myfile]
    set cont [string map {, " " \n " "} [read $fpt]]
    close $fpt
    set MyCompId 2002
    set Thickness [dict get $cont $MyCompId]
  7. vipin liked a post in a topic by Imoto in search a componet using loop   
    @sanket_patil
     
    Tinh is already gave you the good example:-)
     
    -Here is my example-
    # Auto property creation #
    *evaltclscript "AutoPropertyCreate.tcl" 0;
    *evaltclstring "::autoproperty::Main" 0;
     
    # Thickness update from CSV #
    set ft {{"CSV Files" .csv} {"All Files" *}};
    set fn [tk_getOpenFile -filetypes $ft];
    set fh [open $fn r];
    while {![eof $fh]} {
     gets $fh line;
     lassign [split $line ,] cid T;
     if {[hm_entityinfo exist comps $cid -byid] == "1"} {
      set pid [hm_getvalue comps id=$cid dataname=propertyid];
      *setvalue props id=$pid PSHELL_T=$T;
     }
    }
    close $fh;
     
    If you are not using PSHELL card, you have to change the attribute name.
  8. Alex.01 liked a post in a topic by vipin in Select faces which contain elements   
    Hi, use markpanel instead.
     
    *createmarkpanel elems 1 "Please select the elements" 1
  9. tinh liked a post in a topic by vipin in Catching An Error   
    Hi,
    You don't need to write *plotnodelist again inside the else condition. Else will be executed when the initial code is successful.
  10. vipin liked a post in a topic by tinh in Add button script   
    Refer
    https://forum.altair.com/topic/22559-creating-user-toolbars-in-hypermesh/?tab=comments#comment-69319
     
  11. vipin liked a post in a topic by llyle in Add button script   
    Hi Alexander,
     
    Check out the below thread:
     
    https://forum.altair.com/topic/21519-how-to-create-widgets-like-label-frame-in-hm-framework-tab/
  12. vipin liked a post in a topic by tinh in Closing a program   
    Hi
    "exit" is to close hypermesh.
    Use "return" instead, to cancel a script
  13. vipin liked a post in a topic by tinh in Provide right click option to hwtk component table cell   
    From HM14, a menu is attached to table cell as default, but to show it, use option -cellmenucommand
    You have to provide a tcl proc (not menu name)
    Purpose of that proc is to customize the cell menu (already created as default, you don't need to create it)
    That proc accepts %M as argument to refer cell menu name, then you can use it to add or remove menu commands suitable with each cell type
     
    Example
    hwtk::table .myTable -cellmenucommand {p_PrepareMenu %M %C}
    .myTable columncreate name -text name
    .myTable columncreate id -text id
    .myTable rowinsert end row1 -values {name comp1 id 1001}
    .myTable rowinsert end row2 -values {name comp2 id 3000}
     
    proc p_PrepareMenu {mnu column} {
       $mnu delete 0 end
       switch -- $column {
             name {
                  $mnu add command -label Rename
             }
             id {
                  $mnu add command -label Renumber
             }
        }
    }
     
     
     
     
     
     
    As I see, when creating hwtk table, option -menu will attach a menu with event "right click" on header of column 0
     
     
    When creating a column, option -headermenu will attach a menu with event "right click" on header of that column.
     
     
     
     
  14. vipin liked a post in a topic by tinh in API for screen normal/parallel   
    Hi
    Use hm_winfo viewmatrix
    3 in 12 values are x y z of screen vector
    From version 13 there is another command returns 3 values but i don't remember 
  15. llyle liked a post in a topic by vipin in How to query precise jacobian for any element?   
    Hi,
    You can use datanames.
    hm_gevalue elems id=1122 dataname=jacobian
  16. Bachelor22 liked a post in a topic by vipin in Getting Access To Aspect Ratio Values   
    @Bachelor22,
    use hm_getelemcheckbounds
     
  17. vipin liked a post in a topic by Jeffersondhv in Input Mask to choose Elements or Nodes   
    Ok, so basically you want an user input to decide which type of selection must be used.
    This can be done in a variety of ways, using simpler forms or the more elegant ones with graphic interface.
     
    Using a simple yes or no question, this would be like so:
    set answer [tk_messageBox -message "What type of load would you like to input? \n Yes: Force \n No: Pressure" -type yesno -icon question] switch -- $answer { yes { "Code for Force load" } no { "Code for Pressure load" } } If you want to have something nicer (which requires more work), you can use for example a radiobutton.
    But in this case you need to build the hole interface for the user navigation like confirmation and return buttons and maybe even other options.
    A code snippet to use a radiobutton would be like so:
     
    #Get preview frame set w [hwtk::demo::getpreviewframe] set w [hwtk::frame $w.frame] pack $w -anchor nw -padx 4 set ::feedback "" set ::currentLoad "Force" pack [hwtk::labelframe $w.lf -text "Select the type of Loading" -padding 2] -anchor nw foreach load {Force Pressure} { pack [hwtk::radiobutton $w.lf.b$load -text $load -variable ::currentLoad \ -value $load \ -command "set ::feedback $load" \ -help "$load"] -side top -pady 2 -fill x } pack [hwtk::label $w.label -text "Active Load:"] \ [hwtk::label $w.label1 -textvariable ::feedback] -side left -pady 4 Hopefully this is helpful.
  18. vipin liked a post in a topic by qqtomcat in How to find pairs of opposite surfaces to a specified surface   
    2.Yes.I wrote some script to retrieve thickness from midsurface. But sometimes surfaces created by midsurface command may have Inaccurate thickness values or these surfaces have distortions.
    So I may create midsurface manually and get surface thickness by some scripts.
    Thanks for your patient,you helped me a lot.
  19. tinh liked a post in a topic by vipin in How to find pairs of opposite surfaces to a specified surface   
    Hi,
     
    If you have surface normal vector and centroid, try intersect option in F8 panel. Then find nearest surfaces for newly created nodes.

  20. vipin liked a post in a topic by tinh in How to fix(store) 2D grid before suppress lines?   
    It'
    It's because mesh is associated to the surf. To break association, translate the mesh a bit, then it will not be overwritten
  21. vipin liked a post in a topic by llyle in How to create component/properties using TCL script?   
    Hi, 
     
    You can use a logic similar to below:
    set str_compname "thickness_t2.1" set thickness [string trimleft [lindex [split $str_compname _] end] t] set str_prop [hm_getvalue comps name=$str_compname dataname=property.name] *setvalue prop name=$str_prop 95=$thickness; #95 is thickness dataname in Nastran user profile  
  22. Sudhanva Rao liked a post in a topic by vipin in API to find surfaces through which a line passes   
    Hi
    Can you try with the intersect option in F8 panel?
    Select line and all surfaces from bolt component. You will get 2 nodes at both ends.
    Then measure distance between these nodes.
  23. vipin liked a post in a topic by tinh in API to find surfaces through which a line passes   
    I also use that way to classify bolt/nut 
  24. tinh liked a post in a topic by vipin in API to find surfaces through which a line passes   
    Hi
    Can you try with the intersect option in F8 panel?
    Select line and all surfaces from bolt component. You will get 2 nodes at both ends.
    Then measure distance between these nodes.
  25. vipin liked a post in a topic by llyle in Hyperview - Get list of components and ids   
    Hi,
    It's fairly direct. 
    hwi OpenStack hwi GetSessionHandle session1 session1 GetProjectHandle project1 project1 GetPageHandle page1 1 page1 GetWindowHandle win1 1 win1 GetClientHandle anim anim GetModelHandle my_model [anim GetActiveModel] my_model GetQueryCtrlHandle my_query set set_id [my_model AddSelectionSet component] my_model GetSelectionSetHandle comp_set $set_id # Select all Components comp_set Add "All" my_query SetSelectionSet $set_id # ask for ids and component name my_query SetQuery "component.id component.name" my_query WriteData D:/out.csv # clean up my_model RemoveSelectionSet $set_id hwi CloseStack  
×
×
  • Create New...