Create Solids

A solid object ( 3DSolid object) represents the entire volume of an object. Solids are the most informationally complete and least ambiguous of the 3D modeling types. Complex solid shapes are also easier to construct and edit than wireframes and meshes.

You create solids from one of the basic solid shapes of box, cone, cylinder, sphere, torus, and wedge or by extruding a 2D object along a path or revolving a 2D object about an axis. Use one of the following methods to create solids:

AddBox, AddCone, AddCylinder, AddEllipticalCone, AddEllipticalCylinder, AddExtrudedSolid, AddExtrudedSolidAlongPath, AddRevolvedSolid, AddSolid, AddSphere, AddTorus, or AddWedge.

Like meshes, solids are displayed as wireframes until you hide, shade, or render them. Additionally, you can analyze solids for their mass properties (volume, moments of inertia, center of gravity, and so forth). Use the following properties to analyze solids: MomentOfInertia, PrincipalDirections, PrincipalMoments, ProductOfInertia, RadiiOfGyration, and Volume.

The ContourlinesPerSurface property controls the number of tessellation lines used to visualize curved portions of the wireframe. The RenderSmoothness property adjusts the smoothness of shaded and hidden-line objects.

For more information on creating solids, see “Create 3D Objects” in the User's Guide.

Create a wedge solid

The following example creates a wedge-shaped solid in model space. The viewing direction of the active viewport is updated to display the three-dimensional nature of the wedge more easily.

Sub Ch8_CreateWedge()
	Dim wedgeObj As Acad3DSolid
	Dim center(0 To 2) As Double
	Dim length As Double
	Dim width As Double
	Dim height As Double

	' Define the wedge
	center(0) = 5#: center(1) = 5#: center(2) = 0
	length = 10#: width = 15#: height = 20#

	' Create the wedge in model space
	Set wedgeObj = ThisDrawing.ModelSpace. _
				 AddWedge(center, length, width, height)

	' Change the viewing direction of the viewport
	Dim NewDirection(0 To 2) As Double
	NewDirection(0) = -1
	NewDirection(1) = -1
	NewDirection(2) = 1
	ThisDrawing.ActiveViewport.direction = NewDirection
	ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
End Sub