VS:BeginVectorFillN

From Vectorworks Developer
Jump to navigation Jump to search

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

Description

Procedure BeginVectorFillN creates a new vector fill definition in a VectorWorks document. The value of vectorFillName will change only if the hatch name already exists.

A color table listing with associated index values can be found in the Appendix.

PROCEDURE BeginVectorFillN(
VAR vectorFillName :STRING;
pageSpace :BOOLEAN;
rotateInWall :BOOLEAN;
colorIndex :INTEGER);
def vs.BeginVectorFillN(vectorFillName, pageSpace, rotateInWall, colorIndex):
    return vectorFillName

Parameters

vectorFillName STRING Name of new vector fill pattern.
pageSpace BOOLEAN Sets page or world space for vector fill.
rotateInWall BOOLEAN Sets rotate in wall option for vector fill.
colorIndex INTEGER Background color of vector fill.

Remarks

Begins a hatch definition. vectorFillName will return with a different name if the input name already is being used in the document.

This is a new version of BeginVectorFill which returns the actual name of the hatch in the VAR STRING.


We have found a problem with the VectorScript function BeginVectorFillN in that it is currently impossible to create a hatch that has an opaque white (color 0) background. We would like to change this so that any hatches it creates always has an opaque background. To give a hatch a transparent background, there is already a SetObjectVariableBoolean call (value 661) to do this.

Example

VectorScript

{ Create a new hatch and add it to the resource list. }
hatchName := 'Hatch-1';
BeginVectorFillN(hatchName, true, false, 0);
AddVectorFillLayer(0, 0, 1, 1, .25, -.25, .7, 3, 255);
EndVectorFill;
newHatch := GetObject(hatchName);
index := AddResourceToList(listID, newHatch);

Python

def Example():
	#{ Create a new hatch and add it to the resource list. }
	kHatch = 66
	kDefHatchFolder = 105
	hatchName = 'Hatch-1'

	listID, numItems = vs.BuildResourceList(kHatch, kDefHatchFolder, '')
	vs.BeginVectorFillN(hatchName, True, False, 0)
	vs.AddVectorFillLayer(0, 0, 1, 1, .25, -.25, .7, 3, 255)
	vs.EndVectorFill()
	newHatch = vs.GetObject(hatchName)
	index = vs.AddResourceToList(listID, newHatch)
Example()

Version

Availability: from VectorWorks8.0

See Also

VS Functions:

VS:AddVectorFillLayer | VS:EndVectorFill

VS Functions:

[[VS:AddVectorFillLayer]]

| [[VS:EndVectorFill]]