ある軸を中心として平面オブジェクトの鏡像イメージ コピーを作成します。
サポートされているプラットフォーム: Windows のみ
VBA:
RetVal = object.Mirror(Point1, Point2)
タイプ: すべての図形オブジェクト、AttributeReference、Dimension
このメソッドが適用されるオブジェクト。
アクセス: 入力のみ
タイプ: バリアント型(3 要素の倍精度浮動小数点数型配列)
対称軸の 1 点目を指定する 3D WCS 座標。
アクセス: 入力のみ
タイプ: バリアント型(3 要素の倍精度浮動小数点数型配列)
対称軸の 2 点目を指定する 3D WCS 座標。
タイプ: Object
このオブジェクトは、任意の図形オブジェクトとすることができ、元のオブジェクトを鏡像化した結果です。
パラメータとして指定された 2 点が、反映するオブジェクトの基準となる線分の両端になります。

選択されたオブジェクト

対称軸を指定する Point1 と Point2

鏡像化されたオブジェクト
このメソッドでは、鏡像化されたイメージが図面に配置され、元のオブジェクトもそのまま残ります。元のオブジェクトを除去するには、Delete メソッドを使用します。
Viewport オブジェクトはペーパー空間で鏡像化できますが、そのモデル空間ビューやモデル空間オブジェクトには影響ありません。
AutoCAD は、複写されるオブジェクトが他のオブジェクトを持っているかどうかを検査します。他のオブジェクトがある場合はそれも複写されます。すべてのオブジェクトが複写されるまで、処理が継続されます。
AttributeReference:AttributeReference オブジェクトにこのメソッドを使用するべきではありません。AttributeReference オブジェクトがこのメソッドを継承しているのは、図面オブジェクトの 1 つだからですが、属性参照でこの処理を実行することはできません。

鏡像化前

鏡像化後(MIRRTEXT = 1)

鏡像化後(MIRRTEXT = 0)
VBA:
Sub Example_Mirror()
' This example creates a lightweight polyline
' and then mirrors that polyline.
' Create the polyline
Dim plineObj As AcadLWPolyline
Dim points(0 To 11) As Double
points(0) = 1: points(1) = 1
points(2) = 1: points(3) = 2
points(4) = 2: points(5) = 2
points(6) = 3: points(7) = 2
points(8) = 4: points(9) = 4
points(10) = 4: points(11) = 1
Set plineObj = ThisDrawing.ModelSpace.AddLightWeightPolyline(points)
plineObj.Closed = True
ZoomAll
' Define the mirror axis
Dim point1(0 To 2) As Double
Dim point2(0 To 2) As Double
point1(0) = 0: point1(1) = 4.25: point1(2) = 0
point2(0) = 4: point2(1) = 4.25: point2(2) = 0
MsgBox "Mirror the polyline.", , "Mirror Example"
' Mirror the polyline
Dim mirrorObj As AcadLWPolyline
Set mirrorObj = plineObj.Mirror(point1, point2)
ZoomAll
MsgBox "Mirror completed.", , "Mirror Example"
End Sub
Visual LISP:
(vl-load-com)
(defun c:Example_Mirror()
;; This example creates a lightweight polyline
;; and then mirrors that polyline.
(setq acadObj (vlax-get-acad-object))
(setq doc (vla-get-ActiveDocument acadObj))
;; Create the polyline
(setq points (vlax-make-safearray vlax-vbDouble '(0 . 11)))
(vlax-safearray-fill points '(1 1
1 2
2 2
3 2
4 4
4 1
)
)
(setq modelSpace (vla-get-ModelSpace doc))
(setq plineObj (vla-AddLightWeightPolyline modelSpace points))
(vla-put-Closed plineObj :vlax-true)
(vla-ZoomAll acadObj)
;; Define the mirror axis
(setq point1 (vlax-3d-point 0 4.25 0)
point2 (vlax-3d-point 4 4.25 0))
(alert "Mirror the polyline.")
;; Mirror the polyline
(setq mirrorObj (vla-Mirror plineObj point1 point2))
(vla-ZoomAll acadObj)
(alert "Mirror completed.")
)