Profile、Height、TaperAngle を指定して、押し出しソリッドを作成します。
サポートされているプラットフォーム: Windows のみ
VBA:
RetVal = object.AddExtrudedSolid(Profile, Height, TaperAngle)
タイプ: Block、ModelSpace、PaperSpace
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ
タイプ: Region
外形線には、Region オブジェクトのみが使用できます。
アクセス: 入力のみ
タイプ: 倍精度浮動小数点数型
オブジェクトの座標系の Z 軸に沿った押し出しの高さ。 正の数値を入力すると、Z 軸の正方向にオブジェクトが押し出されます。 負の数値を入力すると、Z 軸の負方向にオブジェクトが押し出されます。
アクセス: 入力のみ
タイプ: 倍精度浮動小数点数型
押し出しのテーパ角度はラジアンで提供される必要があります。テーパ角度の範囲は -90~90 度。
正の角度を指定すると底面から内側に向かってテーパが付き、負の角度を指定すると外側に向かってテーパが付きます。既定の角度 0 を指定すると、2D オブジェクトがその平面に対して垂直に押し出されます。
2D 平面のリージョンを押し出すことしかできません。
テーパを付ける押し出しは、頂点が連続しているループによってのみ可能です。テーパ角度を大きくしたり押し出しの高さを高くすると、指定された押し出しの高さに達する前に、オブジェクトあるいはオブジェクトの一部がオブジェクトそのものと交差してしまうことがあります。AutoCAD では、押し出した結果がソリッド本体と交差することはありません。
VBA:
Sub Example_AddExtrudedSolid()
' This example extrudes a solid from a region.
' The region is created from an arc and a line.
Dim curves(0 To 1) As AcadEntity
' Define the arc
Dim centerPoint(0 To 2) As Double
Dim radius As Double
Dim startAngle As Double
Dim endAngle As Double
centerPoint(0) = 5#: centerPoint(1) = 3#: centerPoint(2) = 0#
radius = 2#
startAngle = 0
endAngle = 3.141592
Set curves(0) = ThisDrawing.ModelSpace.AddArc(centerPoint, radius, startAngle, endAngle)
' Define the line
Set curves(1) = ThisDrawing.ModelSpace.AddLine(curves(0).startPoint, curves(0).endPoint)
' Create the region
Dim regionObj As Variant
regionObj = ThisDrawing.ModelSpace.AddRegion(curves)
' Define the extrusion
Dim height As Double
Dim taperAngle As Double
height = 3
taperAngle = 0
' Create the solid
Dim solidObj As Acad3DSolid
Set solidObj = ThisDrawing.ModelSpace.AddExtrudedSolid(regionObj(0), height, taperAngle)
' Change the viewing direction of the viewport
Dim NewDirection(0 To 2) As Double
NewDirection(0) = -1: NewDirection(1) = -1: NewDirection(2) = 1
ThisDrawing.ActiveViewport.direction = NewDirection
ThisDrawing.ActiveViewport = ThisDrawing.ActiveViewport
ZoomAll
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_AddExtrudedSolid()
;; This example extrudes a solid from a region.
;; The region is created from an arc and a line.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
(setq modelSpace (vla-get-ModelSpace doc))
;; Define the arc
(setq centerPoint (vlax-3d-point 5 3 0)
radius 2
startAngle 0
endAngle 3.141592)
(setq arc (vla-AddArc modelSpace centerPoint radius startAngle endAngle))
;; Define the line
(setq line (vla-AddLine modelSpace (vla-get-StartPoint arc) (vla-get-EndPoint arc)))
(setq curves (vlax-make-safearray vlax-vbObject '(0 . 1)))
(vlax-safearray-put-element curves 0 arc)
(vlax-safearray-put-element curves 1 line)
;; Create the region
(setq regionObj (vla-AddRegion modelSpace curves))
;; Define the extrusion
(setq height 3
taperAngle 0)
;; Create the solid
(setq solidObj (vla-AddExtrudedSolid modelSpace (vlax-safearray-get-element (vlax-variant-value regionObj) 0) height taperAngle))
;; Change the viewing direction of the viewport
(setq NewDirection (vlax-3d-point -1 -1 1))
(setq activeViewport (vla-get-ActiveViewport doc))
(vla-put-Direction activeViewport NewDirection)
(vla-put-ActiveViewport doc activeViewport)
(vla-ZoomAll acadObj)
)