VS:Registering parametric object for Align/Distribute Leader Lines command

From Vectorworks Developer
Jump to navigation Jump to search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix

By Bozhidar Stanchev

What is that

Parametric objects that have control points which can be considered as shoulder and label of a leader line can register so they can be aligned by the Align/Distibute Leader Lines menu command.

Rules

To make a VectorScript object be participant in the Leader Line alignment (see the menu command Align/Distribute Leader Lines), do the following:

1. Make sure that the VectorScript object has control points which can be considered as shoulder and label points in the terms of the Leader Line alignment.

2. Enable the extended plug-in properties for the VectorScript object.

See the VS:Object Events article on enabling the extended properties.

3. Specify how the VectorScript object will be recognized by the Leader Line alignment menu command.

- The VectorScript object must provide the indices of its shoulder and label control point. Note that specifying of label point is not a must.

To provide the above mentioned indices use VS:SetObjPropCharVS:

Example

Let us have a VectorScript object with control points which can be considered as shoulder and label points in terms of the Align/Distribute Leader Lines command.

Let the index of the shoulder control point parameter's X value is 5, and the index of the label control point parameter's X value is 7.

Having the extended plug-in properties enabled for the VectorScript object, add the following code:

5: {kObjOnInitXProperties}
BEGIN
   result := SetObjPropCharVS( 33 {kObjXPropLeaderLinePtIndex}, Chr( 5 ) );
   result := SetObjPropCharVS( 34 {kObjXPropLabelPtIndex}, Chr( 7 ) );
END;

The object is already registered so it can be aligned by the Align/Distibute Leader Lines menu command.

See also

VCOM:VectorWorks:Extension:ILeaderLineProvider