[]
This interface provides access to 3-D effect properties such as extrusion depth, rotation, perspective, visibility, and Z position for a drawing object. You can obtain an IThreeDFormat instance from APIs such as IShape#getThreeD() or IChartFormat#getThreeD().
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
IThreeDFormat threeDFormat = shape.getThreeD();
threeDFormat.setVisible(true);
threeDFormat.setDepth(24);
doublegetDepth()intdoubledoubledoublebooleandoublegetZ()IThreeDFormat object.voidvoidsetDepth(double value) voidsetPerspective(int value) voidsetRotationX(double value) voidsetRotationY(double value) voidsetRotationZ(double value) voidsetVisible(boolean value) voidsetZ(double value) IThreeDFormat object.Use this property to determine how far the shape is extruded in three-dimensional formatting.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
double depth = shape.getThreeD().getDepth();
Use this property to set how far the shape is extruded in three-dimensional formatting.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setDepth(100.0);
value - The depth of the shape's extrusion.Use this method to retrieve the perspective setting for a shape's 3-D formatting.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setPerspective(1);
int perspective = shape.getThreeD().getPerspective();
Use this method to set whether the extrusion appears in perspective for a shape's 3-D formatting.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setPerspective(1);
shape.getThreeD().setPerspective(0);
value - The value that specifies whether the extrusion appears in perspective.Use this method to read the current x-axis rotation applied to a shape's three-dimensional formatting.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setRotationX(20);
double rotationX = shape.getThreeD().getRotationX();
Use this method to set the x-axis rotation applied to a shape's three-dimensional formatting.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setRotationX(20);
shape.getThreeD().setRotationX(100.0);
value - The rotation angle around the x-axis, in degrees.Use this method to read the current y-axis rotation applied to a shape's 3-D formatting.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setRotationY(20);
double rotationY = shape.getThreeD().getRotationY();
Use this method to set the y-axis rotation applied to a shape's 3-D formatting.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setRotationY(20);
shape.getThreeD().setRotationY(100.0);
value - The rotation of the extruded shape around the y-axis, in degrees.Use this method to retrieve the current z-axis rotation that is applied to a shape's three-dimensional formatting.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setRotationZ(30);
double rotationZ = shape.getThreeD().getRotationZ();
Use this method to set the z-axis rotation applied to a shape's three-dimensional formatting.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setRotationZ(30);
shape.getThreeD().setRotationZ(100.0);
value - The rotation of the extruded shape around the z-axis, in degrees.Use this method to check whether the shape's three-dimensional formatting is currently displayed.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setVisible(false);
boolean visible = shape.getThreeD().getVisible();
true if the object is visible; otherwise, false.Use this method to show or hide the shape's three-dimensional formatting.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setVisible(false);
shape.getThreeD().setVisible(true);
value - true if the object is visible; otherwise, false.IThreeDFormat object.Use this method to get the depth position of a shape's 3-D formatting. This value is not the stacking order used to layer shapes. The IThreeDFormat instance is typically obtained from IShape.getThreeD().
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setZ(20);
double z = shape.getThreeD().getZ();
IThreeDFormat object.Use this method to set the depth position of a shape's 3-D formatting. This value is not the stacking order used to layer shapes.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setZ(20);
shape.getThreeD().setZ(100.0);
value - The 3-D Z/depth position value of the 3-D format.This method resets only the x-axis and y-axis rotation values of the shape's 3-D formatting.
IShape shape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 1, 1, 100, 100);
shape.getThreeD().setDepth(7);
shape.getThreeD().setRotationX(20);
shape.getThreeD().setRotationY(30);
shape.getThreeD().resetRotation();