Vector3D

The Vector3D class is a data holder for a 2D vector. The Vector3D is internally represented by a x and y value. The value unit is mm.

There are the following groups of member functions with some examples of use:

  • construct the vector
    import NemAll_Python_Geometry as AllplanGeo
    
    vector1 = AllplanGeo.Vector3D()
    vector2 = AllplanGeo.Vector3D(1000, 2000, 3000)
    vector3 = AllplanGeo.Vector3D(vector2)
    ...
    
  • set and get the values
    vector1.X = 500
    vector1.Y = vector2.Y
    length    = vector1.GetLength()
    ...
    
  • changing the vector by basic mathematical operations like +, -, * and /
    vector4 = vector2 + vector3
    vector2 -= vector3
    vector5 = vector3 / 2
    ...
    
  • comparing vectors
    if vector2 == vector3:
       ...
    ...
    
  • general vector utilities like cross product, normalize, …
    vector3 = vector1.CrossProduct(vector2)
    dot_res = vector1.DotProduct(vector2)
    
    vector3.Normalize(1000)
    vector3.Reverse()
    
The Vector3DList class is a special list for Vector3D objects and can be used like

vector_list = AllplanGeo.Vector3DList() vector_list.append(vector1) vector_list.append(vector2) vector_list.append(vector3)

The complete documentation of the members from the Vector3D and Vector3DList class can be found here: