Mirror3D method example

Sub Mirror3D_Example()

' This example creates a box in model space, and mirrors the box about a plane.

    

    Dim boxObj As Acad3DSolid

    Dim length As Double, width As Double, height As Double

    Dim center(0 To 2) As Double

    

    ' Add the box

    center(0) = 5#: center(1) = 5#: center(2) = 0

    length = 5#: width = 7: height = 10#

    Set boxObj = ThisDrawing.ModelSpace.AddBox(center, length, width, height)

    

    ' Define the mirroring plane with three points

    Dim ptMirr1(0 To 2) As Double

    Dim ptMirr2(0 To 2) As Double

    Dim ptMirr3(0 To 2) As Double

    

    ptMirr1(0) = 1.25: ptMirr1(1) = 0: ptMirr1(2) = 0

    ptMirr2(0) = 1.25: ptMirr2(1) = 2: ptMirr2(2) = 0

    ptMirr3(0) = 1.25: ptMirr3(1) = 2: ptMirr3(2) = 2

    

    ' Mirror the box

    Dim mirrorBoxObj As Acad3DSolid

    Set mirrorBoxObj = boxObj.Mirror3D(ptMirr1, ptMirr2, ptMirr3)

    

    ' 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.Application.ZoomExtents

    

End Sub

 


Bricscad™ is commercialized by Bricsys NV. Bricsys NV and Vondle NV are fully owned subsidiaries of Menhirs NV. © 2001- Menhirs NV - All rights reserved.