createpart#

ENS_PART_FX_SEP_ATT.createpart(*args, **kwargs) Any#

Create a new dependent part

Create a new part using the attributes on a default part.

Args:
name:

The name of the new part to be created.

parent:

The (optional) object (case or group object) that should become the tree parent.

sources:

A list of objects that will become the computational parents of the new part.

record:

If set to a non-zero value, the operation should be journaled.

raw_defaults:

By default some part creation will use things like current tool locations to set up initial attributes. If set to a non-zero value, current ENS_TOOL settings will be ignored and the default part attributes used instead.

attributes:

Set to a list of attributes to be set and restored on the default part before/after the creation operation.

Returns:

The newly created part object.

Examples:
clip = ensight.objs.core.DEFAULTPARTS[ensight.PART_CLIP_PLANE]
attrs = []
attrs.append(['MESHPLANE', 1])
attrs.append(['TOOL', 9])
attrs.append(['VALUE', 0.55])
attrs.append(['DOMAIN', 0])
parent = ensight.objs.core.PARTS[2]
new_part = clip.createpart(name='Hello', sources=[parent], attributes=attrs)