Style |
Exception | Condition |
---|---|
ArgumentException | Thrown when the name already exists. |
1// Select a surface style to use. 2// If the desired style doesn't exist, create it. 3ObjectId surfaceStyleId = ObjectId.Null; 4try 5{ 6 surfaceStyleId = doc.Styles.SurfaceStyles["Slope Banding (2D)"]; 7} 8catch (System.ArgumentException e) 9{ 10 surfaceStyleId = doc.Styles.SurfaceStyles.Add("Slope Banding (2D)"); 11}