Moving VBA Application to c# - AutoCADEntity Array
I'm trying to bringt this VBA code to c#:
Dim Segments(1 To 12) As AcadEntity Dim MP1 Dim P1, P2 '1. set center point MP1 MP1 = ThisDrwaing.Utility.PolarPoint(EP, radians(90), D2half + radius) '2. draw an arc with given Values and add it to Segments array position 1 Set Segmente(1) = ThisDrawing.ModelSpace.AddArc(MP1, radius, radians(-90), radians(-halfOpeningAngle)) '3. get the Start Point of the drawn arc stored in Segments 1 P1 = Segmente(1).StartPoint '4. get the End Point of the drawn arc stored in Segments 1 P2 = Segmente(1).EndPoint
How far I've come so far:
//1. set center point MP1 Point3d MP1 = new Point3d(0, 0, 0); MP1 = PolarPoint(öv_EP, radians(90), d2half + radius); //2. draw an arc with given Values and add it to Segments array position 1 //Create entity array for 12 entities first. I need this to be able to mirror all the 12 entities to draw the final structure. Teigha.DatabaseServices.Entity[] Segmente = new Entity[12]; //store an arc in Segements[1] Segments[1] = new Arc(MP1, radius, radians(-90), radians(-halfOpeningAngle)) //Draw the Arc using (Transaction action = manager.StartTransaction()) { BlockTable blockTable = action.GetObject(database.BlockTableId, OpenMode.ForRead) as BlockTable; if (blockTable == null) throw new System.NullReferenceException("blockTable == null"); BlockTableRecord blockTableRecord = action.GetObject(blockTable[BlockTableRecord.ModelSpace], OpenMode.ForWrite) as BlockTableRecord; if (blockTableRecord == null) throw new System.NullReferenceException("blockTableRecord == null"); blockTableRecord.AppendEntity(Segments[1]); action.AddNewlyCreatedDBObject(Segments[1], true); //3. After the arc is drawn, the entity should have a start and end point, right?
How can I now access the Startpoint of Segments[1] like I marked in the image ?
0