Jump to content

kiran putta123

Members
  • Content Count

    11
  • Joined

  • Last visited

  1. hi all, i got an error while iam running the tcl/tk script. i got an error "package require tcom" not found.can you please help me out in this issue.](*,)
  2. hi guys, is there any way to find out the Model tour enhance ment for assemblies.can you please help me out in this procedure.please do some need ful modifications or suggest me how to improve this code.for assemblies. ################################################################################ # HWVERSION_9.0b121_Apr 17 2008_12:11:24 # Copyright © 2002-2004 Altair Engineering Inc. All Rights # Reserved. Contains trade secrets of Altair Engineering, Inc. # Copyright notice does not imply publication. Decompilation or # disassembly of this software is strictly prohibited. ################################################################################ ################################################################################ # # Description:This is a GM-TCS internal version of the model tour functionality. # In this we have added the "Find Normals" functionality to the older version of # the model tour which had "Standard View","Find Edges" and "Fine Attached " # functionalities and also this shows the quality index values of the elements. # ################################################################################ ################################################################################ # # GMPT Version Developers : Sachin,Ravikishore. on 02Jan2012, GM-TCS Internal # ################################################################################ ################################################################################ namespace eval ::mdltr:: { # Keep list of components which names are same as of existing # titles and correspond those names to new titles; variable g_comp_exceptions; variable g_basic_reviewlist; array set p_modelTour { ActiveEdges 0 ActiveFeatures 0 NoPlatesInComp 0 ActiveNormals 0 } set p_CurrCompId INVALID; } ;#namespace eval ::mdltr:: ################################################################################ proc ::mdltr::IsSourced { args } { if { [ info procs ::mdltr::Main ] != "" } { return true; } return false; }; ################################################################################ if { [ ::mdltr::IsSourced ] } { # Launch the modeltour and return ::mdltr::Main; return; }; ################################################################################ proc ::mdltr::Main { args } { variable g_comp_exceptions; variable g_basic_reviewlist; variable p_modelTour; if { [ info exists g_comp_exceptions ] } { unset g_comp_exceptions; variable g_comp_exceptions; } global mdltr_basic_complist global mdltr_basic_reviewindex global mdla global mdltr_basic_reviewindex; if { [winfo exists .form_nextback] } { set p_CurrCompId [lindex $mdltr_basic_complist $mdltr_basic_reviewindex] tk_messageBox -message $p_CurrCompId *createmark titles 1 $g_basic_reviewlist($p_CurrCompId) *deletemark titles 1 destroy $mdla UnsetAll } set mdltr_basic_reviewindex "0" set p_modelTour(ActiveEdges) 0; set p_modelTour(ActiveFeatures) 0; set p_modelTour(NoPlatesInComp) 0; set p_modelTour(ActiveNormals) 0; PrepareTitleNames; *displaycollectorwithfilter titles "none" "" 1 0 *createmarkpanel assemblies 1 "please select the assemblies for reference" set mdltr_basic_complist [ hm_getmark assemblies 1 ]; set mdltr_basic_check [ llength $mdltr_basic_complist ]; ::mdltr::SetReviewList $mdltr_basic_check; if { $mdltr_basic_check != "0" } { BasicReviewGui; #::mdltr::BasicReviewGui $mdltr_basic_check; } *plot } ;#proc ::mdltr::Main { args } ################################################################################ proc ::mdltr::SetReviewList { mdltr_basic_check } { variable g_basic_reviewlist; global mdltr_basic_complist; if { [ info exists g_basic_reviewlist ] } { unset g_basic_reviewlist; variable g_basic_reviewlist; } if { $mdltr_basic_check != "0" } { *displaycollectorwithfilter assemblies "none" "" 0 1 foreach id $mdltr_basic_complist { set g_basic_reviewlist($id) [ GetComponentName $id ] } } } ################################################################################ proc ::mdltr::FindNormals { args } { variable g_basic_reviewlist; variable p_modelTour; global mdltr_basic_complist global mdltr_basic_reviewindex set p_CurrCompId [ lindex $mdltr_basic_complist $mdltr_basic_reviewindex ]; tk_messageBox -message $mdltr_basic_reviewindex #################################################### # This logic is to control the display state. It helps to # avoid edge elements and other artifacts in the model after # the tool is closed and such. #################################################### BasicClearViewAll $g_basic_reviewlist($p_CurrCompId) set p_modelTour(ActiveNormals) 1; set p_modelTour(ActiveEdges) 0; set p_modelTour(ActiveFeatures) 0; # End of Display Logic *clearmark assemblies 1 *createmark assemblies 1 "by name only" [ GetComponentName $p_CurrCompId ] if { ! $p_modelTour(NoPlatesInComp) } { *normalsdisplay assemblies 1 0 #*displaycollectorwithfilter components "off" [ GetComponentName $p_CurrCompId ] 1 0; #*displaycollectorwithfilter groups "none" "" 1 0; *window 0 0 0 0 0; #return; } else { *findmark assemblies 1 1 0 elements 0 2 *window 0 0 0 0 0 } } ;#proc ::mdltr::FindNormals { args } ################################################################################ proc ::mdltr::FindFreeEdges { args } { variable g_basic_reviewlist; variable p_modelTour; global mdltr_basic_complist global mdltr_basic_reviewindex set p_CurrCompId [ lindex $mdltr_basic_complist $mdltr_basic_reviewindex ] #################################################### # This logic is to control the display state. It helps to # avoid edge elements and other artifacts in the model after # the tool is closed. #################################################### BasicClearViewAll $g_basic_reviewlist($p_CurrCompId) set p_modelTour(ActiveEdges) 1; set p_modelTour(ActiveFeatures) 0; *displaycollectorwithfilter assemblies "none" "" 1 0; *displaycollectorwithfilter groups "none" "" 1 0; if { $p_modelTour(NoPlatesInComp) } { *window 0 0 0 0 0; return; } *createmark assemblies 2 "by name only" [ GetComponentName $p_CurrCompId ]; # The function to actually show edge elements on the component takes some time # and can cause a problem where the edges are displayed off with the rest *createmark components 2 "all" "by assems" *findedges components 2 0 # Show edges if they are found if { [ IsComponentExist "^edges" ] } { *displaycollectorwithfilter components "on" "^edges" 1 0; } *window 0 0 0 0 0; } ;#proc ::mdltr::FindEdges { args } ################################################################################ proc ::mdltr::FindT-Edges { args } { variable g_basic_reviewlist; variable p_modelTour; global mdltr_basic_complist global mdltr_basic_reviewindex set p_CurrCompId [ lindex $mdltr_basic_complist $mdltr_basic_reviewindex ] #################################################### # This logic is to control the display state. It helps to # avoid edge elements and other artifacts in the model after # the tool is closed. #################################################### BasicClearViewAll $g_basic_reviewlist($p_CurrCompId) set p_modelTour(ActiveEdges) 1; set p_modelTour(ActiveFeatures) 0; *displaycollectorwithfilter assemblies "none" "" 1 0; *displaycollectorwithfilter groups "none" "" 1 0; if { $p_modelTour(NoPlatesInComp) } { *window 0 0 0 0 0; return; } *createmark assemblies 1 "by name only" [ GetComponentName $p_CurrCompId ]; # The function to actually show edge elements on the component takes some time # and can cause a problem where the edges are displayed off with the rest *createmark components 1 "all" "by assems" *findedges components 1 1 # Show edges if they are found if { [ IsComponentExist "^edges" ] } { *displaycollectorwithfilter components "on" "^edges" 1 0; } *window 0 0 0 0 0; } ;#proc ::mdltr::FindEdges { args } ################################################################################ proc ::mdltr::FindAttached { args } { # Displays elements attached to the current component variable g_basic_reviewlist; variable p_modelTour; global mdltr_basic_complist global mdltr_basic_reviewindex set p_CurrCompId [ lindex $mdltr_basic_complist $mdltr_basic_reviewindex ]; #################################################### # This logic is to control the display state. It helps to # avoid edge elements and other artifacts in the model after # the tool is closed and such. #################################################### BasicClearViewAll $g_basic_reviewlist($p_CurrCompId) set p_modelTour(ActiveEdges) 0; set p_modelTour(ActiveFeatures) 1; set p_modelTour(ActiveNormals) 0; # End of Display Logic *clearmark assemblies 1 *clearmark assemblies 2 *createmark assemblies 2 "by name only" [ GetComponentName $p_CurrCompId ] if { ! $p_modelTour(NoPlatesInComp) } { *createmark components 2 "all" *findedges components 2 0; *createmark assemblies 2 "by name only" [ GetComponentName $p_CurrCompId ]; *findmark assemblies 2 1 0 elements 0 2 *displaycollectorwithfilter assemblies "off" [ GetComponentName $p_CurrCompId ] 1 0; *displaycollectorwithfilter groups "none" "" 1 0 *window 0 0 0 0 0 } else { *findmark assemblies 2 1 0 elements 0 2 *window 0 0 0 0 0 } } ;#proc ::mdltr::FindAttached { args } ################################################################################ proc ::mdltr::StandardView { args } { # Displays elements in the current component variable g_basic_reviewlist; variable p_modelTour; global mdltr_basic_complist global mdltr_basic_reviewindex set p_CurrCompId [ lindex $mdltr_basic_complist $mdltr_basic_reviewindex ] # Display Everything Off *displaycollectorwithfilter loadcols "none" "" 1 0 *displaycollectorwithfilter systcols "none" "" 1 0 *displaycollectorwithfilter groups "none" "" 1 0 *displaycollectorwithfilter plots "none" "" 1 0 *displaycollectorwithfilter blocks "none" "" 1 0 *displaycollectorwithfilter vectorcols "none" "" 1 0 *displaycollectorwithfilter tag "none" "" 1 0 *displaycollectorwithfilter contactsurfs "none" "" 1 0 DisplayWithFilter multibodies "none" "" 1 0 *plot #################################################### # This logic is to control the display state. It helps to # avoid edge elements and other artifacts in the model #################################################### BasicClearViewAll $g_basic_reviewlist($p_CurrCompId) set p_modelTour(ActiveEdges) 0; set p_modelTour(ActiveFeatures) 0; set p_modelTour(ActiveNormals) 0; *displaycollectorwithfilter assemblies "none" "" 1 0 *displaycollectorwithfilter assemblies "on" [GetComponentName $p_CurrCompId] 1 0 *window 0 0 0 0 0 } ;#proc ::mdltr::StandardView { args } ################################################################################ proc ::mdltr::BasicReview { mdltr_basic_incrementindex } { global mdltr_warpage mdltr_aspect mdltr_skew mdltr_length mdltr_jacobian mdltr_minanglequad mdltr_maxanglequad mdltr_minangletria mdltr_maxangletria mdltr_taper mdltr_chordal \ W_Fail AR_Fail SA_Fail ML_Fail J_Fail MinQ_Fail MaxQ_Fail MinT_Fail MaxT_Fail T_Fail CD_Fail \ W_N_Fail AR_N_Fail SA_N_Fail ML_N_Fail J_N_Fail MinQ_N_Fail MaxQ_N_Fail MinT_N_Fail MaxT_N_Fail T_N_Fail CD_N_Fail \ Duplicate_Elems TQRatio Total_Tria_Quad_Number Total_Tria_Number Total_Quad_Number variable g_basic_reviewlist; variable p_modelTour; global mdltr_basic_complist; global mdltr_basic_reviewindex; #################################################### # mdltr_basic_incrementindex is set according to the need: # 0 means that the current value of the array index is used. # 1 means that the next index value is used # -1 means that the previous index value is used. #################################################### incr mdltr_basic_reviewindex $mdltr_basic_incrementindex # Logic to control rollover at list end occurs here set mdltr_basic_reviewindexMAX [llength $mdltr_basic_complist] if {$mdltr_basic_reviewindex < "0"} { set mdltr_basic_reviewindex [expr $mdltr_basic_reviewindexMAX - 1] } elseif {$mdltr_basic_reviewindex >= $mdltr_basic_reviewindexMAX} { set mdltr_basic_reviewindex "0" } else {} set p_CurrCompId [lindex $mdltr_basic_complist $mdltr_basic_reviewindex] BasicClearViewAll $g_basic_reviewlist($p_CurrCompId) set p_modelTour(ActiveNormals) 0; set p_modelTour(ActiveEdges) 0; set p_modelTour(ActiveFeatures) 0; #################################################### # Determine Critical Information about the comp: # 1) Number of Elements in Comp # 2) Min and Max ID of elements in Comp # 3) Property Referenced in Comp and Statistics according to Prop Type # 4) Material Referenced by Comp (ID and Name) #################################################### set p_CurrCompId [ lindex $mdltr_basic_complist $mdltr_basic_reviewindex ]; *createmark elements 1 "by assems" [ GetComponentName $p_CurrCompId ]; #tk_messageBox -message $p_CurrCompId set mdltr_minangletria [hm_get2delemchecktestval minangletria] set mdltr_maxangletria [hm_get2delemchecktestval maxangletria] set mdltr_skew [hm_get2delemchecktestval skew] set mdltr_basic_compelmlist [ hm_getmark elements 1 ]; set mdltr_basic_compnumelm [ llength $mdltr_basic_compelmlist ]; set p_modelTour(NoPlatesInComp) 0; if { ! [ hm_entityincollector Group [ GetComponentName $p_CurrCompId ] components 1 0 ] && \ ! [ hm_entityincollector Group [ GetComponentName $p_CurrCompId ] components 6 0 ] && \ ! [ hm_entityincollector Group [ GetComponentName $p_CurrCompId ] components 9 0 ] && \ ! [ hm_entityincollector Group [ GetComponentName $p_CurrCompId ] components 12 0 ] && \ ! [ hm_entityincollector Group [ GetComponentName $p_CurrCompId ] components 18 0 ] && \ ! [ hm_entityincollector Group [ GetComponentName $p_CurrCompId ] components 22 0 ] && \ ! [ hm_entityincollector Group [ GetComponentName $p_CurrCompId ] components 23 0 ] && \ ! [ hm_entityincollector Group [ GetComponentName $p_CurrCompId ] components 28 0 ] } { set p_modelTour(NoPlatesInComp) 1; } set mdltr_basic_elmlistsorted [lsort -integer $mdltr_basic_compelmlist] set mdltr_basic_elmMinId [lindex $mdltr_basic_elmlistsorted 0] set mdltr_basic_elmMaxId [lindex $mdltr_basic_elmlistsorted end] set mdltr_basic_titletext " Component Name(Id): $g_basic_reviewlist($p_CurrCompId)($p_CurrCompId) \n \ Number of Elements: $mdltr_basic_compnumelm elements.\n \ ID Range: $mdltr_basic_elmMinId to $mdltr_basic_elmMaxId." set mdltr_basic_titletext2 "" if {$mdltr_basic_compnumelm!=0} { Check set mdltr_basic_titletext2 "Check Type\n \ Skew:\n \ Min-angle Tria:\n \ Max-angle Tria:" set mdltr_basic_titletext3 "Initialised Value\n \ [expr floor($mdltr_skew*1000)/1000]\n \ [expr floor($mdltr_minangletria*1000)/1000]\n \ [expr floor($mdltr_maxangletria*1000)/1000]" set mdltr_basic_titletext4 "Failing Elements\n \ $SA_N_Fail\n \ $MinT_N_Fail\n \ $MaxT_N_Fail" } else { set mdltr_basic_titletext2 "Check Type\n \ Skew:\n \ Min-angle Tria:\n \ Max-angle Tria:" set mdltr_basic_titletext3 "Initialised Value\n \ [expr floor($mdltr_skew*1000)/1000]\n \ [expr floor($mdltr_minangletria*1000)/1000]\n \ [expr floor($mdltr_maxangletria*1000)/1000]" set mdltr_basic_titletext4 "Failing Elements\n \ NA\n \ NA\n \ NA" } # Getting valid title name set new_title [ GetTitleName $g_basic_reviewlist($p_CurrCompId) ]; GetTitleNames; *titlecreate "$new_title" undefined 0 0 6 2 0 0.01 0.02 *titlemodify "$new_title" "borderon" "" 0 0 #*titlemodify "$new_title" "bordercolor" "" 2 0 *titlemodify "$new_title" "titletext" "$mdltr_basic_titletext" 0 1 set new_title2 "checktype"; GetTitleNames; *titlecreate "$new_title2" undefined 0 0 6 2 0 0.66 0.3 *titlemodify "$new_title2" "borderon" "" 0 0 #*titlemodify "$new_title" "bordercolor" "" 2 0 *titlemodify "$new_title2" "titletext" "$mdltr_basic_titletext2" 0 1 set new_title3 "value"; GetTitleNames; *titlecreate "$new_title3" undefined 0 0 6 2 0 0.78 0.3 *titlemodify "$new_title3" "borderon" "" 0 0 *titlemodify "$new_title3" "titletext" "$mdltr_basic_titletext3" 0 1 set new_title4 "failing elements"; GetTitleNames; *titlecreate "$new_title4" undefined 0 0 6 2 0 1.0 0.3 *titlemodify "$new_title4" "borderon" "" 0 0 *titlemodify "$new_title4" "titletext" "$mdltr_basic_titletext4" 0 1 *displaycollectorwithfilter assemblies "none" "" 1 0 *displaycollectorwithfilter assemblies "on" [ GetComponentName $p_CurrCompId ] 1 0 *window 0 0 0 0 0 *plot *clearmark elements 1 *clearmark elements 2 } ;#proc ::mdltr::BasicReview { mdltr_basic_incrementindex } ################################################################################ proc ::mdltr::BasicClearEndAll { args } { # Clears the environment and closes the nav window destroy .form_nextback *createmark titles 1 "displayed" StandardView *deletemark titles 1 hm_usermessage "Model Tour Complete" 1 UnsetAll } ;#proc ::mdltr::BasicClearEndAll { args } ################################################################################ proc ::mdltr::BasicClearViewAll { activeComp args } { # Clears the environment and closes the nav window variable p_modelTour; # Clean out and edge elements in the model and reset the display if { $p_modelTour(ActiveEdges) } { if { ! $p_modelTour(NoPlatesInComp) } { if { [ IsComponentExist "^edges" ] } { *deleteedges; } } #*displaycollectorwithfilter groups "none" "" 1 0 *displaycollectorwithfilter assemblies "on" "$activeComp" 1 0 *displaycollectorwithfilter groups "none" "" 1 0 } if { $p_modelTour(ActiveFeatures) } { if { ! $p_modelTour(NoPlatesInComp) } { if { [ IsComponentExist "^edges" ] } { *deleteedges; } } *displaycollectorwithfilter assemblies "on" "$activeComp" 1 0 *displaycollectorwithfilter groups "none" "" 1 0 } if { $p_modelTour(ActiveNormals) } { if { ! $p_modelTour(NoPlatesInComp) } { *normalsoff; } *displaycollectorwithfilter assemblies "on" "$activeComp" 1 0 *displaycollectorwithfilter groups "none" "" 1 0 } } ;#proc ::mdltr::BasicClearViewAll { activeComp args } ################################################################################ proc ::mdltr::Check { } { variable g_basic_reviewlist; variable p_modelTour; global mdltr_basic_complist global mdltr_basic_reviewindex set p_CurrCompId [ lindex $mdltr_basic_complist $mdltr_basic_reviewindex ]; global mdltr_warpage mdltr_aspect mdltr_skew mdltr_length mdltr_jacobian mdltr_minanglequad mdltr_maxanglequad mdltr_minangletria mdltr_maxangletria mdltr_taper mdltr_chordal \ W_Fail AR_Fail SA_Fail ML_Fail J_Fail MinQ_Fail MaxQ_Fail MinT_Fail MaxT_Fail T_Fail CD_Fail \ W_N_Fail AR_N_Fail SA_N_Fail ML_N_Fail J_N_Fail MinQ_N_Fail MaxQ_N_Fail MinT_N_Fail MaxT_N_Fail T_N_Fail CD_N_Fail \ Duplicate_Elems TQRatio Total_Tria_Quad_Number Total_Tria_Number Total_Quad_Number foreach z {mdltr_warpage mdltr_aspect mdltr_skew mdltr_length mdltr_jacobian mdltr_minanglequad mdltr_maxanglequad mdltr_minangletria mdltr_maxangletria mdltr_taper mdltr_chordal} \ y {warpage aspect skew length jacobian interangle interangle interangle interangle taper chordaldeviation} { if {[Null $z]} { if {$y == "aspect" || $y == "skew"} { set $z 1 } else { set $z 0 } } } *clearmark assemblies 1 *clearmark elements 1 *createmark assemblies 1 "by name only" [ GetComponentName $p_CurrCompId ] *createmark elements 1 "by assems on mark" 1 *clearmark elements 2 set mark1 [hm_getmark elements 1] if {[llength $mark1] > 0} { *elementtestinterangle elements 1 360 0 2 1 2 0 "Quad Min Angle" } else { #tk_messageBox -message "There are no trias or quads in the model." } set quad_list [hm_getmark elements 2] *clearmark elements 2 if {[llength $mark1] > 0} { *elementtestinterangle elements 1 360 1 2 1 2 0 "Tria Min Angle" } set tria_list [hm_getmark elements 2] if {([llength $tria_list] == 0) && ([llength $quad_list] == 0)} { set TQRatio 0 } elseif {([llength $tria_list] > 0) && ([llength $quad_list] == 0)} { set TQRatio 100.0 } elseif {([llength $tria_list] >= 0) && ([llength $quad_list] > 0)} { set TQRatio [format "%.0f" [expr ([llength $tria_list]*1.0/([llength $quad_list]+[llength $tria_list]) * 100)]] } *clearmark elements 2 set Total_Tria_Number [llength $tria_list] set Total_Quad_Number [llength $quad_list] set Total_Tria_Quad_Number [expr (([llength $tria_list])+[llength $quad_list])] #tk_messageBox -message "Total Quads is $Total_Quad_Number" #tk_messageBox -message "Total Trias is $Total_Tria_Number" #tk_messageBox -message "Total Trias & Quads is $Total_Tria_Quad_Number" foreach a {warpage aspect skew length jacobian interangle interangle interangle interangle taper chordaldeviation} \ b "$mdltr_warpage $mdltr_aspect $mdltr_skew $mdltr_length $mdltr_jacobian $mdltr_minanglequad $mdltr_maxanglequad $mdltr_minangletria $mdltr_maxangletria $mdltr_taper $mdltr_chordal" \ bb {mdltr_warpage mdltr_aspect mdltr_skew mdltr_length mdltr_jacobian mdltr_minanglequad mdltr_maxanglequad mdltr_minangletria mdltr_maxangletria mdltr_taper mdltr_chordal} \ c {"Warpage" "Aspect" "Skew" "Length" "Jacobian" "Quad Min" "Quad Max" "Tria Min" "Tria Max" "Taper" "Chordal Deviation"} \ d {W_Fail AR_Fail SA_Fail ML_Fail J_Fail MinQ_Fail MaxQ_Fail MinT_Fail MaxT_Fail T_Fail CD_Fail} \ e {W_N_Fail AR_N_Fail SA_N_Fail ML_N_Fail J_N_Fail MinQ_N_Fail MaxQ_N_Fail MinT_N_Fail MaxT_N_Fail T_N_Fail CD_N_Fail} { if {$b < 0} { set b [expr {abs($}] set $bb $b } if { [string length $a] && $b=="empty" && [string length $c] && (![string length $d] || $d>=0) } { set $d { } continue } else { *clearmark elements 2 set mark1 [hm_getmark elements 1] if {[llength $mark1] > 0} { if {[string equal $a "skew"]} { *elementtest$a elements 1 $b 2 2 0 "2D Element $c" } if {[string equal $a "interangle"] && [string equal $bb "mdltr_minangletria"]} { *elementtest$a elements 1 $b 1 2 1 2 0 "$c Angle" } if {[string equal $a "interangle"] && [string equal $bb "mdltr_maxangletria"]} { *elementtest$a elements 1 $b 1 2 0 2 0 "$c Angle" } } set elemIds [hm_getmark elements 2] if {[string equal $d "W_Fail"] || [string equal $d "AR_Fail"] || [string equal $d "SA_Fail"] || [string equal $d "ML_Fail"] || [string equal $d "J_Fail"] || [string equal $d "T_Fail"] || [string equal $d "CD_Fail"]} { if {$Total_Tria_Quad_Number > 0} { set $d [format "%.0f" [expr (([llength $elemIds]*1.0)/$Total_Tria_Quad_Number) * 100]] set $e [llength $elemIds] } else { set $d 0 set $e [llength $elemIds] } } elseif {[string equal $d "MinQ_Fail"] || [string equal $d "MaxQ_Fail"]} { if {$Total_Quad_Number > 0} { set $d [format "%.0f" [expr (([llength $elemIds]*1.0)/$Total_Quad_Number) * 100]] set $e [llength $elemIds] } else { set $d 0 set $e [llength $elemIds] } } elseif {[string equal $d "MinT_Fail"] || [string equal $d "MaxT_Fail"]} { if {$Total_Tria_Number > 0} { set $d [format "%.0f" [expr (([llength $elemIds]*1.0)/$Total_Tria_Number) * 100]] set $e [llength $elemIds] } else { set $d 0 set $e [llength $elemIds] } } *clearmark elements 2 } } if {$Total_Tria_Quad_Number > 0} { *clearmark elements 2 *elementtestduplicates elements 1 2 2 set No_of_dup_elems [hm_getmark elements 2] set Duplicate_Elems [llength $No_of_dup_elems] *clearmark elements 1 *clearmark elements 2 } else { set Duplicate_Elems 0 #tk_messageBox -message "There are no trias or quads in the model." } hm_usermessage "Check is complete." } ################################################################################ proc ::mdltr::BasicReviewGui { args } { # Purpose: creates a GUI to select a block to delete. Calls are then made # to delete buttons, manifest blocks, and files. variable g_basic_reviewlist; global mdltr_basic_complist global mdltr_basic_reviewindex global mdla # Display the model tour only when component "^edges"( if it exists) has been deleted variable dispModeltour; set dispModeltour 1; set reviewlist [array get g_basic_reviewlist]; if { [lsearch $reviewlist "^edges"] != -1 } { set value [ hwt::Message -msgTitle "Delete Edges" -msgText "\n\nTo proceed to the Model Tour, please delete your edges component.\nDo you want to delete the edges now?\n" \ -msgAccept "Yes" -msgCancel "No" -msgIcon warning -msgNoWait 0 ]; if { $value } { ::mdltr::DeleteEdgesComponent; } else { ::mdltr::SkipModelTour; } } if { $dispModeltour } { set mdltr_basic_startincrement "0" BasicReview $mdltr_basic_startincrement set mdla .form_nextback toplevel $mdla wm title $mdla "Model Tour"; KeepOnTop $mdla wm resizable $mdla 0 0 wm protocol $mdla WM_DELETE_WINDOW { ::mdltr::BasicClearEndAll } # wm geometry $mdla +1110+250 frame $mdla.buttons pack $mdla.buttons -side top -fill x -pady 1m label $mdla.buttons.description -text "Use Next, Back to navigate component list" pack $mdla.buttons.description -side top button $mdla.buttons.next -text "<<Back" -command { set increment "-1";\ *createmark titles 1 "displayed";*deletemark titles 1; ::mdltr::BasicReview $increment} button $mdla.buttons.back -text "Next>>" -command { set increment "1";\ *createmark titles 1 "displayed";*deletemark titles 1;::mdltr::BasicReview $increment} button $mdla.buttons.dismiss -text End -command { ::mdltr::BasicClearEndAll} pack $mdla.buttons.next $mdla.buttons.back -padx 2 -side left -expand 1 -fill x pack $mdla.buttons.dismiss -side right -padx 2m -expand 1 -fill x frame $mdla.line -borderwidth 2 -height 2 pack $mdla.line -side top -fill x frame $mdla.displaycontrol pack $mdla.displaycontrol -side bottom -fill x -pady 1m button $mdla.displaycontrol.normals -text "Find Normals" -command {::mdltr::FindNormals} button $mdla.displaycontrol.edges -text "Find FreeEdges" -command {::mdltr::FindFreeEdges} button $mdla.displaycontrol.edges1 -text "Find T-Edges" -command {::mdltr::FindT-Edges} button $mdla.displaycontrol.attach -text "Find Attached" -command {::mdltr::FindAttached} button $mdla.displaycontrol.standard -text "Standard View" -command {::mdltr::StandardView} pack $mdla.displaycontrol.standard $mdla.displaycontrol.normals $mdla.displaycontrol.edges $mdla.displaycontrol.edges1 $mdla.displaycontrol.attach -side left -pady 1m -padx 2 -expand 1 } } ;#proc ::mdltr::BasicReviewGui { args } ################################################################################ proc ::mdltr::QualityReport { args } { *evaltclscript "D:/Altair/hm/scripts/ravi.tcl" 0 } ;#proc ::mdltr::QualityReport { args } ################################################################################ proc ::mdltr::UnsetAll { args } { global mdltr_basic_reviewindex; global mdla mdltr_basic_complist catch { unset mdltr_basic_complist } catch { unset mdla } } ;#proc ::mdltr::UnsetAll { args } ################################################################################ proc ::mdltr::IsComponentExist { comp_name } { # Purpose: obtains the name of the component from its id *createmark comp 1 "by name only" $comp_name; if { [ string equal [ hm_getmark comp 1 ] "" ] } { return 0; } return 1; } ;#proc ::mdltr::IsComponentExist { comp_name } ################################################################################ proc ::mdltr::GetComponentName { id } { # Purpose: obtains the name of the component from its id return [ hm_entityinfo name assembly $id]; } ;#proc ::mdltr::GetComponentName { id } ################################################################################ proc ::mdltr::GetTitleName { comp_name } { # Purpose: returns unique title for component. This is the same as # component name if there are no clashes with existing titles variable g_comp_exceptions; if { [ info exist g_comp_exceptions($comp_name) ] } { return $g_comp_exceptions($comp_name); } return $comp_name; } ;#proc ::mdltr::GetTitleName { comp_name } ################################################################################ proc ::mdltr::GetTitleNames { args } { *createmark titles 1 all; set titleids [ hm_getmark titles 1 ]; set titlelist ""; foreach title_id $titleids { lappend titlelist [ hm_entityinfo name title $title_id -byid ]; } return $titlelist; } ;# proc ::mdltr::GetTitleNames { args } ################################################################################ proc ::mdltr::PrepareTitleNames { args } { variable g_comp_exceptions; set titlelist [ GetTitleNames ]; catch { set complist [ hm_complist name ]}; if { ![Null complist] } { foreach comp $complist { foreach title $titlelist { if { [ string equal $comp $title ] } { set new_title [ GenerateAnotherTitleName $comp ]; while { [ lsearch -exact complist $new_title ] != "-1" ||\ [ lsearch -exact titlelist $new_title ] != "-1" } { set new_title [ GenerateAnotherTitleName $comp ]; } set g_comp_exceptions($comp) "$new_title"; } } } } } ;#proc ::mdltr::PrepareTitleNames { args } ################################################################################ proc ::mdltr::GenerateAnotherTitleName { base_title args } { set new_title $base_title; return [ append new_title "1" ]; } ;#proc ::mdltr::GenerateAnotherTitleName { base_title args } ################################################################################ proc ::mdltr::DeleteEdgesComponent { } { global mdltr_basic_complist; variable dispModeltour; set dispModeltour 1; *createmark components 1 "^edges"; *deletemark components 1; set mdltr_basic_complist [ hm_complist id ]; set mdltr_basic_check [ llength $mdltr_basic_complist ]; ::mdltr::SetReviewList $mdltr_basic_check; }; #proc ::mdltr::DeleteEdgesComponent { } ################################################################################ proc ::mdltr::SkipModelTour { } { variable dispModeltour; set dispModeltour 0; }; #proc ::mdltr::SkipModelTour { } ################################################################################ ::mdltr::Main;
  3. proc automesh {} { *createmark comp 1 all *findedges components 1 0 *clearmark comps 1 all *createmark comp 1 all set complist [hm_getmark comps 1 ] foreach comp $complist { set compname [ hm_getcollectorname comps $comp ] tk_messageBox -message $comp } *displaycollectorwithfilter components "none" "" 1 0 *displaycollectorwithfilter components "on" "^edges" 1 0 #*createmark comps 2 "displayed" set cm [lindex ^edges 0] set cm1 [lindex ^edges 1] *createmark comps 1 "$cm" *createmark elements "^edges" *createmark nodes 1 "^edges" set hm [hm_getmark nodes 1] *surfacemode 2 *createlist nodes 1 [lindex $hm 0] [lindex $hm 1] [lindex $hm 2] [lindex $hm 3] *createlist nodes 2 [lindex $hm 6] [lindex $hm 7] [lindex $hm 8] *linearsurfacebetweennodes 1 2 1 foreach id ^edges { } #*surfacemode 2 #*createlist nodes 1 "" #*createlist nodes 2 "^edges" #*linearsurfacebetweennodes 1 2 1 #*linearsurfacebetweennodes 1 2 1 #*set_meshfaceparams 0 1 0 0 0 1 0.5 1 1 #*set_meshedgeparams 0 2 0 0 0 0 0 0 0 #*set_meshedgeparams 1 1 0 0 0 0 0 0 0 #*set_meshedgeparams 2 3 0 0 0 0 0 0 0 #*set_meshedgeparams 3 1 0 0 0 0 0 0 0 #*automesh 0 1 0 } automesh please help me
  4. can you please help me to find out the line numbers in each component perticularly using tcl/tk
  5. Hi, do you mean that we have to select the line manually in HM. Or We have to try to modify somthing in this program. Please clarify.
  6. thanxs for Reply. But I dont want this . I want to select that lines automatically in a component.
  7. Hi guys , Is there any macro that can calculate the thickness of a component by calculating the distance between the two lines , but the user wont select the lines , it should be automated .
  8. Hi mario , Thanks for your reply . by using set compT [ hm_getcompthickness $cid ] , we can get the thickness only if its assigned . what I want is I want a macro that should calculate the thickness by finding out the distance between the two lines. Hope you got my point
  9. can you people any one is having idea about get the line numbers in a perticular component in hypermesh using tcl/tk
×
×
  • Create New...