21 | 08 | 2017

Create Box Object

Code below shows how to create a box using a function.

Function CreateBoxObject _(Coordinates As Variant, Length As Double, Width As Double, Height As Double)
'*** Code from VisibleVisual.com ********

    'This function can be used to create boxes with different dimensions

    Dim boxObj As Acad3DSolid

    Set boxObj = ThisDrawing.ModelSpace.AddBox(Coordinates, Length, Width, Height)


End Function

'Use the routine below to test the function

Sub TestBoxSample()

Dim origin(0 To 2) As Double
origin(0) = 1: origin(1) = 1: origin(2) = 1

CreateBoxObject origin, 200, 50, 150

End Sub

This is the result:

Box Obj





Sign up now and upload your code to the website.

Help us to continue.....
Articles View Hits
Latest Articles