1 shape_edit> include "filename.scl";SCL files save the "model" as unevaluated symbolic commands and using the include command causes the evaluation and reconstruction of the model data. To save evaluated data, use the binary input and output functions described in the following section.
saveModel( ObjArray, FileName )Files written with saveModel can also be used with Alpha_1 programs other than c_shape_edit. Other programs will only recognize the "top level" models in the array that were saved and not any of the prerequisites. This is an inefficient use of files since large amounts of dependency information is present, but ignored.
- Returns
- <null> Saves the array of models, all models that are prerequisite, and all related dependency (graph) information into the named file.
- ObjArray
- <array> Array of models.
- FileName
- <string> Name of the file to write. This is a binary Alpha_1 file and should use the .a1 file name extension.
Two other output functions exist for more efficient interfacing to other Alpha_1 programs. The dumpA1File function saves the underlying objects (features, geometry, etc.) without any modeling, or dependency information. The names of the model objects are passed on to the underlying objects.
dumpA1File( ObjArray, FileName )The dumpGeomFile function is similar to dumpA1File but further converts the output to strictly geometric objects by converting features and high-level objects in geometric objects. This is a temporary solution while other Alpha_1 programs catch up and understand these high-level features.
- Returns
- <string> Saves the underlying objects associated with each model into the named file.
- ObjArray
- <array> Array of models.
- FileName
- <string> Name of the file to write. This is a binary Alpha_1 file and should use the .a1 file name extension.
dumpGeomFile( ObjArray, FileName )The input function is called restoreModel. This function performs a variety of tasks depending on the contents of the file and the current state of the running c_shape_edit.
- Returns
- <string> Saves the geometric representation associated with each model into the named file.
- ObjArray
- <array> Array of models.
- FileName
- <string> Name of the file to write. This is a binary Alpha_1 file and should use the .a1 file name extension.
restoreModel( FileName )The file may contain model objects with dependency graph information, or high-level features, geometry, etc. not embedded in dependency graphs or both. In the latter case, each object is wrapped in a model object with no prerequisites and given the name of the object read in. An array of all the new model objects is returned so they can be named or renamed as the case may be.
- Returns
- <array> Read the named file of models. Returns an array of all the models read in.
- FileName
- <string> Name of file to read.
Another function performed by restoreModel is name conflict resolution. When an object restored has the same name as an object in the running c_shape_edit, it is assumed that the new object from the file is to be used. In these cases, the dependency graphs are merged by updating the existing object with the new object and its prerequisites, merging the dependents of both, and propagating the changes.
renameObj( Obj, Name )To name unnamed objects or rename objects read in with restore model, the renameObj function can be used. Assign the return value of restoreModel to a variable and then change the name of any of the objects in the array:
- Returns
- <null>
- Obj
- <model_obj> The model object to rename.
- Name
- <string> The new name.
NewModels : restoreModel( "my_models.scl.a1" ); # Rename third object. renameObj( NewModels[2], "MyModelName" ); # Check it out. MyModelName;Files are read from and written to the current directory unless a full pathname is provided. The current directory is modified with the cd function.
cd( PathName )The current directory is echoed by the pwd function.
- Returns
- <string> Change the current directory. Returns the new current directory name, if operation is successful.
- PathName
- <string> Absolute path name or path relative to the current directory.
pwd()
- Returns
- <null> Prints the current directory.