# How to plot set of elements in cgx

**URL:** <https://calculix.discourse.group/t/how-to-plot-set-of-elements-in-cgx/3762>\
**Category:** CalculiX GraphiX\
**Created:** [February 2, 2026, 8:58am UTC](https://calculix.discourse.group/t/how-to-plot-set-of-elements-in-cgx/3762 "2026-02-02T08:58:17Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![k3rrig4n](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@k3rrig4n](https://calculix.discourse.group/u/k3rrig4n)\
**Post date:** [February 2, 2026, 8:58am UTC](https://calculix.discourse.group/t/how-to-plot-set-of-elements-in-cgx/3762/1 "2026-02-02T08:58:17Z")

</div>

Hi.

I have a body that is divided into grains (I used Neper and then Neper2Abaqus). Those grains are basically just sets of elements. Here is an example of one such grain:

```auto
*Elset, Elset=poly1
570, 635, 636, 637, 700, 701, 702, 765, 766, 767, 830, 831, 832, 894, 895, 896, 
959, 960, 2000, 2065, 2066, 2067, 2130, 2131, 2132, 2195, 2196, 2197, 2260, 2261, 2262, 2324, 
2325, 2326, 2389, 2390

```

So my question is: is there a way to plot that set (for example `poly1` ) in CGX? I tried something but it didn’t work (every time it says that `plot: set:poly1 does not exist` ). Are these sets even saved in the output file?

---

<div class="post-metadata">

**Author:** ![rsmith](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/rsmith/32/1684_2.png) [@rsmith](https://calculix.discourse.group/u/rsmith)\
**Post date:** [February 2, 2026, 7:46pm UTC](https://calculix.discourse.group/t/how-to-plot-set-of-elements-in-cgx/3762/2 "2026-02-02T19:46:26Z")

</div>

To start with, make sure you read the sets in question into the `cgx` session.

```
read poly1.nam inp

```

For the first set, `plot e poly1 r` should plot the elements in `poly1` in red. Use `plus` for additional sets.

An example from my own files:

```auto
# Read the mesh and sets.
read all.msh inp
read fix1.nam inp
read fix2.nam inp
read load.sur inp
read bl.nam inp
read tl.nam inp
read p1.nam inp
read p2.nam inp
read core.nam inp

# Show the elements with specific colors.
plot e Etl g
plus e Ebl b
plus e Ep1 n
plus e Ep2 n
plus e Ecore y

```

---

<div class="post-metadata">

**Author:** ![k3rrig4n](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@k3rrig4n](https://calculix.discourse.group/u/k3rrig4n)\
**Post date:** [February 3, 2026, 3:49am UTC](https://calculix.discourse.group/t/how-to-plot-set-of-elements-in-cgx/3762/3 "2026-02-03T03:49:19Z")

</div>

how can i create these .nam files? Is there a way to create them for all grains automatically?

---

<div class="post-metadata">

**Author:** ![rsmith](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/rsmith/32/1684_2.png) [@rsmith](https://calculix.discourse.group/u/rsmith)\
**Post date:** [February 3, 2026, 8:10pm UTC](https://calculix.discourse.group/t/how-to-plot-set-of-elements-in-cgx/3762/4 "2026-02-03T20:10:41Z")

</div>

That depends on the preprocessor you use.

I tend to use `cgx` to define geometry and meshes.  
Mainly because it is pretty good at creating regular hex meshes.  
In this case, creating the `.nam` files is easy:

```auto
send <setname> abq nam

```

Having taken a quick look at the documentation for `Neper`, it seems like you need to use the `-elset` option when using its meshing module.

---

<div class="post-metadata">

**Author:** ![k3rrig4n](https://avatars.discourse-cdn.com/v4/letter/k/58f4c7/32.png) [@k3rrig4n](https://calculix.discourse.group/u/k3rrig4n)\
**Post date:** [February 4, 2026, 7:43am UTC](https://calculix.discourse.group/t/how-to-plot-set-of-elements-in-cgx/3762/5 "2026-02-04T07:43:38Z")

</div>

Thank for the advise. I’ll try to do that. Also can you send an example of that .nam file?

---

<div class="post-metadata">

**Author:** ![rsmith](https://yyz2.discourse-cdn.com/free1/user_avatar/calculix.discourse.group/rsmith/32/1684_2.png) [@rsmith](https://calculix.discourse.group/u/rsmith)\
**Post date:** [February 6, 2026, 4:57pm UTC](https://calculix.discourse.group/t/how-to-plot-set-of-elements-in-cgx/3762/6 "2026-02-06T16:57:42Z")

</div>

A `.nam` file as generated by `cgx` is essentially:

```auto
** Names based on p1
*NSET,NSET=Np1 
3, 
4, 
5, 
6, 
7, 
8, 
** more node numbers, one per line...
78429, 
*ELSET,ELSET=Ep1 
1, 
2, 
3, 
4, 
5, 
6, 
7, 
** more element numbers, one per line...

```
