Two question about the bas file

Moderator: GiD Team

Post Reply
luismir
Posts: 1
Joined: Fri Dec 18, 2015 7:29 pm

Two question about the bas file

Post by luismir »

My first question is:
Can I *set var ElemsConec(4,int) = xNode, being xNode a node that I created or this var can never be changed?
This is because I created a new node and I want to change the old node of the element to the new node. Apparently it doesn't change.

My second question:
When I have a loop on elements inside a loop on nodes like for instance:
*set Cond y *nodes
*loop nodes *OnlyInCond
....
*set Cond z *elems
*loop elems *OnlyInCond

It doesn't work with the second condition before elems (it only works without the condition).
Why is that?
Thanks for your help,
User avatar
escolano
Posts: 1918
Joined: Sun Sep 05, 1982 10:51 pm

Re: Two question about the bas file

Post by escolano »

All .bas file commands only get information from GiD mesh, and its data. Dont't modify anything.

You can modify the mesh for example at Tcl scripting level, with the GiD_Mesh command (GiD_Mesh edit element ...)
(see help on Cutomization->Tcl and Tk extension->Special Tcl commands->Mesh

About nesting a elems loop on elements with a condition on another loop on nodes with another condition,
maybe there is some problem setting a condition inside a loop of other condition.

.bas syntax is too limitated. To do very complex things you could invoke from the *.bas a Tcl command with *tcl()
Tcl is a powerful and well-defined scripting language.

In any case nesting these loops could be a bad idea, it could be too expensive for big meshes.
Maybe you can find other approach to solve it in a cheaper way.
Post Reply