创建圆柱的两种方法
方法一
接口说明
CreateCylinder (Template, radius, height)
Template 模板.
radius A Double 半径
height A Double 高度
窗体设计

1.png
程序代码
Sub main()
 Form1.Show
End Sub
Private Sub CommandButton1_Click()
  '定义半径变量
  Dim radius, height As Double
  Dim solid As SmartSolidElement
   '半径
    radius = Val(TextBox1.Value)
    '高度
    height = Val(TextBox2.Value)
    '创建圆柱
    Set solid = SmartSolid.CreateCylinder(Nothing, radius, height)
    '添加至模型空间
    ActiveModelReference.AddElement solid
End Sub
运行效果

2.png
方法二
接口说明2
CreateWedge (Template, radius, height, angle)
参数说明:
radius A Double 半径
height A Double 高度
angle A Double 角度
Template 模板.
窗体设计

1 form.png
程序设计
Sub main()
 Form1.Show
End Sub
Private Sub CommandButton1_Click()
    Dim radius, height, angle As Double
    Dim result As SmartSolidElement
    '半径
    radius = Val(TextBox1.Value)
    '高度
    height = Val(TextBox2.Value)
    '角度
    angle = Val(TextBox3.Value)
    Set result = SmartSolid.CreateWedge(Nothing, radius, height, angle)
    ActiveModelReference.AddElement result
    Form1.Hide
End Sub
运行参数1

运行参数1
运行效果1

运行效果1
运行参数2

运行参数2
运行效果2

运行效果2