Challenge

Week - 12 - Creating the locator, writing and reading the node data

AIM: To create the locator, writing and reading the node data using Tcl/Tk commands

OBJECTIVE:

  1. Connector :

Create a macro that builds a GUI containing 4 buttons. Component creator, weld, xloc, yloc, zloc. Upon pressing the buttons corresponding 1D element must be created and moved to the desired collector.

  1. Reading nodes from a file :

Create a macro that asks a .csv file as input and reads nodes from the file provided and also creates tags for text in the first column.

  1. Identical comp identifier

Create a macro that accepts a geometric component as input from the user and shows potential duplicate geometries ( Geometries that match the surface count)

PROCEDURE:

To create a GUI for weld structures with different DOF and assigned to different buttons

Connectors are 1D elements that made a connection between components in hypermesh model. Various connectors are available in Hypermesh which can be used for various applications. In this command, Weld and locator connectors are created between nodes.

  • Initially, the component created on entity editor for weld and locators.
  • Components assigned with different colors and names.
  • Procedures are created for weld and locator.
  • For weld, nodes are gotten as an input from the user by the command “*createmarkpanel”.
  • Using the command “*rigidlinkinodecalandcreate” weld connections are made.
  • An “if” condition was used to determine which axis the locator should be made.
  • For each axis, different DOF will be selected in if condition.
  • Node for source and target get as input from panel command.
  • For locators, “*rigid” was used to create locators.

CODE:


*clearmarkall 1 ; *clearmarkall 2
set a .connectors
catch [destroy $a]
toplevel $a
wm title $a "CONNECTORS"
wm geometry $a 200x210+100+300;
wm resizable $a 0 0
wm deiconify $a
#buttons
button $a.01 -text "Collectors" -command collectors ; place $a.01 -x 10 -y 10 -width 180 -height 30
button $a.02 -text "X locator" -command X_loc ; place $a.02 -x 10 -y 50 -width 180 -height 30
button $a.03 -text "Y locator" -command Y_loc ; place $a.03 -x 10 -y 90 -width 180 -height 30
button $a.04 -text "Z locator" -command Z_loc ; place $a.04 -x 10 -y 130 -width 180 -height 30
button $a.05 -text "Weld" -command Weld ; place $a.05 -x 10 -y 170 -width 180 -height 30

proc collectors {} {
*createmark components 1 "Weld" ;if {[hm_marklength comp 1] == 0} {*createentity components name = Weld}
*createmark components 1 "X_loc" ;if {[hm_marklength comp 1] == 0} {*createentity components name = X_loc}
*createmark components 1 "Y_loc" ;if {[hm_marklength comp 1] == 0} {*createentity components name = Y_loc}
*createmark components 1 "Z_loc" ;if {[hm_marklength comp 1] == 0} {*createentity components name = Z_loc}
}

proc Weld {} {
*clearmarkall 1
*clearmarkall 2
*currentcollector comp "Weld"
*createmarkpanel nodes 1 "select the nodes for spider web rep"
*rigidlinkinodecalandcreate 1 0 0 123456
}

proc X_loc {} {
*clearmarkall 1
*clearmarkall 2
*currentcollector comp "X_loc"
*createmarkpanel nodes 1 "select the primary node "
set prim_node [hm_getmark node 1]
*createmarkpanel nodes 1 "select the target node "
set targ_node [hm_getmark node 1]
*rigid $prim_node $targ_node 156
}

proc Y_loc {} {
*clearmarkall 1
*clearmarkall 2
*currentcollector comp "Y_loc"
*createmarkpanel nodes 1 "select the primary node "
set prim_node [hm_getmark node 1]
*createmarkpanel nodes 1 "select the target node "
set targ_node [hm_getmark node 1]
*rigid $prim_node $targ_node 246
}

proc Z_loc {} {
*clearmarkall 1
*clearmarkall 2
*currentcollector comp "Z_loc"
*createmarkpanel nodes 1 "select the primary node "
set prim_node [hm_getmark node 1]
*createmarkpanel nodes 1 "select the target node "
set targ_node [hm_getmark node 1]
*rigid $prim_node $targ_node 345
}

OUTPUT:

RESULT:

Created a macro that builds a GUI containing 4 buttons. Component creator, weld, xloc, yloc, zloc

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.