SclCreateTrisolation
Overview
The SWA (Surpac Work Area) is where all String and DTM data processed by Surpac applications is stored. A complete description of the SWA can be found here.
The SclCreateTrisolation command creates a new trisolation, with a specified number, in a triobject and returns a handle to that trisolation for future operations on that trisolation. If a trisolation with the specified number already exists then the handle to that trisolation is returned and the trisolation is not modified in any way.
Synopsis
$TriobjectHandle SclCreateTrisolation TrisolationHandle $TrisolationNumber
Description
Create a trisolation with the specified number in the specified triobject and return the handle to that trisolation for later use by other Scl commands. If a trisolation with the number specified already exists then just return the handle to the trisolation without modifying it in any way.
Arguments
- TriobjectHandle
- TrisolationHandle
- TrisolationPosition
This is the handle to the triobject in which the trisolation is to be created. The triobject handle must have previously been obtained by using SclCreateTriobject or SclIterateNext to obtain the handle to an existing triobject from the set of triobjects in a SWA.
Passed by reference. This is the variable to which the trisolation handle is assigned. This trisolation handle must be used in later references to the trisolation for adding, deleting or modifying triangles in the trisolation.
Passed by value. This is the identifying number that is to be used for the trisolation. The trisolation number must be an integer > 0. If a trisolation already exists with the specified identifying number in the triobject then the handle to that trisolation is returned and the trisolation is not modified.
Examples
# # create a triobject with 2 trisolations with one triangle each # and then save the string and DTM files and finally destroy the swa # SclCreateSwa SwaHandle "temporary swa" $SwaHandle SclCreateString StringHandle 1 $StringHandle SclCreateSegment SegmentHandle 0 $SegmentHandle SclCreatePoint PointHandle1 0 # points for the first triangle $PointHandle1 SclSetValueByName x 0.0 $PointHandle1 SclSetValueByName y 0.0 $PointHandle1 SclSetValueByName z 0.0 $SegmentHandle SclCreatePoint PointHandle2 1 $PointHandle2 SclSetValueByName x 0.0 $PointHandle2 SclSetValueByName y 2.0 $PointHandle2 SclSetValueByName z 0.0 $SegmentHandle SclCreatePoint PointHandle3 2 $PointHandle3 SclSetValueByName x 2.0 $PointHandle3 SclSetValueByName y 0.0 $PointHandle3 SclSetValueByName z 0.0 # points for the second triangle $SegmentHandle SclCreatePoint PointHandle4 3 $PointHandle4 SclSetValueByName x 10.0 $PointHandle4 SclSetValueByName y 10.0 $PointHandle4 SclSetValueByName z 0.0 $SegmentHandle SclCreatePoint PointHandle5 4 $PointHandle5 SclSetValueByName x 11.0 $PointHandle5 SclSetValueByName y 12.0 $PointHandle5 SclSetValueByName z 0.0 $SegmentHandle SclCreatePoint PointHandle6 5 $PointHandle6 SclSetValueByName x 12.0 $PointHandle6 SclSetValueByName y 10.0 $PointHandle6 SclSetValueByName z 0.0 $SwaHandle SclCreateTriobject TriobjectHandle 1 $TriobjectHandle SclCreateTrisolation TrisolationHandle 1 $TrisolationHandle SclCreateTriangle TriangleHandle 1 $TriangleHandle SclSetValueByName v0 $PointHandle1 $TriangleHandle SclSetValueByName v1 $PointHandle2 $TriangleHandle SclSetValueByName v2 $PointHandle3 $SwaHandle SclCreateTriobject TriobjectHandle 1 $TriobjectHandle SclCreateTrisolation TrisolationHandle 2 $TrisolationHandle SclCreateTriangle TriangleHandle 1 $TriangleHandle SclSetValueByName v0 $PointHandle4 $TriangleHandle SclSetValueByName v1 $PointHandle5 $TriangleHandle SclSetValueByName v2 $PointHandle6 $SwaHandle SclSwaSaveDtmFile test1.str SclDestroy SwaHandle puts "Object 1 created with 2 trisolations with one triangle each" puts "and saved to test1.str & test1.dtm" |
See Also
SclSwaExists
SclCreateString
SclCreateSegment
SclCreatePoint
SclCreateTriobject
SclDestroy
SclSwaSaveDtmFile
SclSwaSaveStringFile
SclSwaOpenFile
sclSwas