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


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=""></a>

or for full users guide:
<a target=_blank href=""></a>

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)

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
/$num is number of repeating units
/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
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
undo endgroup

/checking the last id
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

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