---
title: "MODGEN and the erwin Script Client API | heureka e-Business GmbH"
canonical_url: "https://heureka.com/en/resources/blog/modgen-und-die-erwin-scapi"
last_updated: "2026-09-04T20:10:14.138Z"
meta:
  author: "heureka e-Business GmbH"
  description: "Core erwin SCAPI concepts: access levels, ModelObjects, property bags, transactions, and object identifiers used by MODGEN."
  "og:description": "Core erwin SCAPI concepts: access levels, ModelObjects, property bags, transactions, and object identifiers used by MODGEN."
  "og:title": "MODGEN and the erwin Script Client API"
  "twitter:description": "Core erwin SCAPI concepts: access levels, ModelObjects, property bags, transactions, and object identifiers used by MODGEN."
  "twitter:title": "MODGEN and the erwin Script Client API"
---

[Back to Resources](https://heureka.com/en/resources)

**Blog** 2019-01-29 2 min read Kevin Petri

# **MODGEN and the erwin Script Client API**

An overview of the erwin Script Client API and its use in automating data warehouse models with MODGEN.

heureka developed the MODGEN add-in for erwin to automate transformations in data warehouses. The version described at the time could generate a Data Vault model from a staging model. The erwin Script Client API (SCAPI) was indispensable to its development.

SCAPI is an extensive interface. It allows applications to create, open, and modify objects within a model, including tables, columns, and user-defined properties (UDPs).

## Access Levels

The API distinguishes several access levels. At the standard **SCD\_SL\_M0** level, applications can create, read, and write tables and columns. Simple properties can also be created and modified there.

Access to metadata and the ability to modify or delete UDPs require a session with elevated privileges at the **SCD\_SL\_M1** level.

## Persistence Units and Property Bags

Alongside persistence units, SCAPI provides property bags. They represent the properties of an object. In addition to a name and value, they contain useful flags. These indicate, for example, whether a value is null or scalar and whether a property is read-only.

![Class and interface model of the erwin Script Client API](https://heureka.com/media/resources/blog/scapi-model.gif)

*The SCAPI model connects persistence units, ModelObjects, collections, and properties.*

## ModelObject and ModelObjects

The most frequently used class is `ModelObject`. Tables and columns are examples of this class and can be accessed through the standard `SCD_SL_M0` level.

`ModelObjects`, in the plural, is a collection of `ModelObject` instances. It contains an enumerator that supports iteration. The `NewEnum` property references the `IEnumVARIANT` interface, whose `Next()`, `Skip()`, `Reset()`, and `Clone()` methods control the iteration sequence.

A `ModelObject` also has a `Properties` property. The collection can be iterated in full or used to address one specific property.

## Changes and Transactions

Changes to ModelObjects can be applied directly to the model. A transaction is opened before the objects are retrieved and committed after the required changes. Committing writes every change to the affected objects back to the corresponding erwin model.

Each object is classified by four identifiers:

- `SC_OBJID` identifies the specific object.
- `SC_CLSID` assigns the object to a class.
- `SC_MODELTYPEID` represents the model type.
- `SC_CREATORID` identifies the creator.

![SCAPI code example that modifies one property on every table](https://heureka.com/media/resources/blog/scapi-code-example.png)

*Example of iterating over tables and changing a property.*

The [erwin API Reference for version 9.8](https://bookshelf.quest.com/bookshelf/9.8.00/Bookshelf_Files/PDF/erwin_API_Ref.pdf) provides detailed information and further code examples.

## **Ready to move forward?**

Talk to our experts about your specific challenges. We provide honest assessments and actionable recommendations.

[Talk to Experts](https://heureka.com/en/contact)

**Practical implementation**

## **Turn this resource into an actionable next step**

Discuss your current situation with heureka. Together, we can clarify priorities, ownership, and the most useful place to start.

## **More resources you might like**

**Checklist ****· Exclusive**

### [ITSM Readiness Checklist](https://heureka.com/en/resources/checklists/itsm-readiness-checklist)

12 min read

[**Get the checklist → **](https://heureka.com/en/resources/checklists/itsm-readiness-checklist)

**Whitepaper ****· Exclusive**

### [AI Starts with Data Modelling: Why 'Model First' Matters More Than Ever](https://heureka.com/en/resources/whitepapers/ai-starts-with-data-modelling-model-first)

16 min read

[**Get the whitepaper → **](https://heureka.com/en/resources/whitepapers/ai-starts-with-data-modelling-model-first)

**Assessment **

### [Data Governance Maturity Assessment](https://heureka.com/en/resources/assessments/data-governance-maturity-assessment)

5 min

[**Start assessment → **](https://heureka.com/en/resources/assessments/data-governance-maturity-assessment)