//Must be on QueuedTask.Run(() => { ... List<Coordinate2D> plyCoords = new List<Coordinate2D>(); plyCoords.Add(new Coordinate2D(1, 1)); plyCoords.Add(new Coordinate2D(1.25, 2)); plyCoords.Add(new Coordinate2D(1.5, 1.1)); plyCoords.Add(new Coordinate2D(1.75, 2)); plyCoords.Add(new Coordinate2D(2, 1.1)); plyCoords.Add(new Coordinate2D(2.25, 2)); plyCoords.Add(new Coordinate2D(2.5, 1.1)); plyCoords.Add(new Coordinate2D(2.75, 2)); plyCoords.Add(new Coordinate2D(3, 1)); Polygon poly = PolygonBuilderEx.CreatePolygon(plyCoords); //Set symbolology, create and add element to layout CIMStroke outline = SymbolFactory.Instance.ConstructStroke( ColorFactory.Instance.BlackRGB, 2.0, SimpleLineStyle.Solid); CIMPolygonSymbol polySym = SymbolFactory.Instance.ConstructPolygonSymbol( ColorFactory.Instance.RedRGB, SimpleFillStyle.ForwardDiagonal, outline); ElementFactory.Instance.CreateGraphicElement( container, poly, polySym, "New Lasso");
Target Platforms: Windows 11, Windows 10