Construction (hwx.inspire.Construction)#

class Construction#

Bases: Sequence

Sequence of construction history steps.

When you create, modify, move, or delete geometry in your model, or group parts together, Inspire records the action in your model’s construction history.

Steps can be accessed by index, name or slice:

model.construction[-1] model.construction[‘PushPull 1’] for cf in model.construction[3:5]:

cf.suppress()

del model.construction[:]

Attribute Table#

Name

Type

current

property

currentIndex

property

currentStep

property

Method Table#

Name

Description

delete (self, index)

Removes the construction feature from the model.

getCF (self, name)

Get construction feature by name.

getCFs (self, part)

Returns all the CFs associated with given part from construction history.

roll (self, steps)

Move forward or backward through construction history.

rollTo (self, index)

Move to specified feature in construction history.

suppress (self, index)

Suppress allows you to see your model as if the construction feature had

unsuppress (self, index)

See suppress.

property current#

(cf.CF) Last executed construction feature.

None if the model is empty.

Equivalent to model.construction[-1] if user never rolled back.

property currentIndex#

(int) Index of last executed construction feature.

Matches the index shown in the gui:
  • 0 corresponds to an empty model.

  • len(construction) is rolled to the end.

property currentStep#

(int) Index of last executed construction feature.

Matches the index shown in the gui:
  • 0 corresponds to an empty model.

  • len(construction) is rolled to the end.

getCF(name)#

Get construction feature by name.

Equivalent to __getitem__.

Parameters:

name (str) –

Returns:

hwx.inspire.cf.CF

roll(steps)#

Move forward or backward through construction history.

Parameters:

steps (int) – Number of steps to move forward or backward from the currentIndex.

rollTo(index)#

Move to specified feature in construction history.

Parameters:

index (int | str) –

Step to roll to.

0 -> Before first step.

-1 -> After last step. Or pass the cf name.

suppress(index)#

Suppress allows you to see your model as if the construction feature had not been created.

Equivalent to model.construction[index].suppress().

Parameters:

index (int) – Index of the construction history feature to suppress.

unsuppress(index)#

See suppress.

Equivalent to model.construction[index].unsuppress().

delete(index)#

Removes the construction feature from the model.

Equivalent to: del model.construction[index]

Parameters:

index (int | str | slice) –

getCFs(part)#

Returns all the CFs associated with given part from construction history.

Parameters:

part (Part) – Part to get all the CFs associated with it.