🎉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 mesh lines automatically by using tcl script?

User: "mansin"
Altair Community Member
Updated by mansin

Hi ,

I wanted to mesh a lot of lines with variable lengths in model by using tcl script, but I found the sample script in help is not intelligent, for example

 

*createmark lines 1 15 18

*linemesh_preparedata lines 1 30

*linemesh_saveparameters 0 3 0 0

*linemesh_saveparameters 1 2 0 0

*linemesh_savedata1 1 5 0 0

 

The parameter 'density' in line 3 and 4 are manually assigned, and the 'segment' and 'density' parameteres must be strictly matched. If the length of each line are different, the density are also different. So, a lot of *linemesh_saveparameters commands are needed. It is not acceptable for this meshing scripting.

So, is there a way to mesh lines with constant element size?

Find more posts tagged with

Sort by:
1 - 4 of 41
    User: "QuyNguyenDai"
    Altair Community Member
    Updated by QuyNguyenDai

    If the standard command is not suitable for you, write yourself!

    Here's my script:

     set elem_size 5; set elem_type 61;  *createmarkpanel lines 1 'Select Lines' set lines [hm_getmark lines 1] *linemesh_preparedata1 lines 1 0 $elem_type; set i 0; foreach line_id $lines { 	set len [hm_linelength $line_id] 	set num [expr int($len / $elem_size)] 	*linemesh_saveparameters $i $num 0 0; 	incr i; } *linemesh_savedata1 1 $elem_type 0 0; *clearmark lines 1;

     

    User: "mansin"
    Altair Community Member
    OP
    Updated by mansin

    Hi, Q.Nguyen-Dai

    Thanks you very much for your sample script.

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

    If the standard command is not suitable for you, write yourself!

    Here's my script:

      set elem_size 5; set elem_type 61;  *createmarkpanel lines 1 'Select Lines' set lines [hm_getmark lines 1] *linemesh_preparedata1 lines 1 0 $elem_type; set i 0; foreach line_id $lines { 	set len [hm_linelength $line_id] 	set num [expr int($len / $elem_size)] 	*linemesh_saveparameters $i $num 0 0; 	incr i; } *linemesh_savedata1 1 $elem_type 0 0; *clearmark lines 1;

     

    when i am run this file their is error unknown entity type found what is this ?  what is element type 61?

    User: "Dinesh c"
    Altair Community Member
    Updated by Dinesh c

    element type changes from solver to solver. Please set which element type do you want.

     

    You can easily find available element types in hypermesh>1D page>element types