Tin |
Exception | Condition |
---|---|
ArgumentException |
Thrown when :
|
1[CommandMethod("CreateTINSurface")] 2public void CreateTINSurface() 3{ 4 using (Transaction ts = Application.DocumentManager.MdiActiveDocument.Database.TransactionManager.StartTransaction()) 5 { 6 string surfaceName = "ExampleTINSurface"; 7 // Select a style to use 8 ObjectId surfaceStyleId = doc.Styles.SurfaceStyles[3]; 9 10 // Create the surface 11 ObjectId surfaceId = TinSurface.Create(surfaceName, surfaceStyleId); 12 13 TinSurface surface = surfaceId.GetObject(OpenMode.ForWrite) as TinSurface; 14 15 // Add some random points 16 Point3dCollection points = new Point3dCollection(); 17 Random generator = new Random(); 18 for (int i = 0; i < 10; i++) 19 { 20 double x = generator.NextDouble() * 250; 21 double y = generator.NextDouble() * 250; 22 double z = generator.NextDouble() * 100; 23 points.Add(new Point3d(x, y, z)); 24 } 25 26 surface.AddVertices(points); 27 28 // commit the create action 29 ts.Commit(); 30 } 31}