🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

how to control the node numbering?

User: "Altair Forum User"
Altair Employee
Updated by Altair Forum User

a set of 100nodes (all connected as a straight line) was define from a large node sizes (lets say is 1000), i want to renumber the set follow a sequence (lets say from left to right, 1 to 100) ...but after i renumbering them, the set doesn't follow the desired sequence...so how to solve it...any expert..?

although this could be manually done by clicking one by one until hundread...but problem came when the node set is too large (click until your mouse spoiled...haha)

SOS!!#-o

Find more posts tagged with

Sort by:
1 - 7 of 71
    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    We are working on a in core solution for this. In the meantime we have a couple macros. Here is one that requires a mapped mesh and a couple node picks to determine the direction and sequence of the numbering. To start, the numbering range you want must be available.

    proc lsubtract {list1 list2} {set ret $list1    foreach i $list2 {        set tmp [lsearch $ret $i]        set ret [lreplace $ret $tmp $tmp]    }    return $ret}set starting_id [ hm_getint 'ID:' 'Enter starting ID' ]set incr_1 [ hm_getint '1-dir incr:' 'Enter increment in the 1-dir:' ]*clearlist nodes 1 *createlistpanel nodes 1 'Select starting node list in 2-direction:'set start_nodes [ hm_getlist nodes 1 ]*clearlist nodes 1 *createlistpanel nodes 1 'Select ending node list in 2-direction:'set end_nodes [ hm_getlist nodes 1 ]set incr_2 [ hm_getint '2-dir incr:' 'Enter increment in this direction:' ]*clearlist nodes 1 *createlistpanel nodes 1 'Select middle node list in 2-direction:'set mid_nodes [ hm_getlist nodes 1 ]set i 0set k 0foreach start_node $start_nodes { 	set mid_node [ lindex $mid_nodes $i ]	set end_node [ lindex $end_nodes $i ]	set id [ expr { $starting_id + $i } ]		incr i	*clearlist nodes 1	*nodelistbypath $start_node $mid_node 1	set list1 [ hm_getlist nodes 1 ]		*clearlist nodes 1		*clearlist nodes 2	*nodelistbypath $mid_node $end_node 2	set list2 [ hm_getlist nodes 2 ]		*clearlist nodes 2		set list2 [ lsubtract $list2 $mid_node ]		set list_of_nodes [ concat $list1 $list2 ]		set j 0		foreach node $list_of_nodes {				set id [ expr { $starting_id + $j + $k } ]		incr j $incr_1			*clearmark nodes 1		*createmark nodes 1 $node		*renumbersolverid nodes 1 $id 1 0 0 0 0 0		}		incr k $incr_2	}
    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    a set of 100nodes (all connected as a straight line) was define from a large node sizes (lets say is 1000), i want to renumber the set follow a sequence (lets say from left to right, 1 to 100) ...but after i renumbering them, the set doesn't follow the desired sequence...so how to solve it...any expert..?

    although this could be manually done by clicking one by one until hundread...but problem came when the node set is too large (click until your mouse spoiled...haha)

    SOS!!#-o

    I mean, why you want to re-number the nodes. If you want to use the nodes in a certain order, you can select them into a list by using *createlistpanel, choose option of by path. (*createmarkpanel does not do the work by order!) Then you can do foreach loop on the node list, which comes out by order, say, from left to right.

    If you really want it done, you can sort them along a vector. You may need to translate from one coordinates to another.

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User
    We are working on a in core solution for this. In the meantime we have a couple macros. Here is one that requires a mapped mesh and a couple node picks to determine the direction and sequence of the numbering. To start' date=' the numbering range you want must be available.

    proc lsubtract {list1 list2} {
    set ret $list1
    foreach i $list2 {
    set tmp [lsearch $ret $i]
    set ret [lreplace $ret $tmp $tmp]
    }
    return $ret
    }

    ...

    }

    [/quote']

    Dambach, thanks so much for providing this macro. I was trying to renumber the nodes of a mesh with 380 nodes by hand. It was driving me insane. This macro made it super simple.

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Anyone got the columned version of the script? I can't understand the syntax to reorder it.

    Thank you very much

    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai
    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

     

    Here's: 

    Thank you very much

    Unable to find an attachment - read this blog

    User: "Altair Forum User"
    Altair Employee
    OP
    Updated by Altair Forum User

    Hi! I want to do something similar but just in one direction. I want to mesh a spring, made by beams, but when I trie to renumber by path, hypermesh do it without any order.

    I cannot apply this macro, because it needs  two directions, do you hace any idea?

     

     

     

    Thank you in advance!