Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Jeffersondhv

  1. 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.
  2. Not sure if I understand you end goal. So you have a list of elements/nodes in a file and then you want to mask these entities?
  3. Thanks for you answer tinh. However I'm not clear how this should be handled to use in one of my codes. Should I use exec to call the file or something else?
  4. Ok, I just replaced "My Panel" on the drawpanel line to $w and it worked fine. Now I'm trying to have in my GUI something like showed below to select entities: How can this be achieved? Thank you
  5. Hi tihn, With this addition I keep getting the following error: My Panel does not exist. while executing "error "$frame does not exist."" ("drawpanel" arm line 11) I'm sorry for so newbie question, but I'm struggling a little to work with GUI.
  6. Ok, got it. I'll shall use 100.0 instead of 100 then. Thanks tinh
  7. I'm trying to output the progress of my script in the user message field, but it gets stuck on 0% till the end of the run even tough I'm using update. Here follows the code I'm using: proc statusMsg { current total } { ## Displays progress pecentage set percnt [ expr $current/$total*100 ] set str "%" hm_usermessage "In progress ($percnt$str)" update } I even tried using hm_blockmessages 1 before and hm_blockmessages 0 after the code execution, but it didn't work. How can I fix this? Thank you.
  8. I didn't know about this option. Thanks for letting me know about it. However as I could customize the script as desired, it suits my needs better. But it's good to know about it. Thank you tinh
  9. Hello all, I'm trying to write a code to compare the geometries of two different files. I'm able to put both files together, where the reference has its components with a modified name like COMPNAME_REF (added "_REF" to the name). This way I'm able to match the names of the components, which should be the same leaving apart the modification applied in the name. From there my intention was to compare the matched geometries' position, orientation and volume/surface area to check for alterations. To do so, I'm using the following functions: hm_getcentroid, hm_getvolumeofsolids However, some components present errors when trying to get their centroid or volume, giving me messages like: hm_getcentroid: bad geometry found. hm_getvolumeofsolid: calculation failure. But the solids do not have any visible mistake. What could be causing this? Thanks, Jefferson
  10. Thank you. But actually this is more like a floating box, a pop-up. Is there any way to build it in the HM interface just like the picture I showed before? With a pop-up it would work the same way, but I just wanted to know if that is possible so it would be easier for the user. Thanks, Jefferson
  11. Would you have any example or sample code where this type of GUI is implemented? It would be a good start for me. Thank you, Jefferson
  12. Is there a command that can be used to run these quality checks and get the output directly from the code? Thanks, Jefferson
  13. What I want is to have all the options and settings for the function being called to be selected and viewed all at once as any other HyperMesh function. For example, the Automesh function displays this dashboard when selected: For now what I have is based basically on yes or no questions using the tk_messageBox function and some functions like hm_getfloat and createmarkpanel to get user input. But I would like to have something more visual and easy for the user to navigate through the options and different selections the function can offer. Can that be done? Or how could this workflow be improved? Thanks, Jefferson
  14. Hello all, When I need to have user interaction with a script I'm working on, usually I use Tk to create the user interface, I was wondering if there's a way to generate a GUI similar to what we see for common HM functions, where all the steps and required information are displayed at the same time. How can that be achieved? Thanks, Jefferson
  15. Thank you, that's very helpful. It seems like the max surf does the job better, but I've found some cases where it does not work well. I'll run further tests and comment later.
  16. Got it. So do you know a way to compute the principal moments of inertia for the solids using TCL? I found that to compute eigenvalues and eigenvectors I would need to add a TCL extension, but I really don't want to use that as it would add an additional step to be able to share this code with my colleagues. I see that using the approaches you suggested it works for a lot of cases, but I would like to use the inertia as it would provide me a more general solution. Thanks
  17. Thanks a lot. That is very helpful. I haven't thought about this approach. As I would like to have this code more general, what could be done if the max surface is regular? Thank you
  18. When I create properties often I have some problems with the IDs. (on LS-Dyna profile) I get ID conflict even though the ID is unique in the model. What can I do to fix this? Thanks, Jefferson Vieira
  19. Thanks for the answer tinh. I have actually already tried using *positionmark in one of my code versions, but I still get some cases where the elements end up somewhat flipped. I guess I might need to properly order the inertia tensor to get the correct orientation. Right now I'm using an auxiliary Python code to compute the principal moments of inertia for the solids. Is there a way to do this using Hypermesh's or TCL's functions? Thanks, Jefferson Vieira
  20. Hello all, I'm working on a script to duplicate elements from a reference component containing a solid to a new component with the same exact solid, but in another position and orientation. The translation part was easy as the hm_getcentroid function provides the solid centroid position, so I can use the command *translatemark to translate the desired mesh to the correct position. But to match the orientation, it has been a task more difficult that I was expecting. My approach has been to extract the moment of inertia of the reference solid and the target solid using hm_getmoiofsolid. Once I get these values, I compute the principal moment of inertia for each solid, so I have a comparable reference to use. Then I calculate the Euler parameters (or Quaternions) to obtain the rotation angles that I can use to rotate the elements from the reference solid to match the target solid orientation. The problem I'm facing is that it seems that the inertia calculation performed by hm_getmoiofsolid seems not to be consistent, in a sense that even extracting the principal moments of inertia from them, these principal directions do not coincide with the solid orientation. What could be done in this case? Thanks in advance, Jefferson Vieira
  • Create New...