IntelliCAD 11.1 Object Library
SubtractVectors Method
See Also 
Vector1
The first Vector object.
Vector2
The second Vector object.
Library Object : SubtractVectors Method

Description

Subtracts two vectors (Vector1 - Vector2).

Syntax

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

Parameters

Vector1
The first Vector object.
Vector2
The second 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.