通常在microstation中繪制一定的三維實體后,需要進行進一步的的修改操作,如長度、寬度、高度等的拉伸操作,在microstation API中支持對三維實體的某個面進行拉伸操作,進而改變實體的造型。
接口如下
OffsetFace (solid, closestPointOnFace, distance)
solid SmartSolidElement 需要偏移的面所在的實體
closestPointOnFace 被偏移面上的點
distance Double類型 偏移的距離
程序代碼
Sub main()
Dim solid1, solid2 As SmartSolidElement
'創(chuàng)建立方體
Set solid1 = SmartSolid.CreateSlab(Nothing, 100, 100, 100)
'添加至模型空間
ActiveModelReference.AddElement solid1
'頂面向上拉伸操作
Dim point As Point3d
point = Point3dFromXYZ(0, 0, 50)
'頂面向上偏移100
Set solid2 = SmartSolid.OffsetFace(solid1, point, 100)
'坐標原點向右偏移200比較效果
solid2.Move Point3dFromXYZ(200, 0, 0)
'添加至模型空間
ActiveModelReference.AddElement solid2
End Sub
運行效果

1.png