• Announcements

    • Rahul Ponginan

      Please click here for a short but important announcement   03/26/17

      Dear Users Our Commercial and Academic users around the world can use these same forums here as before i.e. the Altair Support Forum , Commercial users from India with solver queries can go to the Solver Forum for India Commercial Users , Academic Users from India and AOC India Participants are requested to go to the Forum for India Academic Users and AOC India Participants , We will be tending to all queries in all the forums promptly as before, thank you for your understanding. 
  • 0
Merula

TCL Addition

Question

Hello guys,

 

I am trying to script a creation of a box and have a problem with the *createnode command:

 

Scipt:

 

#Nodes
*deletemodel  
*answer yes

variable width 100
variable height 100
variable depth 100
variable x1 0
variable y1 0
variable z1    0

*createnode $x1 $y1 $z1 0 0 0
*createnode $x1+$width $y1 $z1 0 0 0
*createnode $x1+$width $y1+$depth $z1 0 0 0
*createnode $x1 $y1+$depth $z1 0 0 0
*createnode $x1 $y1 $z1+$height 0 0 0
*createnode $x1+$width $y1+$depth $z1+$height 0 0 0
*createnode $x1+$width $y1+$depth $z1+$height 0 0 0
*createnode $x1 $y1+$depth $z1+$height 0 0 0
 

 

 

the addition is not working, brackets {} as well as eval, return or somthing else does not work. HW just creates 0 0 0  nodes.

Any ideas?

 

Thanks in advance.

 

Merula

Share this post


Link to post
Share on other sites

4 answers to this question

  • 1

Maybe you could point to me where there is still room for improvement on my script.

 

The aim is to generate a solid and mesh it automatically.

 

# Box creation
*deletemodel
*answer yes

variable x1 0
variable y1 0
variable z1 0
variable width 100
variable depth 100
variable height 100
variable meshsize 1

# Nodes
*createnode $x1 $y1 $z1 0 0 0
*createnode [expr $x1+$width] $y1 $z1 0 0 0
*createnode [expr $x1+$width] [expr $y1+$depth] $z1 0 0 0
*createnode $x1 [expr $y1+$depth] $z1 0 0 0
*createnode $x1 $y1 [expr $z1+$height] 0 0 0
*createnode [expr $x1+$width] $y1 [expr $z1+$height] 0 0 0
*createnode [expr $x1+$width] [expr $y1+$depth] [expr $z1+$height] 0 0 0
*createnode $x1 [expr $y1+$depth] [expr $z1+$height] 0 0 0

#lines
for { set i 1 } { $i < 4 } { incr i } {
*createlist nodes 1 $i [expr $i +1]
*linecreatefromnodes 1 0 150 5 179
}
*createlist nodes 1 4 1
*linecreatefromnodes 1 0 150 5 179

for { set i 5 } { $i < 8 } { incr i } {
*createlist nodes 1 $i [expr $i +1]
*linecreatefromnodes 1 0 150 5 179
}
*createlist nodes 1 8 5
*linecreatefromnodes 1 0 150 5 179

for { set i 1 } { $i < 5 } { incr i } {
*createlist nodes 1 $i [expr $i+4]
*linecreatefromnodes 1 0 150 5 179
}

# Surfaces
*createmark lines 1 1-4
*createplane 1 1 0 0 0 0 0
*splinesurface lines 1 1 1 1

*createmark lines 1 5-8
*createplane 1 1 0 0 0 0 0
*splinesurface lines 1 1 1 1

*createmark lines 1 1 10 5 9
*createplane 1 1 0 0 0 0 0
*splinesurface lines 1 1 1 1

*createmark lines 1 2 11 6 10
*createplane 1 1 0 0 0 0 0
*splinesurface lines 1 1 1 1

*createmark lines 1 3 12 7 11
*createplane 1 1 0 0 0 0 0
*splinesurface lines 1 1 1 1

*createmark lines 1 4 9 8 12
*createplane 1 1 0 0 0 0 0
*splinesurface lines 1 1 1 1

#Solid
*createmark surfaces 1 1-6
*solids_create_from_surfaces 1 4 -1 2

#Meshing
*solidmap_begin 0
*solidmap_prepare_usrdataptr "SOURCE" 4
*solidmap_prepare_usrdataptr "DEST" 4
*solidmap_prepare_usrdataptr "ALONG" 32
*createmark solids 1  1
*solid_prepare_entitylst solids 0
*solidmap_end 9344 $meshsize 0 0

 

 

Thanks and best regards,

Merula

Share this post


Link to post
Share on other sites
  • 0
On 10/10/2015 at 8:13 PM, Merula said:

Maybe you could point to me where there is still room for improvement on my script.

 

The aim is to generate a solid and mesh it automatically.

 

# Box creation
*deletemodel
*answer yes

variable x1 0
variable y1 0
variable z1 0
variable width 100
variable depth 100
variable height 100
variable meshsize 1

# Nodes
*createnode $x1 $y1 $z1 0 0 0
*createnode [expr $x1+$width] $y1 $z1 0 0 0
*createnode [expr $x1+$width] [expr $y1+$depth] $z1 0 0 0
*createnode $x1 [expr $y1+$depth] $z1 0 0 0
*createnode $x1 $y1 [expr $z1+$height] 0 0 0
*createnode [expr $x1+$width] $y1 [expr $z1+$height] 0 0 0
*createnode [expr $x1+$width] [expr $y1+$depth] [expr $z1+$height] 0 0 0
*createnode $x1 [expr $y1+$depth] [expr $z1+$height] 0 0 0

#lines
for { set i 1 } { $i < 4 } { incr i } {
*createlist nodes 1 $i [expr $i +1]
*linecreatefromnodes 1 0 150 5 179
}
*createlist nodes 1 4 1
*linecreatefromnodes 1 0 150 5 179

for { set i 5 } { $i < 8 } { incr i } {
*createlist nodes 1 $i [expr $i +1]
*linecreatefromnodes 1 0 150 5 179
}
*createlist nodes 1 8 5
*linecreatefromnodes 1 0 150 5 179

for { set i 1 } { $i < 5 } { incr i } {
*createlist nodes 1 $i [expr $i+4]
*linecreatefromnodes 1 0 150 5 179
}

# Surfaces
*createmark lines 1 1-4
*createplane 1 1 0 0 0 0 0
*splinesurface lines 1 1 1 1

*createmark lines 1 5-8
*createplane 1 1 0 0 0 0 0
*splinesurface lines 1 1 1 1

*createmark lines 1 1 10 5 9
*createplane 1 1 0 0 0 0 0
*splinesurface lines 1 1 1 1

*createmark lines 1 2 11 6 10
*createplane 1 1 0 0 0 0 0
*splinesurface lines 1 1 1 1

*createmark lines 1 3 12 7 11
*createplane 1 1 0 0 0 0 0
*splinesurface lines 1 1 1 1

*createmark lines 1 4 9 8 12
*createplane 1 1 0 0 0 0 0
*splinesurface lines 1 1 1 1

#Solid
*createmark surfaces 1 1-6
*solids_create_from_surfaces 1 4 -1 2

#Meshing
*solidmap_begin 0
*solidmap_prepare_usrdataptr "SOURCE" 4
*solidmap_prepare_usrdataptr "DEST" 4
*solidmap_prepare_usrdataptr "ALONG" 32
*createmark solids 1  1
*solid_prepare_entitylst solids 0
*solidmap_end 9344 $meshsize 0 0

 

 

Thanks and best regards,

Merula

How can we define our own boundaries ? like what if there was a curve or curvature on surfaces?

what i wanted to know is if i give the cad files as input, can it generate mesh despite the curvatures?

@tinh Please find time for the same

Thanks and Regards,

Arjun 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now