//Must be on QueuedTask.Run(() => { ... //Build geometry Coordinate2D ll = new Coordinate2D(1.0, 4.75); Coordinate2D ur = new Coordinate2D(3.0, 5.75); Envelope env = EnvelopeBuilderEx.CreateEnvelope(ll, ur); //Set symbolology, create and add element to layout CIMStroke outline = SymbolFactory.Instance.ConstructStroke( ColorFactory.Instance.BlackRGB, 5.0, SimpleLineStyle.Solid); CIMPolygonSymbol polySym = SymbolFactory.Instance.ConstructPolygonSymbol( ColorFactory.Instance.GreenRGB, SimpleFillStyle.DiagonalCross, outline); var ge = GraphicFactory.Instance.CreateSimpleGraphic(env, polySym); var elemInfo = new ElementInfo() { Anchor = Anchor.CenterPoint, Rotation = 45.0, CornerRounding = 5.0 }; ElementFactory.Instance.CreateGraphicElement( container, env, polySym, "New Rectangle", false, elemInfo);
Target Platforms: Windows 11, Windows 10, Windows 8.1