---
name: "flattenphfig"
section: "3"
platform: "linux"
package: "alliance"
version: "5.1.1-3"
release: "Debian 10 (Buster)"
platforms: ["linux"]
url: "https://new.carta.tech/flattenphfig"
---

# flattenphfig(3)

flatten a instance in a figure

## NAME

flatenphfig - flatten a instance in a figure

## SYNOPSYS

```
#include "mph.h"
void flatenphfig(ptfig, insname, concat)
phfig_list ∗ptfig;
char ∗insname;
char concat;
```

## PARAMETERS

- *ptfig*

  Pointer to a physical figure

- *insname*

  Name of the instance to be flattened

- *concat*

  Name generation mode

## DESCRIPTION

**flatenphfig** flattens the instance called *insname* in the figure pointed to by *ptfig*. Flattening means incorporating the contents of the instance in the figure and removing it from its instance list.\
 the *concat* argument can take either the value **YES** in which case the name of the object comming from the instance are named *insname'X'objectname*, where *'X'* is the caracter set int the [**MBK\_SEPAR**(1)](/MBK_SEPAR/1.md) environment variable, or the value **NO**, and then the object name remains inchanged. This is quite dangerous since name unicity is no more warrantied, and may cause the flatten to fail. See **[MBK\_SEPAR(1)](/MBK_SEPAR/1.md)**, **[mbkenv(3)](/mbkenv/3.md)** and **[concatname(3)](/concatname/3.md)** for details.

## ERRORS

No errors can directly result from a call to **flatenphfig**, but since it uses many other mbk functions, it may be an error starting point.

## EXAMPLE

```
#include "mph.h"
void flatten_na2_y_s(ptfig)
phfig_list ∗ptfig;
{
phins_list ∗pt;
	for (pt = ptfig->PHINS; pt; pt = pt->NEXT) /∗ scan instance list ∗/
		if (!strcmp(pt->FIGNAME, "na2_y"))
			flatenphfig(ptfig, pt->INSNAME, NO);
}
```

## SEE ALSO

**mbk**(1), [**mbkenv**(3)](/mbkenv/3.md), [**phfig**(3)](/phfig/3.md), [**addphfig**(3)](/addphfig/3.md), [**getphfig**(3)](/getphfig/3.md), [**delphfig**(3)](/delphfig/3.md), [**loadphfig**(3)](/loadphfig/3.md), [**savephfig**(3)](/savephfig/3.md), **rflatenphfig**(3), [**MBK\_SEPAR**(1)](/MBK_SEPAR/1.md).
