Automate node creation

Altair Forum User
Altair Forum User
Altair Employee
edited October 2020 in Community Q&A

Hi,

I need to create nodes for elements of user specified sizes. For eg, If the user specifies size 6 for the element, the nodes should be created at (0,0), (0,6), (6,0), (6,6). If the user specifies size 8 for the element, the nodes should be created at (0,0), (0,8), (8,0), (8,8). This is to be repeated to generate a geometry 830 mm*450 mm . therefore, if the element is of size 8, 830/8 elements must be created along the length and 450/8 elements along the width with their corresponding nodes. Please tell me how to automate this? Also, I need flexibility to change 830*450 mm dimensions to user specified dimensions (say 500*250 or 1000*600 etc etc). How do I incorporate this??

 

thanks,

Kushal. 

Tagged:

Answers

  • Pandurang
    Pandurang Altair Community Member
    edited April 2018

    Hi kushal

     

    it is not possible to create element of same size within that dimensions i.e 830*450 until element size completely divide dimension 830 & 450 

    user specified size say 8 , does not divide 830 completely so every element size can't be 8..

     

    #####Script 

     

    set length [hm_getint Length 'Enter the length']
    set width [hm_getint Width 'Enter the Width']
    set elemSize [hm_getint size 'Enter the element size']

    set length_count 0
    set width_count 0

    while {$length_count < $length} {
        while {$width_count < $width} {
            *createnode $length_count $width_count 0 0
            incr width_count $elemSize
            if {$width_count >= $width} {
                *createnode $length_count $width 0 0
            }
        }
        set width_count 0
        incr length_count $elemSize
        if {$length_count >= $length} {
                while {$width_count < $width} {
                    *createnode $length $width_count 0 0
                    incr width_count $elemSize
                    if {$width_count >= $width} {
                        *createnode $length $width 0 0
                    }
                }
            }


    }

     

     

     

     

     

  • vipin_22401
    vipin_22401 Altair Community Member
    edited April 2018

    Hi,

    I need to create nodes for elements of user specified sizes. For eg, If the user specifies size 6 for the element, the nodes should be created at (0,0), (0,6), (6,0), (6,6). If the user specifies size 8 for the element, the nodes should be created at (0,0), (0,8), (8,0), (8,8). This is to be repeated to generate a geometry 830 mm*450 mm . therefore, if the element is of size 8, 830/8 elements must be created along the length and 450/8 elements along the width with their corresponding nodes. Please tell me how to automate this? Also, I need flexibility to change 830*450 mm dimensions to user specified dimensions (say 500*250 or 1000*600 etc etc). How do I incorporate this??

     

    thanks,

    Kushal. 

     

    Hi,

     

    You can create one big element with that dimension for example 830x450mm, do a remesh on that element with 8mm mesh size/all quads then get all the nodes.