Jump to content
Vikas Kumar

Checking Whether all nodes in model having "TEMPERATURE" load or not

Recommended Posts

Hi All,

I wrote a tcl\tk script to query whether each node in model is having temperature load or not.
But problem with this script is, It is taking more time execute the code.
Please provide any better script if available.
Current script is taking more than 1.30 Hrs for the number of node 162114.
Please provide if any solution exist as soon as possible.

 

My script is:-

proc validate args {
*clearmark nodes 1;
*nodecleartempmark
*plot
hm_redraw
set selectNode [lindex $args 0]
eval *createmark nodes 1 "$selectNode"
set nodeToChkTemp [hm_getmark nodes 1]

set nodeIDNotHvngTemp ""
set lengthOfN [llength nodeToChkTemp]
set currentTime [clock seconds]
puts "Start date: [clock format $currentTime -format %D] , Total Nodes: $lengthOfN"
puts "The time is: [clock format $currentTime -format %H:%M:%S]"
hm_usermessage "Getting information about temperature on node......."

foreach node $nodeToChkTemp {
set chk 0
*clearmark loads 1
*clearmark nodes 1
*createmark nodes 1 $node
*findmark nodes 1 1 1 loads 0 2
set loadID [hm_getmark loads 2]

foreach ld $loadID {
set loadType [hm_getvalue loads id=$ld dataname=typename]
if {$loadType == "TEMPERATURE"} {
set chk 1
break;
}
}

if { !$chk} {
lappend nodeIDNotHvngTemp $node
}
}

*numbersclear
*clearmark nodes 1;
*nodecleartempmark;
set currentTime [clock seconds]
puts "End date: [clock format $currentTime -format %D]"
puts "The time is: [clock format $currentTime -format %H:%M:%S]"
puts "validate nodes: $nodeIDNotHvngTemp"

*startnotehistorystate {isolateonly Component}
*clearmark components 2
*createmark components 2 "all"
*createstringarray 2 "elements_on" "geometry_on"
*isolateonlyentitybymark 2 1 2
*endnotehistorystate {isolateonly Component}
*plot
hm_redraw
*view "iso1"
*window 0 0 0 0
hm_usermessage ""
return $nodeIDNotHvngTemp
}
set chkNodeLst [validate "all"]
puts "validate nodes: $chkNodeLst"

 

 

# SCRIPT END

Regards,

Vikas Kumar

Share this post


Link to post
Share on other sites

Check the below.

 

*nodecleartempmark;
*createmark loads 1 "by config" temperature;
*findmark loads 1 1 1 nodes 0 2;
set lst_TemperatureNodes [hm_getmark nodes 2];
eval *createmark nodes 1 $lst_TemperatureNodes;
*createmark nodes 1 "reverse";
*nodemarkaddtempmark 1;

llyle, Vikas Kumar and tinh like this

Share this post


Link to post
Share on other sites

Hi Sandeep,

 

It won't work if temperature load is applied on a "set" which contains node.

In this case how temperature will be applied is like,

 

Will create one load collector which contains load type temperature and that load will carry set as mentioned in below image.

 

image.png.f5600faed9cfaa1f341fbd8a2e5652c2.png

 

In that case temperature will be applied indirectly to nodes.

And, in this scenario we can not check by above method.

@sandeepballiwar and @tinh pls reply if any other solution is there.

 

Best Regards,

Vikas Kumar

Share this post


Link to post
Share on other sites

Hi,

don't need *findmark

try this

*nodecleartempmark

*createmark loads 1 "by config" temperature

*createmark nodes 1 "by loads" {*}[hm_getmark loads 1]

*createmark nodes 1 reverse

*nodemarkaddtempmark 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
You are posting as a guest. If you have an account, please sign in.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...