Defining Initial velocity by tcl script

Yu-Ju Chen_20500
Yu-Ju Chen_20500 Altair Community Member
edited October 2020 in Community Q&A

hi, i'm trying to define an initial velocity by the tcl script.

At first, i have tried to use macro to record the script to define an initial velocity. As following,

https://imgur.com/a/u9xd4g3

the comman is *loadcreateonentity_curve(nodes,1,8,2,-7157.98626,6287.04714,0,0,0,9527,0,0,0,0,0)

 

there is no detail for the velocity on the hyperwork online documentation

 

when i try to use arguments to replace the vectors and the magnitude.

*createmarkpanel nodes 1 'Please pick one node'

set magnitude [hm_getint 'magnitude= ' 'Please specify the magnitude of velocity']

set plane [hm_getplanepanel 'Please define a plane']

foreach {nx ny nz} [lindex [lindex $plane 0] 0] {}

foreach {bx by bz} [lindex [lindex $plane 0] 1] {}

*loadcreateonentity_curve nodes 1 8 2 $nx $ny $nz 0 0 $magnitude 0 0 0 0 0

 

 

the results showed me an initial velocity with correct vector direction but wrong magnitude. (Magnitude = 1 )

https://imgur.com/a/DS4FHO5

 

 

does anyone can help me to solve this problem?

Answers

  • tinh
    tinh Altair Community Member
    edited October 2018

    Maybe... a software bug!

     

    Anyway, try setting magnitude by vector length:

    *loadcreateonentity_curve nodes 1 8 2 [expr $nx* $magnitude]  [expr $ny* $magnitude]  [expr $nz* $magnitude] 0 0 $magnitude 0 0 0 0 0

  • Yu-Ju Chen_20500
    Yu-Ju Chen_20500 Altair Community Member
    edited October 2018

    Hi , tinh,

    Thanks a lot! Your suggestion is very helpful