IntelliCAD 11.1 Object Library
AddVectors Method
See Also 
Vector1
The Vector object to be added with the second Vector object.
Vector2
The Vector object to be added with the first Vector object.
Library Object : AddVectors Method

Description

Adds two vectors.

Syntax

Visual Basic
Public Function AddVectors( _
   ByVal Vector1 As Vector, _
   ByVal Vector2 As Vector _
) As Vector

Parameters

Vector1
The Vector object to be added with the second Vector object.
Vector2
The Vector object to be added with the first Vector object.

Example

Private Sub AddVectorsExample()

     ' This example creates two vectors and adds them together.

     ' It then subtracts them and displays the result.

     Dim icadDoc As IntelliCAD.Document

     Set icadDoc = ActiveDocument

     Dim Vect1 As Vector

     Dim Vect2 As Vector

     Dim Vect3 As Vector

     Dim Vect4 As Vector

     Set Vect1 = Library.CreateVector(0, 0, 0, 1, 1, 0)

     Set Vect2 = Library.CreateVector(0, 0, 0, 2, 1, 0)

     Set Vect3 = Library.AddVectors(Vect1, Vect2)

     Set Vect4 = Library.SubtractVectors(Vect1, Vect2)

     MsgBox "Properties of vector sum:" & Chr(13) & Vect3.x & ", " & Vect3.y & ", " & Vect3.z

     MsgBox "Properties of vector difference:" & Chr(13) & Vect4.x & ", " & Vect4.y & ", " & Vect4.z

End Sub

See Also

© 2022 IntelliCAD Technology Consortium. All Rights Reserved.