```
int addprim(const int geohandle, const string type)
```

```
int addprim(const int geohandle, const string type, const int pt0)
```

```
int addprim(const int geohandle, const string type, const int pt0, const int pt1)
```

```
int addprim(const int geohandle, const string type, const int pt0, const int pt1, const int pt2)
```

```
int addprim(const int geohandle, const string type, const int pt0, const int pt1, const int pt2, const int pt3)
```

```
int addprim(const int geohandle, const string type, const int points[])
```

```
int addprim(const int geohandle, const string type, const int pt0, int vertices[])
```

```
int addprim(const int geohandle, const string type, const int pt0, const int pt1, int vertices[])
```

```
int addprim(const int geohandle, const string type, const int pt0, const int pt1, const int pt2, int vertices[])
```

```
int addprim(const int geohandle, const string type, const int pt0, const int pt1, const int pt2, const int pt3, int vertices[])
```

```
int addprim(const int geohandle, const string type, const int points[], int vertices[])
```

Creates a primitive in the geometry specified by `geohandle`

. The returned value is a primitive number that can be used with the setprimattrib() to set attribute values of the primitive, but is *not* the final primitive number of the primitive. It returns -1 on failure.

If any point numbers are specified, vertices will be added to the new primitive. This is necessary for tetrahedra, spheres, circles, and tubes. If a `vertices`

array is given, it will be filled with numbers of those vertices for use with setvertexattrib(), but these are *not* the final vertex numbers of the vertices. If the primitive was created, but any points are not valid, the corresponding numbers in `vertices`

may be -1.

`type`

can be:

`"poly"`

Closed polygon.

`"polyline"`

Open polygon.

`"tet"`

Tetrahedron primitive. This requires exactly 4 valid points to be specified. addvertex() cannot be called on this primitive.

`"sphere"`

, `"circle"`

, `"tube"`

, `"metaball"`

, `"metasquad"`

Sphere, circle, tube, metaball, or metasuperquadric primitive. These require exactly 1 valid point to be specified. addvertex() cannot be called on these primitives. Their transforms can be set using setprimintrinsic(), e.g. `setprimintrinsic(geoself(), "transform", prim, transform_value);`

, where transform_value is a `matrix3`

.

`"AlembicRef"`

, `"PackedDisk"`

Packed Alembic or packed disk primitive. These require exactly 1 valid point to be specified. addvertex() cannot be called on these primitives. Their intrinsics can be set using setprimintrinsic(), e.g. `setprimintrinsic(geoself(), "unexpandedfilename", prim, "test.bgeo");`

for a packed disk primitive.

See also |