OpenCascade.js
API ReferenceDataExchangeTKDESTEP

STEPConstruct

OCCT package STEPConstruct: STEPConstruct, STEPConstruct_AP203Context, STEPConstruct_Assembly, STEPConstruct_ContextTool, and 7 more bound classes.

STEPConstruct

Defines tools for creation and investigation STEP constructs used for representing various kinds of data, such as product and assembly structure, unit contexts, associated information The creation of these structures is made according to currently active schema (AP203 or AP214 CD2 or DIS) This is taken from parameter write.step.schema.

Constructors(1)

Static methods(4)

STEPConstruct_AP203Context

Maintains context specific for AP203 (required data and management information such as persons, dates, approvals etc.) It contains static entities (which can be shared), default values for person and organisation, and also provides tool for creating management entities around specific part (SDR).

Constructors(1)

Instance methods(34)

STEPConstruct_Assembly

This operator creates and checks an item of an assembly, from its basic data : a ShapeRepresentation, a Location ...
Three ways of coding such item from a ShapeRepresentation :

  • do nothing : i.e. information for assembly are ignored
  • create a MappedItem
  • create a RepresentationRelationship (WithTransformation)

Constructors(1)

Instance methods(5)

STEPConstruct_ContextTool

Maintains global context tool for writing. Gives access to Product Definition Context (one per Model) Maintains ApplicationProtocolDefinition entity (common for all products) Also maintains context specific for AP203 and provides set of methods to work with various STEP constructs as required by Actor.

Constructors(2)

Instance methods(28)

STEPConstruct_ExternRefs

Provides a tool for analyzing (reading) and creating (writing) references to external files in STEP.
It maintains a data structure in the form of sequences of relevant STEP entities (roots), allowing either to create them by convenient API, or load from existing model and investigate

Constructors(2)

Instance methods(13)

  • Initializes tool; returns True if succeeded.

    Parameters (1)
    • WS
  • Clear(): void

    Clears internal fields (list of defined extern refs).

  • LoadExternRefs(): boolean

    Searches current STEP model for external references and loads them to the internal data structures NOTE: does not clear data structures before loading.

  • NbExternRefs(): number

    Returns number of defined extern references.

  • FileName(num: number): string

    Returns filename for numth extern reference Returns Null if FileName is not defined or bad.

    Parameters (1)
    • num
  • Returns ProductDefinition to which numth extern reference is associated. Returns Null if cannot be detected or if extern reference is not associated to SDR in a proper way.

    Parameters (1)
    • num
  • Returns DocumentFile to which numth extern reference is associated. Returns Null if cannot be detected.

    Parameters (1)
    • num
  • Returns format identification string for the extern document Returns Null handle if format is not defined.

    Parameters (1)
    • num
  • AddExternRef(filename: string, PD: StepBasic_ProductDefinition, format: string): number

    Create a new external reference with specified attributes attached to a given SDR <format> can be Null string, in that case this information is not written. Else, it can be "STEP AP214" or "STEP AP203" Returns index of a new extern ref.

    Parameters (3)
    • filename
    • PD
    • format
  • Check (create if it is null) all shared entities for the model.

  • WriteExternRefs(num: number): number

    Adds all the currently defined external refs to the model Returns number of written extern refs.

    Parameters (1)
    • num
  • Set the ApplicationProtocolDefinition of the PDM schema.

    Parameters (1)
    • APD
  • Returns the ApplicationProtocolDefinition of the PDM schema NOTE: if not defined then create new APD with new Application Context.

STEPConstruct_Part

Provides tools for creating STEP structures associated with part (SDR), such as PRODUCT, PDF etc., as required by current schema Also allows to investigate and modify this data.

Constructors(1)

Instance methods(43)

STEPConstruct_RenderingProperties

Class for working with STEP rendering properties. Provides functionality to create and manipulate rendering properties used for specifying visual appearance in STEP format. This class handles both parsing of STEP entities and creation of new ones.

Constructors(7)

Instance methods(29)

STEPConstruct_Styles

Provides a mechanism for reading and writing shape styles (such as color) to and from the STEP file This tool maintains a list of styles, either taking them from STEP model (reading), or filling it by calls to AddStyle or directly (writing). Some methods deal with general structures of styles and presentations in STEP, but there are methods which deal with particular implementation of colors (as described in RP).

Constructors(2)

Static methods(3)

Instance methods(17)

STEPConstruct_Tool

Provides basic functionalities for tools which are intended for encoding/decoding specific STEP constructs.
It is initialized by WorkSession and allows easy access to its fields and internal data such as Model, TP and FP
NOTE: Call to method Graph() with True (or for a first time, if you have updated the model since last computation of model) can take a time, so it is recommended to avoid creation of this (and derived) tool multiple times

Constructors(2)

Instance methods(3)

STEPConstruct_UnitContext

Tool for creation (encoding) and decoding (for writing and reading accordingly) context defining units and tolerances (uncerntanties).

Constructors(1)

Static methods(1)

Instance methods(19)

STEPConstruct_ValidationProps

This class provides tools for access (write and read) the validation properties on shapes in the STEP file. These are surface area, solid volume and centroid.

Constructors(2)

Instance methods(15)

  • Load worksession; returns True if succeeded.

    Parameters (1)
    • WS
  • AddProp(Shape: TopoDS_Shape, Prop: StepRepr_RepresentationItem, Descr: string, instance: boolean): boolean

    General method for adding (writing) a validation property for shape which should be already mapped on writing itself. It uses FindTarget() to find target STEP entity resulting from given shape, and associated context Returns True if success, False in case of fail.

    Parameters (4)
    • Shape
    • Prop
    • Descr
    • instance
  • General method for adding (writing) a validation property for shape which should be already mapped on writing itself. It takes target and Context entities which correspond to shape Returns True if success, False in case of fail.

    Parameters (4)
    • target
    • Context
    • Prop
    • Descr
  • AddArea(Shape: TopoDS_Shape, Area: number): boolean

    Adds surface area property for given shape (already mapped). Returns True if success, False in case of fail.

    Parameters (2)
    • Shape
    • Area
  • AddVolume(Shape: TopoDS_Shape, Vol: number): boolean

    Adds volume property for given shape (already mapped). Returns True if success, False in case of fail.

    Parameters (2)
    • Shape
    • Vol
  • AddCentroid(Shape: TopoDS_Shape, Pnt: gp_Pnt, instance?: boolean): boolean

    Adds centroid property for given shape (already mapped). Returns True if success, False in case of fail If instance is True, then centroid is assigned to an instance of component in assembly.

    Parameters (3)
    • Shape
    • Pnt
    • instance
  • FindTarget(S: TopoDS_Shape, target: StepRepr_CharacterizedDefinition, instance: boolean): { returnValue: boolean; Context: StepRepr_RepresentationContext; [Symbol.dispose](): void }

    Finds target STEP entity to which validation props should be assigned, and corresponding context, starting from shape Returns True if success, False in case of fail.

    Parameters (3)
    • S
    • target
      Mutated in place; read the updated value from this argument after the call.
    • instance
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • Context: owned by the returned envelope.
      Dispose the returned envelope to release owned Handle fields.
  • Searches for entities of the type PropertyDefinitionRepresentation in the model and fills the sequence by them.

    Parameters (1)
    • seq
      Mutated in place; read the updated value from this argument after the call.
  • Returns CDSR associated with given PpD or NULL if not found (when, try GetPropSDR).

    Parameters (1)
    • PD
  • Returns SDR associated with given PpD or NULL if not found (when, try GetPropCDSR).

    Parameters (1)
    • PD
  • Returns Shape associated with given SDR or Null Shape if not found.

    Parameters (1)
    • ProdDef
  • Returns Shape associated with given PpD or Null Shape if not found.

    Parameters (1)
    • PD
  • GetPropReal(item: StepRepr_RepresentationItem, Val: number, isArea: boolean, theLocalFactors: StepData_Factors): { returnValue: boolean; Val: number; isArea: boolean }

    Returns value of Real-Valued property (Area or Volume) If Property is neither Area nor Volume, returns False Else returns True and isArea indicates whether property is area or volume.

    Parameters (4)
    • item
    • Val
    • isArea
    • theLocalFactors
    Returns

    A result object with fields:

    • returnValue: the C++ return value
    • Val: updated value from the call.
    • isArea: updated value from the call.
  • Returns value of Centroid property (or False if it is not).

    Parameters (4)
    • item
    • Context
    • Pnt
      Mutated in place; read the updated value from this argument after the call.
    • theLocalFactors
  • Sets current assembly shape SDR (for FindCDSR calls).

    Parameters (1)
    • shape