SaveModel
Syntax
public const string enginedll = @"engine.dll"; [DllImport(enginedll, EntryPoint = "SaveModel")] public static extern Int64 SaveModel(Int64 model, string fileName); [DllImport(enginedll, EntryPoint = "SaveModel")] public static extern Int64 SaveModel(Int64 model, byte[] fileName);
Property model
Size: 64 bit / 8 byte (value)Property fileName
Size: 64 bit / 8 byte (reference)
Example (based on pure API calls)
Here you can find code snippits that show how the API call SaveModel can be used.
using RDF; // include at least engine.cs within your solution ... static void Main(string[] args) { Int64 model = RDF.engine.CreateModel(); if (model) { // // Classes // Int64 classCone = RDF.engine.GetClassByName(model, "Cone"); // // Datatype Properties (attributes) // Int64 propertyHeight = RDF.engine.GetPropertyByName(model, "height"), propertyRadius = RDF.engine.GetPropertyByName(model, "radius"), propertySegmentationParts = RDF.engine.GetPropertyByName(model, "segmentationParts"); // // Instances // Int64 myInstanceCone = RDF.engine.CreateInstance(classCone, (string) null); double height = 2.8, radius = 1.3; Int64 segmentationParts = 36; RDF.engine.SetDatatypeProperty(myInstanceCone, propertyHeight, ref height, 1); RDF.engine.SetDatatypeProperty(myInstanceCone, propertyRadius, ref radius, 1); RDF.engine.SetDatatypeProperty(myInstanceCone, propertySegmentationParts, ref segmentationParts, 1); // // The resulting model can be viewed in 3D-Editor.exe // RDF.engine.SaveModel(model, System.Text.Encoding.ASCII.GetBytes("c:\\created\\myFile.bin")); // // In case it is sure the individual characters within the string are ASCII we can ignore the encoding translation. // RDF.engine.SaveModel(model, "c:\\created\\sameMyFile.bin"); RDF.engine.CloseModel(model); } }