BuildConstraintModelForObject Parametric Constraints 
Vectorworks 2011

VectorScript Declaration:

PROCEDURE   BuildConstraintModelForObject
(   h :HANDLE;
    traverseContainers :BOOLEAN
) ;

Python:

def  vs.BuildConstraintModelForObject(h, traverseContainers):
   return None

Description:

Create a constraint model for the specified object in the constraint manager. If 'traverseContainers' is true and the specified object is a symbol definition, a group or another container-like objects, it will go deep inside that container.
This function should typically be called for constrained objects that have been duplicated and newly inserted into the drawing.

Parameters:

h Handle to object
traverseContainers Whether to traverse containers-like objects



  DeleteConstraint Parametric Constraints 
VectorWorks9.0

VectorScript Declaration:

PROCEDURE   DeleteConstraint
(   obj :HANDLE;
    constraint :HANDLE
) ;

Python:

def  vs.DeleteConstraint(obj, constraint):
   return None

Description:

Removes a constraint from the referenced object in the document.

Parameters:

obj Handle to object.
constraint Handle to constraint being deleted.



  GetBinaryConstraint Parametric Constraints 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   GetBinaryConstraint
(   constrType :INTEGER;
    obj1 :HANDLE;
    obj2 :HANDLE;
    obj1VertA :INTEGER;
    obj1VertB :INTEGER;
    obj2VertA :INTEGER;
    obj2VertB :INTEGER;
    containedObj1 :LONGINT;
    containedObj2 :LONGINT
) :HANDLE ;

Python:

def  vs.GetBinaryConstraint(constrType, obj1, obj2, obj1VertA, obj1VertB, obj2VertA, obj2VertB, containedObj1, containedObj2):
   return HANDLE

Description:

Returns a handle to a binary parametric constraint applied to the referenced objects.

Table - Binary Constraint Types

Index
Constraint Type
1
coincident
2
collinear
3
parallel
6
tangent
7
concentric
8
distance
9
horizontal distance
10
vertical distance
12
angle
13
perpendicular

Parameters:

constrType Type of constraint to be returned.
obj1 Handle to first object in constraint relationship.
obj2 Handle to second object in constraint relationship.
obj1VertA Vertex defining the constraint geometry of first object.
obj1VertB Vertex defining the constraint geometry of first object.
obj2VertA Vertex defining the constraint geometry of second object.
obj2VertB Vertex defining the constraint geometry of second object.

Result:

Returns a HANDLE to the constraint if exists, otherwise returns NIL.



  GetSingularConstraint Parametric Constraints 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   GetSingularConstraint
(   typeOfConstraint :INTEGER;
    obj :HANDLE;
    vertexA :INTEGER;
    vertexB :INTEGER
) :HANDLE ;

Python:

def  vs.GetSingularConstraint(typeOfConstraint, obj, vertexA, vertexB):
   return HANDLE

Description:

Returns the type of constraint applied to the referenced object.

Table - Constraint Types

Index
Constraint Type
4
Vertical
5
Horizontal
8
Distance
9
Vertical distance
10
Horizontal distance
11
Radius

Parameters:

typeOfConstraint Type of constraint to be returned.
obj Handle to object.
vertexA Vertex defining the constraint geometry.
vertexB Vertex defining the constraint geometry.

Result:

Returns a HANDLE to the constraint if exists, otherwise returns NIL.



  HasConstraint Parametric Constraints 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   HasConstraint
( h:HANDLE ) :BOOLEAN ;

Python:

def  vs.HasConstraint(h):
   return BOOLEAN

Description:

Returns whether the referenced object has a parametric constraint .

Parameters:

h Handle to object.



  SetBinaryConstraint Parametric Constraints 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   SetBinaryConstraint
(   typeOfConstraint :INTEGER;
    h1 :HANDLE;
    h2 :HANDLE;
    obj1VertA :INTEGER;
    obj1VertB :INTEGER;
    obj2VertA :INTEGER;
    obj2VertB :INTEGER;
    containedObj1 :LONGINT;
    containedObj2 :LONGINT
) :BOOLEAN ;

Python:

def  vs.SetBinaryConstraint(typeOfConstraint, h1, h2, obj1VertA, obj1VertB, obj2VertA, obj2VertB, containedObj1, containedObj2):
   return BOOLEAN

Description:

Applies a binary parametric constraint to the referenced objects. The geometry of the constraint is defined by the specified object vertices.

Table - Binary Constraint Types

Index
Constraint Type
1
coincident
2
collinear
3
parallel
6
tangent
7
concentric
8
distance
9
horizontal distance
10
vertical distance
12
angle
13
perpendicular


To apply a constraint to an object within a symbol, use GetClosestPt to obtain an index to the object and pass the index to either obj2VertA to use it as the first object or obj2VertB to use it as the second object. In all other instances, pass 0 to both these parameters.

Parameters:

typeOfConstraint Type of constraint to be applied.
h1 Handle to object accepting constraint.
h2 Handle to object accepting constraint.
obj1VertA Vertex on first object defining constraint geometry.
obj1VertB Vertex on first object defining constraint geometry.
obj2VertA Vertex on second object defining constraint geometry.
obj2VertB Vertex on second object defining constraint geometry.
containedObj1 Object index, obtained from the GetClosestPt function.
containedObj2 Object index, obtained from the GetClosestPt function.

Result:

Returns a BOOLEAN value indicating whether the constraint was successfully applied.



  SetConstraintValue Parametric Constraints 
VectorWorks9.0

VectorScript Declaration:

PROCEDURE   SetConstraintValue
(   constraint :HANDLE;
    value :REAL
) ;

Python:

def  vs.SetConstraintValue(constraint, value):
   return None

Description:

Sets the referenced dimensional constraint to a new value.

Parameters:

constraint Handle to constraint being modified.
value New value for the constraint.



  SetSingularConstraint Parametric Constraints 
VectorWorks9.0

VectorScript Declaration:

FUNCTION   SetSingularConstraint
(   typeOfConstraint :INTEGER;
    h :HANDLE;
    vertexA :INTEGER;
    vertexB :INTEGER
) :BOOLEAN ;

Python:

def  vs.SetSingularConstraint(typeOfConstraint, h, vertexA, vertexB):
   return BOOLEAN

Description:

Applies a parametric constraint to the referenced object. The geometry of the constraint is defined by the specified object vertices.

Table - Constraint Types

Index
Constraint Type
4
Vertical
5
Horizontal
8
Distance
9
Vertical distance
10
Horizontal distance
11
Radius

Parameters:

typeOfConstraint Type of constraint to be applied.
h Handle to object accepting constraint.
vertexA Vertex defining the constraint geometry.
vertexB Vertex defining the constraint geometry.

Result:

Returns a BOOLEAN value indicating whether the constraint was applied successfully.