通常在microstation中繪制一定的三維實(shí)體后,需要進(jìn)行進(jìn)一步的的修改操作浓利,如長度挤庇、寬度、高度等的拉伸操作贷掖,在microstation API中支持對三維實(shí)體的某個(gè)面進(jìn)行拉伸操作嫡秕,進(jìn)而改變實(shí)體的造型。
接口如下
OffsetFace (solid, closestPointOnFace, distance)
solid SmartSolidElement 需要偏移的面所在的實(shí)體
closestPointOnFace 被偏移面上的點(diǎn)
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)
'坐標(biāo)原點(diǎn)向右偏移200比較效果
solid2.Move Point3dFromXYZ(200, 0, 0)
'添加至模型空間
ActiveModelReference.AddElement solid2
End Sub
運(yùn)行效果
1.png