How do I get the last volume id with the classical journals like “get_last_id(‘volume’)” in python API.
In the following journal, in stead of “#{id1=1}”, I would prefer to obtain last id.
The APREPRO function Id(“type”) will do what you want. From the documentation,
Returns the ID of the entity most recently created with the specified type. Acceptable types include: “body”, “volume”, “surface”, “curve”, “vertex”, “group”, “node”, “edge”, “quad”, “face”, “tri”, “hex”, “tet”, or “pyramid”.
In your example, do something like
reset
create sphere radius 100
volume {Id("volume")} name 'sph1'
volume sph1 copy move z 200
volume {Id("volume")} rename 'sph2'