User Tools

Site Tools


api:dk11:delphi:giseditor.tgis_editor.createshape_tgis_layerabstract_tgis_point3d_tgis_shapetype

Table of Contents

TGIS_Editor.CreateShape(TGIS_LayerAbstract; TGIS_Point3D; TGIS_ShapeType) method

DK11 for Delphi | GisEditor.TGIS_Editor.CreateShape | Overloads | Constructors | Methods | Properties | Events

Create and activate editing of a new shape.

Available also on: .NET | Java | ActiveX | Python.

Syntax

Implements IGIS_Editor.CreateShape.

// Delphi
public
  procedure CreateShape(
    const _layer : TGIS_LayerAbstract;
    const _ptg : TGIS_Point3D;
    const _type : TGIS_ShapeType
  ); overload;
// C++ Builder
public:
  void CreateShape(
    TGIS_LayerAbstract* const _layer,
    TGIS_Point3D* const _ptg,
    TGIS_ShapeType* const _type
  ) /* overload */;

Parameters

Name Type Description
_layer TGIS_LayerAbstract TGIS_Layer which will own new shape
_ptg TGIS_Point3D "starting" 3D of a new shape to be created; expected Viewer coordinate system
_type TGIS_ShapeType type of shape to be created; it must be type supported by layer; if TGIS_DimensionType.Unknown then shape of default type will be created

Example

Delphi

var
  editLayer   : TGIS_LayerAbstract ;
  GIS  : TGIS_ViewerWnd;
  ptg  : TGIS_Point3D ;
begin
 
  // Edit mode.
  if GIS.Mode = TGIS_ViewerMode.Edit then begin
    // If no layer is selected, then exit.
    if editLayer = nil then exit ;
    else begin
      // No shape is selected but we are in edit mode.
      // So the user wants to create a new shape.
      GIS.Editor.CreateShape( editLayer, ptg, TGIS_ShapeType.Unknown ) ;
 
      // Select a layer to snap to or nil to not use snapping.
      GIS.Editor.SnapLayer := nil ;
      editLayer := nil ;
    end ;
  end

References

2022/11/16 01:16

Page Tools