<< Click to Display Table of Contents > 

Client Control Interface Manual > Programming Examples > Create Entity > PolyLine

PolyLine
Previous pageReturn to chapter overviewNext page

Create polyline entity (ScPolyLine 2D)

 

//define the type of the new entity

cci.ScSetStringValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlStringValueTypeCreateEntity, "ScPolyLine2D");

 

//define start point at 0/0/0

cci.ScSetDoubleValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlDoubleValueTypeDoublePara1, 0); // x

cci.ScSetDoubleValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlDoubleValueTypeDoublePara2, 0); // y

cci.ScSetDoubleValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlDoubleValueTypeDoublePara3, 0); // z

 

//add point to polyline

cci.ScExecCommand((int)ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandAddPointToCreateEntityPolyline);

 

//define end point at 100/0/0

cci.ScSetDoubleValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlDoubleValueTypeDoublePara1, 100); // x

cci.ScSetDoubleValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlDoubleValueTypeDoublePara2, 0); // y

cci.ScSetDoubleValue((int)ScComSAMLightClientCtrlValueTypes.scComSAMLightClientCtrlDoubleValueTypeDoublePara3, 0); // z

 

//add point to polyline

cci.ScExecCommand((int)ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandAddPointToCreateEntityPolyline);

 

//add additional empty polyline in the polyline subchapter

cci.ScExecCommand((int)ScComSAMLightClientCtrlExecCommandConstants.scComSAMLightClientCtrlExecCommandAddPolylineToCreateEntityPolyline);

 

//create the entity of the type defined above, name it "MyEntity", apply pen = 3,

//position its center at(x | y | z) = (0 | 0 | 0) in the coordinate system,

//deactivate the definition of the dimension with dim_x = 0, dim_y = 0

cci.ScCreateEntity("MyEntity", "", 3, 0, 0, 0, 25, 15, 0, "");

Table 402: Create polyline entity (ScPolyLine 2D)