OpenCascade.js
API ReferenceDataExchangeTKDESTEP

STEPControl

OCCT package STEPControl: STEPControl_ActorRead, STEPControl_ActorWrite, STEPControl_Controller, STEPControl_Reader, and 2 more bound classes.

STEPControl_ActorRead

This class performs the transfer of an Entity from AP214 and AP203, either Geometric or Topologic.
I.E. for each type of Entity, it invokes the appropriate Tool then returns the Binder which contains the Result

Constructors(1)

Static methods(2)

Instance methods(9)

STEPControl_ActorWrite

This class performs the transfer of a Shape from TopoDS to AP203 or AP214 (CD2 or DIS).

Constructors(1)

Static methods(2)

Instance methods(12)

STEPControl_Controller

defines basic controller for STEP processor

Constructors(1)

Static methods(3)

Instance methods(5)

STEPControl_Reader

Reads STEP files, checks them and translates their contents into Open CASCADE models. The STEP data can be that of a whole model or that of a specific list of entities in the model. As in XSControl_Reader, you specify the list using a selection.
For the translation of iges files it is possible to use next sequence: To change translation parameters class Interface_Static should be used before beginning of translation (see STEP Parameters and General Parameters) Creation of reader - STEPControl_Reader reader; To load s file in a model use method reader.ReadFile("filename.stp") To print load results reader.PrintCheckLoad(failsonly,mode) where mode is equal to the value of enumeration IFSelect_PrintCount For definition number of candidates : int nbroots = reader. NbRootsForTransfer(); To transfer entities from a model the following methods can be used: for the whole model - reader.TransferRoots(); to transfer a list of entities: reader.TransferList(list); to transfer one entity occ::handle<Standard_Transient> ent = reader.RootForTransfer(num); reader.TransferEntity(ent), or reader.TransferOneRoot(num), or reader.TransferOne(num), or reader.TransferRoot(num) To
obtain the result the following method can be used: reader.NbShapes() and reader.Shape(num); or reader.OneShape(); To print the results of transfer use method: reader.PrintCheckTransfer(failwarn,mode); where printfail is equal to the value of enumeration IFSelect_PrintFail, mode see above; or reader.PrintStatsTransfer(); Gets correspondence between a STEP entity and a result shape obtained from it. occ::handle<XSControl_WorkSession> WS = reader.WS(); if ( WS->TransferReader()->HasResult(ent) ) TopoDS_Shape shape = WS->TransferReader()->ShapeResult(ent);.

Constructors(2)

Instance methods(6)

  • ReadFile(filename: string): IFSelect_ReturnStatus

    Loads a file and returns the read status Zero for a Model which compies with the Controller.

    Parameters (1)
    • filename
  • TransferRoot(num?: number, theProgress?: Message_ProgressRange): boolean

    Transfers a root given its rank in the list of candidate roots Default is the first one Returns True if a shape has resulted, false else Same as inherited TransferOneRoot, kept for compatibility.

    Parameters (2)
    • num
    • theProgress
  • Determines the list of root entities from Model which are candidate for a transfer to a Shape (type of entities is PRODUCT).

  • Returns sequence of all unit names for shape representations found in file.

    Parameters (3)
    • theUnitLengthNames
      Mutated in place; read the updated value from this argument after the call.
    • theUnitAngleNames
      Mutated in place; read the updated value from this argument after the call.
    • theUnitSolidAngleNames
      Mutated in place; read the updated value from this argument after the call.
  • SetSystemLengthUnit(theLengthUnit: number): void

    Sets system length unit used by transfer process. Performs only if a model is not NULL.

    Parameters (1)
    • theLengthUnit
  • Returns system length unit used by transfer process. Performs only if a model is not NULL.

STEPControl_StepModelType

Properties(8)

STEPControl_Writer

This class creates and writes STEP files from Open CASCADE models. A STEP file can be written to an existing STEP file or to a new one. Translation can be performed in one or several operations. Each translation operation outputs a distinct root entity in the STEP file.

Constructors(2)

Instance methods(12)

  • Unsets the tolerance formerly forced by SetTolerance.

  • SetWS(WS: XSControl_WorkSession, scratch?: boolean): void

    Sets a specific session to <me>.

    Parameters (2)
    • WS
    • scratch
  • Returns the session used in <me>.

  • Model(newone?: boolean): StepData_StepModel

    Returns the produced model. Produces a new one if not yet done or if <newone> is True This method allows for instance to edit product or header data before writing.

    Parameters (1)
    • newone
  • Translates shape sh to a STEP entity. mode defines the STEP entity type to be output:

    • STEPControlStd_AsIs translates a shape to its highest possible STEP representation.
    • STEPControlStd_ManifoldSolidBrep translates a shape to a STEP manifold_solid_brep or brep_with_voids entity.
    • STEPControlStd_FacetedBrep translates a shape into a STEP faceted_brep entity.
    • STEPControlStd_ShellBasedSurfaceModel translates a shape into a STEP shell_based_surface_model entity.
    • STEPControlStd_GeometricCurveSet translates a shape into a STEP geometric_curve_set entity.
    Parameters (4)
    • sh
    • mode
    • compgraph
    • theProgress
  • Write(theFileName: string): IFSelect_ReturnStatus

    Writes a STEP model in the file identified by filename.

    Parameters (1)
    • theFileName
  • PrintStatsTransfer(what: number, mode?: number): void

    Displays the statistics for the last translation. what defines the kind of statistics that are displayed:

    • 0 gives general statistics (number of translated roots, number of warnings, number of fail messages),
    • 1 gives root results,
    • 2 gives statistics for all checked entities,
    • 3 gives the list of translated entities,
    • 4 gives warning and fail messages,
    • 5 gives fail messages only. mode is used according to the use of what. If what is 0, mode is ignored. If what is 1, 2 or 3, mode defines the following:
    • 0 lists the numbers of STEP entities in a STEP model,
    • 1 gives the number, identifier, type and result type for each STEP entity and/or its status (fail, warning, etc.),
    • 2 gives maximum information for each STEP entity (i.e. checks),
    • 3 gives the number of entities by the type of a STEP entity,
    • 4 gives the number of of STEP entities per result type and/or status,
    • 5 gives the number of pairs (STEP or result type and status),
    • 6 gives the number of pairs (STEP or result type and status) AND the list of entity numbers in the STEP model.
    Parameters (2)
    • what
    • mode
  • Sets parameters for shape processing.

    Parameters (1)
    • theParameters
      the parameters for shape processing.
  • Returns parameters for shape processing that was set by SetParameters() method.

    Returns

    the parameters for shape processing. Empty map if no parameters were set.

  • SetShapeProcessFlags(theFlags: any): void

    Sets flags defining operations to be performed on shapes.

    Parameters (1)
    • theFlags
      The flags defining operations to be performed on shapes.
  • GetShapeProcessFlags(): [any, boolean]

    Returns flags defining operations to be performed on shapes.

    Returns

    Pair of values defining operations to be performed on shapes and a boolean value that indicates whether the flags were set.