Model tour Enhancement
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($/emoticons/default_cool.png' alt='B)'>}]
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 }</
Answers
-
hi KIRAN,
may i know why you need a model tour for assemblies?
because an assem includes several components and/or sub-assems
otherwise one component may belong to some assems
so if a tour made for assemblies, it may repeat the components you've already viewed
regards,
tinh
0 -
good
0