Jump to content

Jeffersondhv

Members
  • Content Count

    47
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by Jeffersondhv


  1. Hello all,

     

    I'm trying to create a user interface on HM where the user can input a file and some other options to run a code.

    To retrieve the file path I'm using the command hwtk::openfileentry, using a -textvariable option to retrieve the input.

    However when I try to use the variable saved from the input it's not changing at all.

    The fix should be simple, but I'm not being able to make this work.

     

    Here follows the code I'm using:

     

    
    if { [winfo exist .geom_checker] } {
    	destroy .geom_checker;
    }
    
    set textVar "Nothing"
    
    set f .geom_checker
    frame $f
    
    set w [hwtk::frame $f.w]
    pack $w -anchor nw
    
    set top [frame $f.top];
    pack $top -side top -fill x -expand 0;
    set bottom [frame $f.bottom];
    pack $bottom -side bottom -fill x -expand 0;
    
    # Return button
    button $bottom.button -text "return" -command hm_exitpanel -bg #C06060;
    pack $bottom.button -side right -anchor e -ipadx 6 -ipady 4
    
    # ------- REFERENCE FILE
    # Label frame for Reference File
    set lbl_ref [hwtk::labelframe $w.title_ref -text "Reference STP File"]
    grid $lbl_ref -column 0 -row 0 -ipadx 6 -ipady 6
    # pack $lbl_ref -side left -anchor nw -pady 4
    
    set txt_file "Open file"
    hwtk::label $lbl_ref.l -text $txt_file
    hwtk::openfileentry $lbl_ref.e -textvariable textVar
    grid $lbl_ref.l -column 0 -row 0 -sticky w -pady 2 -padx 5
    grid $lbl_ref.e -column 1 -row 0 -sticky w -pady 2 -padx 5
    #grid configure $lbl_ref.e -sticky ew
    
    
    set cmd_btn "tk_messageBox -message $textVar -type ok"
    button $lbl_ref.import_ref -text $textVar -command $cmd_btn -bg #60C060
    grid $lbl_ref.import_ref -column 2 -row 0 -sticky e -pady 2 -padx 5
    
    button $bottom.run -text "Proceed" -command hm_exitpanel -bg #60C060;
    #grid $top.run -column 10 -row 0 -sticky e
    pack $bottom.run -side right -anchor ne -ipadx 6 -ipady 4
    
    hm_framework addpanel $f "Model Info";
    hm_framework drawpanel $f;

    Thanks in advance,

    Jefferson Vieira


  2. Hello brahmadev,

     

    It's been a while since I've worked with beam sections or the NASTRAN profile, but I would suggest to you looking into the matrix browser.

    Within the matrix browser you can see the information there is regarding all the properties the elements were assigned.

    From the datanames you can then identify the path for the intended information within the database.

     

    Hope this helps.

    Best regards


  3. The big difference here stands on the specific functions HM uses, which are in a sense independent on the TCL language as it works as an additional package for the language.

    If you know the basics of programming and the syntax for TCL, I would suggest that you explore as much as you can the command.tcl file written by HM.

    This file is really useful as it records any action you do in the GUI into to a code format. Then looking at it, you can change the necessary arguments and others.

    To learn more about the available functions you can use with HM, please consult the "Scripts > Commands and Functions" part of the HM help. There you can understand the inputs for the HM functions and other capabilities you might be looking for.

     

    Hope this helps.

    Jefferson Vieira

    Saravanan R and tinh like this

  4. Unfortunately I cannot post the script here.

    But basically it loops over every component to extract some mesh quality attributes.

    Functions like the following are used:

     

    *elementtestinterangle

    *elementtestlength

    hm_getthickness

    hm_getmass

     

    I say that it seems like HM is saving in memory more info than requested because the RAM runs out really quickly, but considering the output I'm requesting/getting, it's only creating a file with few KBs. And as the same variables are using during the loop, they should be getting overwritten, which would prevent running out of RAM. So my guess is that at each loop, each operation, HM is saving in RAM all the info related to that component, even info not requested, and as it loops through the components, the memory just keeps building up.

     

    I hope it helps clarify the situation.

    Thank you


  5. Hello all,

     

    I'm running a script in a very large assembly, where this script loops through every component retrieving a number of information for each of them.

    The information I need is not that heavy, but it seems like HM saves in its memory much more data than what I'm requesting for each component.

    Then it ends up crashing due to the lack of memory.

     

    Is there any way to clear HM memory while a script is running?

     

    Thank you


  6. Hello guys,

     

    I have some points in my model that will be used to create connectors. In order to handle them in a proper manner, I need to transform them into nodes and them get the node IDs to create a node set.

     

    To create the nodes from the points I'm using this function: *nodecreateatpointmark 1

    However this is one of the undocumented functions, thus I don't know if it has other options to use, because using as I showed does not return me the node IDs.

    I also tried to use hm_latestentityid but this one gives me only one node at a time and has a limitation to retrieve only the last 99 nodes and I might need more than that in most of the cases.

     

    Does anybody know a solution for this?

     

    Thanks in advance,

    Jefferson Vieira


  7. I've been playing around with this collector, but I still didn't get to do what I intend. Right now when I use HmMarkTool or HmEntSelCol I can only select the entities one by one, e.g. I cannot create a bounding box in the UI to select the entities inside the box. How can this be achieved?

     

    I also found this UI manager called Process Studio and I've been trying to make something work from that.

    If I add a collector from that and export a TCL code, I can see the script created to generate that collector, however I'm not being able to run it properly.

    So I have the following process on the script:

    ::hw::pmgr::${::hw::pmgr::namespace}::DisplayWnd

    ::hw::pmgr::${::hw::pmgr::namespace}::Exec

    ::hw::pmgr::${::hw::pmgr::namespace}::SetDataInDataModel

    ::hw::pmgr::${::hw::pmgr::namespace}::GetDataFromDataModel

    ::hw::pmgr::${::hw::pmgr::namespace}::OnDataModelChanged

     

    From that, what do I need to define in order to get this working?

    Also, what do I need to define in terms of "hw::pmgr::namespace"?

     

    Thank you


  8. 24 minutes ago, Bachelor22 said:

    Is there a way to get access to the fail values of the different quality criterias set in hypermesh?

     

    Kind regards,

    Simon

     

    Yes, check the help linked with the functions mentioned to see the options you have:

     

    On 1/8/2019 at 8:04 AM, Jeffersondhv said:

    There is a variety of functions you can use to achieve this:

     

    *elementtestaspect Help

    hm_createmark elems 1 "greater than value" "aspect 3" Help

    hm_getelemcheckbounds Help

     

    I hope this can help you achieve what you intend.

     

×
×
  • Create New...