Project

Finding the Component Name for Deleted Element by Tcl/Tk Code

Finding the component name for deleted element :

Aim :

  • To find the component name for the deleted element.

Procedure :

  • Open any model in the hypermesh and write a code to find the component name for the deleted element.
  • Here I have opened the hood model in hypermesh, Which is shown in below Figure 1.

Figure 1-Hood Model Opened in HyperMesh.
  • Now isolate the hinge component and drag the command window from below, Which is shown in below Figure 2.

Figure 2-Drag the command window above to write a tcl/tk code.
  • Now write a code *createmarkpanel elements 1 -Which allows us to interactively select entities from a command file.Which is shown in below Figure 3.

Figure 3-*Createmarkpanel Command.
  • Select the elements to store it in a variable and hit on proceed, Which is shown in below Figure 4.

Figure 4-Elements Selected to Store in a variable A.
  • set a [hm_getvalue elements mark=1 dataname=component.name]-Queries data names, attributes, and metadata on entities. It will return the value of any type of data name, attribute, or metadata of an entity. In addition, this command will also return the value at a specific index for array type of data names, attributes, and metadata.
  • Write a code set a [hm_getvalue elements mark=1 dataname=component.name].Which will store the selected elements in varaiable a and return the component name of the selected elements.

Figure 5-Stored the selected elements in variable a and returned the component name of selected elements.
  • Now write a command *deletemark elements 1-Which will delete the selected elements, Which is shown in below Figure 6.

Figure 6-Written a code to delete selected elements.
  • Now write a code puts $a-to print the deleted elements component name,Which is shown in below Figure 7.

Figure 7-Written a code to print the deleted elements component name.

Figure 8-Printed Deleted Elements Component Name [Middle Surface_hinge].

[*createmarkpanel elements 1
set a [hm_getvalue elements mark=1 dataname=component.name]
*deletemark elements 1
puts $a]

Code to Find the Deleted Elements Component Name👆

Figure 9-Running tcl/tk File.

Result :

  • Hence the tcl/tk code was written to find the deleted elements component name.
Your portfolio, next

Ship work like this
in your own course.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.

Talk to a career counsellor

Free 20-minute call. We'll map the right course to where you want to work.

By submitting you agree to our Terms and Privacy Policy.