Overview

When you create a new RoseDesign, call stplib_put_schema() to identify how you want the file to be written. The schema control functions use the StplibSchemaType enum to identify APs. The stplib_schema_none value is used to indicate a design has just been created and not assigned an AP.

The following sample program creates a design containing a single cartesian point, some assignment instances, and some context objects, then writes it out using each supported schema. The links below show the resulting Part 21 files. Using these functions, you can create files described by any of the STEP APs using a single application.

#include <stp_schema.h>

void main()
{
    stplib_init();

    RoseDesign *d = new RoseDesign (foo);
    RoseObject * obj;

    // Some geometry, common across all APs
    obj = pnewIn(d) stp_cartesian_point;

    // These assignments will be written as cc_design types in AP203
    obj = pnewIn(d) stp_applied_approval_assignment;
    obj = pnewIn(d) stp_applied_certification_assignment;
    obj = pnewIn(d) stp_applied_contract_assignment;
    obj = pnewIn(d) stp_applied_date_and_time_assignment;
    obj = pnewIn(d) stp_applied_person_and_organization_assignment;
    obj = pnewIn(d) stp_applied_security_classification_assignment;
    obj = pnewIn(d) stp_applied_document_reference;

    // Some contexts will be written as subtypes in AP203 
    obj = pnewIn(d) stp_product_context;
    obj = pnewIn(d) stp_product_definition_context;

    // no ap, just step_merged_ap_schema
    d-> saveAs (test_default.stp);

    stplib_put_schema (d, stplib_schema_ap203);
    d-> saveAs (test_ap203.stp);

    stplib_put_schema (d, stplib_schema_ap203e2);
    d-> saveAs (test_ap203e2.stp);

    stplib_put_schema (d, stplib_schema_ap214);
    d-> saveAs (test_ap214.stp);

    stplib_put_schema (d, stplib_schema_ap242)
    d-> saveAs (test_ap242.stp);
}

The complete set of types are available to you, so it is possible to create files containing instances that are not appropriate for an AP, such as a non_manifold_surface_shape_representation in an AP203 file. To help, we have added a comment at the start of the EXPRESS definition if it is only supported by some of the APs.