code for previewing the elements before splitting. !!!
Answers
-
basically i am trying to highlight the element which are just after selected elements from one side till the end.
can any one help me to find the solution.
thanks /emoticons/default_smile.png' alt=':)' srcset='/emoticons/smile@2x.png 2x' width='20' height='20'>
adams
0 -
hi
hm_highlightmark elems 1 h
will highlight the selected elements
0 -
actually problem is that i have to select the hexa's element of particular layer.
like selecting one hexa element then all the element associated with that layer got highlighted automatically.
let say the we have one example of splitting hexa element in HM when we press the preview button & elements got highlighted & moves progressively through a row of elements in the model.
thanks
adams.
0 -
so you want to auto mark a line of hexas? You can:
- mark first hexa
- mark top face, ex by N1N2
- search oposite face (n5n6n7n8)
- search other hexa that has this 4 nodes
- continue until not find any more hexa
0 -
Hi Tinh,
Actually for one elements it is possible. but what if user had selected any no. of hexa or penta on one plane then
algorithm searches for other elements opposite to it till the end.
Thanks
Adams
0 -
Hi
it's easy that you make a loop through selected elems one-by-one
ofcourse each interation we have to specify the direction N1N2
Just thinking how can we select least N1,N2 instead of doing again and again each interation
Anyway i think this maner of selection not very useful when you want to select a layer
So try other method ex : create faces, select shell elems 'by face' then find hexa layer that attached to them
0 -
Hi tinh
thanks for replying
can you please help me in generating the small procedure to select the opposite nodes and then there attached elements.
actually i am in the initial stage of the programing.
please help if possible.
thanks
Adams
0 -
Hi Adams
To find oposite nodes:
for example I have an hexa elem, and know 3 nodes (NodeA, NodeB, NodeC) on a face of that elem, i want to find oposite face nodes
foreach i {1 2 3 4 5 6 7 8} {set node$i [hm_getentityvalue elems $hexaelemid node$i.id 0 -byid]}
set face1 [list $node1 $node2 $node3 $node4]
set face2 [list $node5 $node6 $node7 $node8]
set face3 [ ... #mark 4 nodes on each face (you should draw a cube and write #node in vertices)
set face4, face5, face6,...
if {[expr ([lsearch $face1 $NodeA]!=-1) && ([lsearch $face1 $NodeB]!=-1) && ([lsearch $face1 $NodeC]!=-1)]} {return $face2}
if {search found in face2} return face1
if {search found in face3} return face4
...
to find elem attached to 4 nodes on the face: (forexample return $face2
eval *createmark nodes 1 $face2
*findmark nodes 1 1 1 elems 0 2
foreach elemid [hm_getmark elems 2] {
eval *createmark nodes 1 [hm_nodelist $elemid]
*markintersection nodes 1 nodes 2
if {([hm_marklength nodes 1]==4) && ($elemid != $hexaelemid)} {return $elemid} #mean elemid has 4 nodes same as 4 nodes on face2
}
0