Can you show me how to use LASTID functionality in GAMBIT?


The user wrote:

after I write down the expression

$X = LASTID(t_fa)

then can I go and do something else like sweep with

face.$X?


GAMBIT has a function called LASTID to help with these situations. You can find the info at in the documentation CD or online (need to login) at

<a target=_blank href="http://www.fluentusers.com/gambit2/doc/ori/html/users_guide/ug0b.htm#1924">http://www.fluentusers.com/gambit2/doc/ori/html/users_guide/ug0b.htm#1924</a>http://www.fluentusers.com/gambit2/doc/ori/html/users_guide/ug0b.htm#1924

or for full users guide:
<a target=_blank href="http://www.fluentusers.com/gambit2/doc/ori/html/users_guide/ugtoc.htm">http://www.fluentusers.com/gambit2/doc/ori/html/users_guide/ugtoc.htm</a>http://www.fluentusers.com/gambit2/doc/ori/html/users_guide/ugtoc.htm


LASTID - Last Entity Identifier

LASTID returns the last identification number used in the model for a specified type (entity_type) of geometric entity, zone definition, coordinate system, boundary layer, or size function.


Format: LASTID(entity_type)

Examples:
If the most recently created face in a model is labeled face.5, the following function call returns the value five (5) to the parameter X:

$X = LASTID(t_fa)


Here is an input file to show how to use LASTID in a parametric journal file (tested on GAMBIT 2.1.6):



/GAMBIT version 2.1.6 by AK
/Jan 16, 2004
/parameters
/$num is number of repeating units
reset
$num=2
$height=10
$radius=.5
$offset=5
$ang=360/$num
/
/create unit cylinder
undo begingroup
volume create height $height radius1 $radius radius3 $radius
offset 0 0 ($height/2) zaxis frustum
undo endgroup
undo begingroup
volume move "volume.1" offset $offset 0 0
undo endgroup
/
/make copies
undo begingroup
$i=1
do para "$i" init 1 cond ($i .le. ($num-1))
volume copy ("volume." + ntos ($i)) to ("volume." + ntos ($i+1))
volume move ("volume." + ntos ($i+1)) dangle $ang vector 0 0 1 origin 0 0 0
enddo
undo endgroup

/checking the last id
/
$last_vol=lastid(t_vo)
para list "last_vol"
/moving the last volume
/we need to use ntos -- number to string command
/
volume move ("volume." + ntos($last_vol)) offset 20 0
/done





Show Form
No comments yet. Be the first to add a comment!