public class importexample {
static {
try {
System.loadLibrary("CadExCore");
System.loadLibrary("CadExSTEP");
} catch (UnsatisfiedLinkError e) {
System.err.println("Native code library failed to load.\n" + e);
System.exit(1);
}
}
public static void main(String[] args) {
String aKey = LicenseKey.Value();
if (!LicenseManager.Activate(aKey)) {
System.out.println("Failed to activate CAD Exchanger license.");
System.exit(1);
}
if (args.length != 2) {
System.out.println("Usage: " + " <input_file> <output_file>, where:");
System.out.println(" <input_file> is a name of the STEP file to be read ");
System.out.println(" <output_file> is a name of the XML file to Save() the model");
System.exit(1);
}
String aSource = args[0];
String aDest = args[1];
ModelData_Model aModel = new ModelData_Model();
STEP_Reader aReader = new STEP_Reader();
STEP_ReaderParameters aReaderParams = aReader.Parameters();
aReaderParams.SetPreferredBRepRepresentationType(STEP_ReaderParameters.BRepRepresentationType.AdvancedBRep);
if (!aReader.ReadFile(new Base_UTF16String(aSource))) {
System.out.println("Failed to read the file " + aSource);
System.exit(1);
}
if (!aReader.Transfer(aModel)) {
System.out.println("Failed to transfer the file " + aSource);
System.exit(1);
}
if (!new ModelData_ModelWriter().Write(aModel, new Base_UTF16String(aDest))) {
System.out.println("Failed to write the file " + aSource);
System.exit(1);
}
}
}
Defines classes, types, and global functions related to CAD Exchanger.
Definition: A3DSTestLib.hxx:22