简单,画一个底面圆,然后根据两点画直线,拉伸,就可以了 程序: Dim intCount As Integer ' 当前模型空间的对象数 intCount = ThisDrawing.ModelSpace.Count Dim ptCenter(2) As Double ptCenter(0) = x1: ptCenter(1) = y1: ptCenter(2) = h1 Dim objCircle(0) As AcadEntity Set objCircle(0) = AddCircle(ptCenter, r1) ' 创建拉伸截面 ' 创建面域 Dim objRegion As Variant objRegion = ThisDrawing.ModelSpace.AddRegion(objCircle) objCircle(0).Delete Dim objLine As AcadLine, pt(2) As Double pt(0) = x2 pt(1) = y2 pt(2) = h2 Set objLine = AddLine(ptCenter, pt) ' 创建拉伸路径 ' 沿路径拉伸面域 Dim objSolid As Acad3DSolid Set objSolid = ThisDrawing.ModelSpace.AddExtrudedSolidAlongPath(objRegion(0), objLine) objLine.Delete ' 删除已无用的面域 Dim ent As AcadEntity If ThisDrawing.ModelSpace.Count > intCount Then Set ent = ThisDrawing.ModelSpace.Item(ThisDrawing.ModelSpace.Count - 2) ent.Delete End If 大概这样,有些是自定义命令 |