長方體創建的接口說明
CreateSlab (Template, width, length, height)
width double類型 寬度
length double類型 長度
height double類型 高度
Template 元素模板.
窗體設計
窗體設計
程序代碼
Sub main()
Form1.Show
End Sub
Private Sub CommandButton1_Click()
Dim length, width, height As Double
Dim solid As SmartSolidElement
'長度
length = Val(TextBox1.Value)
'寬度
width = Val(TextBox2.Value)
'高度
height = Val(TextBox3.Value)
'創建長方體
Set solid = SmartSolid.CreateSlab(Nothing, width, length, height)
'添加至模型空間
ActiveModelReference.AddElement solid
End Sub
運行效果
運行效果