# Create .bch in MacOs for definition y assignation of materials

**URL:** <https://forum.gidsimulation.com/t/create-bch-in-macos-for-definition-y-assignation-of-materials/7214>\
**Category:** General\
**Created:** [November 11, 2026, 4:15pm UTC](https://forum.gidsimulation.com/t/create-bch-in-macos-for-definition-y-assignation-of-materials/7214 "2026-11-11T16:15:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![AIPB](https://forum.gidsimulation.com/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@AIPB](https://forum.gidsimulation.com/u/AIPB)\
**Post date:** [November 11, 2026, 4:15pm UTC](https://forum.gidsimulation.com/t/create-bch-in-macos-for-definition-y-assignation-of-materials/7214/1 "2026-11-11T16:15:36Z")

</div>

I have tried various methods to define and assign materials for the Kratos problem via a `.bch` file, running GiD in `-n` or `-n2` mode.

GiD 18 freezes when I attempt to define the problem type, select the application, and specify the dimensions (2D or 3D). It seems that the selection windows remain active, preventing GiD from continuing its operation.

Could you please advise on how to resolve this issue? Additionally, what is the recommended method for defining and assigning materials, boundary conditions, and loads using a `.bch` file while running GiD in a headless (windowless) mode?

thanks

Alvaro

---

<div class="post-metadata">

**Author:** ![escolano](https://forum.gidsimulation.com/user_avatar/forum.gidsimulation.com/escolano/32/6_2.png) [@escolano](https://forum.gidsimulation.com/u/escolano)\
**Post date:** [November 12, 2026, 11:15am UTC](https://forum.gidsimulation.com/t/create-bch-in-macos-for-definition-y-assignation-of-materials/7214/2 "2026-11-12T11:15:04Z")

</div>

The answer depends on the Kratos application that you are using,

because each application decides how to store (name, parent, type,…) its own data in the customLib xml tree  
and each problemtype can define its own Tcl procs that can facilitate the access of these data.

In any case, to access to the customLib xml tree is necessary to use some Tcl code

and in a .bch file is possible to call Tcl code with the syntax

\*\*\*\*\*TCL and\_the\_tcl\_code  
You can have a look to the ‘examples’ provided in kratos, like (Fluid 2D)

“\problemtypes\kratos.gid\apps\Fluid\examples\CylinderInFlow.tcl”  
these examples usually create a simple geometry, and define its material properties and boundary conditions  
the Tcl code is something like this

set dom\_item [spdAux::getRoute “FLParts”]

set fluidNode [customlib::AddConditionGroupOnXPath $dom\_item MyPart]

set props [list Element Monolithic$nd ConstitutiveLaw Newtonian2DLaw DENSITY 1.0 DYNAMIC\_VISCOSITY 0.002]

spdAux::SetValuesOnBaseNode $dom\_item $props

This code assume that exists a GiD group named MyPart, and add to the tree a Part linked with this group, and set the material fields with some values

and from the bath can call each line with \*\*\*\*\*TCL or better create a proc with multiple commands and do a single \*\*\*\*\*TCL call to this proc

---

<div class="post-metadata">

**Author:** ![AIPB](https://forum.gidsimulation.com/letter_avatar_proxy/v4/letter/a/4af34b/32.png) [@AIPB](https://forum.gidsimulation.com/u/AIPB)\
**Post date:** [December 2, 2026, 8:16pm UTC](https://forum.gidsimulation.com/t/create-bch-in-macos-for-definition-y-assignation-of-materials/7214/3 "2026-12-02T20:16:33Z")

</div>

“Thank you very much for such a clear response. I’ll start implementing your recommendations right away.”
