CreateCustomObject Objects - Custom 
VectorWorks8.5

VectorScript Declaration:

FUNCTION   CreateCustomObject
(   objectName :STRING;
    pX :REAL;
    pY :REAL;
    rotationAngle :REAL
) :HANDLE ;

Python:

def  vs.CreateCustomObject(objectName, p, rotationAngle):
   return HANDLE

Description:

Creates a custom object instance at the specified location and angle of rotation. For the objectName, use the "internal" plug-in name (the one assigned in the plug-in editor), as opposed to the filename (which can be different).

Parameters:

objectName Name of object.
p Insertion point of object instance.
rotationAngle Rotation angle (in degrees) of object instance.

Result:

Returns a HANDLE to the new object.

See Also:

CreateCustomObjectPath  



  CreateCustomObjectN Objects - Custom 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   CreateCustomObjectN
(   objectName :STRING;
    pX :REAL;
    pY :REAL;
    rotationAngle :REAL;
    showPref :BOOLEAN
) :HANDLE ;

Python:

def  vs.CreateCustomObjectN(objectName, p, rotationAngle, showPref):
   return HANDLE

Description:

Creates a custom object instance at specified location and angle of rotation. The calling function can also set whether the pref dialog should appear.

Parameters:

objectName Name of object.
p Insertion point of object instance.
rotationAngle Rotation angle (in degrees) of object instance.
showPref Show the Object Properties dialog.

Example:

PROCEDURE Example;
VAR
   h :HANDLE;
BEGIN
   h := CreateCustomObjectN('Door', 0, 0, 0, False);
END;
RUN(Example);



  CreateCustomObjectPath Objects - Custom 
VectorWorks8.5

VectorScript Declaration:

FUNCTION   CreateCustomObjectPath
(   objectName :STRING;
    path :HANDLE;
    profileGroup :HANDLE
) :HANDLE ;

Python:

def  vs.CreateCustomObjectPath(objectName, path, profileGroup):
   return HANDLE

Description:

Creates an instance of the path custom object specified by the name argument. The vertices of the path are translated in such a way that the first vertex will be placed at the origin of the plug-in's coordinate space.

Parameters:

objectName Name of object.
path Handle to new object path polygon.
profileGroup Handle to new profile group object.

Result:

Returns a HANDLE to the new path object.

Example:

PROCEDURE Example;
VAR
	h :HANDLE;
BEGIN
	CallTool(-204);
	h := CreateCustomObjectPath('Cutting Plane', FSActLayer, nil);
END;
RUN(Example);



  CreateGroupOutline Objects - Custom 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   CreateGroupOutline
( objectName:HANDLE ) :HANDLE ;

Python:

def  vs.CreateGroupOutline(objectName):
   return HANDLE

Description:

Returns a handle to the polygon which is the outline of a group.



  DefineCustomObj Objects - Custom 
Vectorworks 2014

VectorScript Declaration:

FUNCTION   DefineCustomObj
(   pluginName :STRING;
    prefWhen :INTEGER
) :HANDLE ;

Python:

def  vs.DefineCustomObj(pluginName, prefWhen):
   return HANDLE

Description:

Calls GS_DefineCustomObject for a passed plugin name and preference.



  EnableParameter Objects - Custom 
VectorWorks10.0

VectorScript Declaration:

PROCEDURE   EnableParameter
(   inPlugin :HANDLE;
    inParameterName :STRING;
    inSetEnabled :BOOLEAN
) ;

Python:

def  vs.EnableParameter(inPlugin, inParameterName, inSetEnabled):
   return None

Description:

For plug-in objects, this procedure sets whether or not the specified parameter is enabled on the Object Info Palette. This routine is used inside plug-in object regeneration scripts to set their parameter enable state. This state is an object instance property.

Parameters:

inPlugin Handle to the currently executing plug-in object.
inParameterName Name of parameter, as it appears in the plug-in editor's parameter list.
inSetEnabled Enabling flag.



  FlipHybMatrixObj Objects - Custom 
Vectorworks 2014

VectorScript Declaration:

PROCEDURE   FlipHybMatrixObj
(   ioHybMatObj :HANDLE;
    inFlipSpecifier :INTEGER
) ;

Python:

def  vs.FlipHybMatrixObj(ioHybMatObj, inFlipSpecifier):
   return None

Description:

inFlipSpecifier = 0 for flipH inFlipSpecifier = 1 for FlipV



  GetCustomObjectChoice Objects - Custom 
VectorWorks8.0

VectorScript Declaration:

FUNCTION   GetCustomObjectChoice
(   objectName :STRING;
    parameterName :STRING;
    choiceIndex :INTEGER
) :STRING ;

Python:

def  vs.GetCustomObjectChoice(objectName, parameterName, choiceIndex):
   return STRING

Description:

Function GetCustomObjectChoice returns a choice string of the specified plug-in object popup menu or radio group parameter. These parameters are displayed in the Object Info palette or the plug-in objects' creation dialog.

The string passed into the parameter name argument should use the parameter constant syntax, not the actual parameter name. The string should have the prefix character 'P', and should have all spaces replaced with underscore characters. For example, a parameter Jamb Depth would have a constant declared as PJAMB_DEPTH and therefore the parameter name argument to this function should be the string 'PJAMB_DEPTH'.

The choiceIndex parameter should be passed an integer between 1 and the number of choices, which can be determined by calling the NumCustomObjectChoices function.

Parameters:

objectName Name of the plugin object.
parameterName String indicating which parameter.
choiceIndex Index of desired choice.

Result:

Returns associated string of specified choice list item.

Example:

theChoice := GetCustomObjectChoice(objectName, 'PDINNER_MENU', 1);

See Also:

NumCustomObjectChoices  



  GetCustomObjectColor Objects - Custom 
VectorWorks 2008

VectorScript Declaration:

FUNCTION   GetCustomObjectColor
(   objectHand :HANDLE;
    inTagID :INTEGER;
  VAR  outColorIndex :INTEGER
) :BOOLEAN ;

Python:

def  vs.GetCustomObjectColor(objectHand, inTagID):
   return (BOOLEAN, outColorIndex)

Description:

Get an auxilary color index stored in'objectHand' previously with SetCustomObjectColor . Aplication will preserve the color mapped to inTagID.

Parameters:

objectHand Handle to object.

Result:

Returns TRUE if the operation was successful.

Example:

PROCEDURE Example;
VAR
	objName :STRING;
	objHand, recHand, wallHand :HANDLE;
	colorIndexBefore, colorIndexAfter :INTEGER;
	boo :BOOLEAN;
BEGIN
	IF GetCustomObjectInfo(objName, objHand, recHand, wallHand) THEN BEGIN
		RGBToColorIndex(pRed, pGreen, pBlue, colorIndexBefore);
		Rect(0, 0, 1, 1);
		SetFillBack(LNewObj, colorIndexBefore);
		IF SetCustomObjectColor(objHand, 1, colorIndexBefore) THEN BEGIN
			boo := GetCustomObjectColor(objHand, 1, colorIndexAfter);
			AlrtDialog(Concat('before: ', colorIndexBefore, Chr(13), 'after: ', colorIndexAfter));
		END;
	END;
END;
RUN(Example);

See Also:

SetCustomObjectColor  



  GetCustomObjectInfo Objects - Custom 
VectorWorks8.0

VectorScript Declaration:

FUNCTION   GetCustomObjectInfo
( VAR  objectName :STRING;
  VAR  objectHand :HANDLE;
  VAR  recordHand :HANDLE;
  VAR  wallHand :HANDLE
) :BOOLEAN ;

Python:

def  vs.GetCustomObjectInfo():
   return (BOOLEAN, objectName, objectHand, recordHand, wallHand)

Description:

Function GetCustomObjectInfo is used within plug-in object scripts to determine information about the object. Only returns false if the object is corrupt.

Parameters:

objectName Returns the name of the object.
objectHand Returns a handle to the plugin object in the drawing.
recordHand Returns a handle to the record containing current parameter values.
wallHand Returns a handle to a wall, (if this object is in a wall).

See Also:

IsNewCustomObject  



  GetCustomObjectPath Objects - Custom 
VectorWorks8.5

VectorScript Declaration:

FUNCTION   GetCustomObjectPath
( objectHand:HANDLE ) :HANDLE ;

Python:

def  vs.GetCustomObjectPath(objectHand):
   return HANDLE

Description:

Returns a handle to the path polygon of a path custom object.

Parameters:

objectHand Handle to object.

Result:

Returns a HANDLE to the path polygon.

See Also:

SetCustomObjectPath  



  GetCustomObjectProfileGroup Objects - Custom 
VectorWorks8.5

VectorScript Declaration:

FUNCTION   GetCustomObjectProfileGroup
( objectHand:HANDLE ) :HANDLE ;

Python:

def  vs.GetCustomObjectProfileGroup(objectHand):
   return HANDLE

Description:

Returns a handle to the profile group of a path custom object.

A path object has two "containers" for storing subordinate objects: the path, and the profile. As an example, if a path object is going to do an extrude along path, it will store the path in the path container, and the shape to be extruded in the profile container. The code within the object will then supply the handles to the path and the profile to the CreateExtrudeAlongPath call.

Parameters:

objectHand Handle to path custom object.

Result:

Returns a HANDLE to the profile group.

See Also:

SetCustomObjectProfileGroup  



  GetCustomObjectSelectionGroup Objects - Custom 
Vectorworks 2009

VectorScript Declaration:

FUNCTION   GetCustomObjectSelectionGroup
( objectHand:HANDLE ) :HANDLE ;

Python:

def  vs.GetCustomObjectSelectionGroup(objectHand):
   return HANDLE

Description:

Access the handle to selection group. This group contains geometry that defines the selection and pre-selection indication of this object.

Parameters:

objectHand Handle to custom object.

Result:

Returns a HANDLE to the selection group.



  GetCustomObjectWallHoleGroup Objects - Custom 
Vectorworks 2009

VectorScript Declaration:

FUNCTION   GetCustomObjectWallHoleGroup
( objectHand:HANDLE ) :HANDLE ;

Python:

def  vs.GetCustomObjectWallHoleGroup(objectHand):
   return HANDLE

Description:

Access the handle to wall hole group. This group contains geometry that defines the opening that will be cut into the wall for this parametric object.

Parameters:

objectHand Handle to custom object.

Result:

Returns a HANDLE to the wall hole group.



  GetLocalizedPluginChoice Objects - Custom 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   GetLocalizedPluginChoice
(   inPluginName :STRING;
    inParameterName :STRING;
    inChoiceIndex :INTEGER;
  VAR  outChoice :STRING
) :BOOLEAN ;

Python:

def  vs.GetLocalizedPluginChoice(inPluginName, inParameterName, inChoiceIndex):
   return (BOOLEAN, outChoice)

Description:

Returns true with outChoice as specified by inPluginName, inParameterName and inChoiceIndex. Each of the input names are universal names.

Parameters:

inPluginName The universal name of the plug-in.
inParameterName The universal name of the parameter.
inChoiceIndex The index of the requested choice. ( range is 1 to n)
outChoice The requested choice string.

Result:

Returns true if the function call succeeded.

See Also:

GetLocalizedPluginName  



  GetLocalizedPluginName Objects - Custom 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   GetLocalizedPluginName
(   inPluginName :STRING;
  VAR  outName :STRING
) :BOOLEAN ;

Python:

def  vs.GetLocalizedPluginName(inPluginName):
   return (BOOLEAN, outName)

Description:

Get the localized name of a plug-in given its universal name.

When Vectorworks plug-ins are localized by distributors in other countries, their names are translated to the appropriate language. The plug-in file stores both the original universal name and this translated localized name. The translated name is displayed by the Vectorworks user interface instead of the original name. If a script needs to display the name of a plug-in in a dialog or message then it should call this function to determine the localized name. (Note that scripts will use the universal name to specify a plug-in when the name is not being displayed to the user.)

If the plug-in has not been localized, then this function will return the universal name.

Parameters:

inPluginName Universal name of the plug-in.
outName The localized name of the plug-in

Result:

Returns true if the specified plug-in exists, and false if it is not found.

Example:

PROCEDURE Example;
TYPE
	plugin = STRUCTURE
		universalName :STRING;
		localizedName :STRING;
		params :ARRAY[1..99,1..2] OF STRING;
		popups :ARRAY[1..99,1..99] OF STRING;
	END;
VAR
	plugins :ARRAY[1..99] OF plugin;
	cnt1, cnt2, cnt3, pluginCnt :INTEGER;
	str1, str2, str3, str4 :STRING;
	boo :BOOLEAN;
	int1, int2 :INTEGER;
	
PROCEDURE GetInfo(h :HANDLE);
VAR
	recHand :HANDLE;
	recName :STRING;
BEGIN
	recHand := GetRecord(h, NumRecords(h));
	recName := GetName(recHand);
	FOR cnt1 := 1 TO pluginCnt DO 
		IF recName = plugins[cnt1].universalName 
			THEN cnt1 := pluginCnt + 2;
	IF cnt1 < pluginCnt + 2 THEN BEGIN
		boo := GetLocalizedPluginName(recName, str2);
		pluginCnt := pluginCnt + 1;
		plugins[pluginCnt].universalName := recName;
		plugins[pluginCnt].localizedName := str2;
		FOR cnt2 := 1 TO NumFields(recHand) DO BEGIN
			str1 := GetFldName(recHand, cnt2);
			int1 := GetFldType(recHand, cnt2);
			boo := GetLocalizedPluginParameter(recName, str1, str2);
			plugins[pluginCnt].params[cnt2, 1] := str1;
			plugins[pluginCnt].params[cnt2, 2] := str2;
			IF int1 = 8 THEN BEGIN
				FOR cnt3 := 1 TO NumCustomObjectChoices(recName, str1) DO BEGIN
					str3 := GetCustomObjectChoice(recName, str1, cnt3);
					boo := GetPluginChoiceIndex(recName, str1, str3, int2);
			  		boo := GetLocalizedPluginChoice(recName, str1, int2, str4);
			  		plugins[pluginCnt].popups[cnt2, cnt3] := Concat(str3, Chr(9), str4);
				END;
			END;
		END;
	END;
END;

BEGIN
	pluginCnt := 0;
	ForEachObject(GetInfo, (T=86));
	FOR cnt1 := 1 TO pluginCnt DO BEGIN
		WriteLn(plugins[cnt1].universalName, Chr(9), plugins[cnt1].localizedName);
		cnt2 := 1;
		WHILE plugins[cnt1].params[cnt2, 1] <> '' DO BEGIN
			WriteLn('    ', plugins[cnt1].params[cnt2, 1], Chr(9), plugins[cnt1].params[cnt2, 2]);
			cnt3 := 1;
			WHILE plugins[cnt1].popups[cnt2, cnt3] <> '' DO BEGIN
				WriteLn('        ', plugins[cnt1].popups[cnt2, cnt3]);
				cnt3 := cnt3 + 1;
			END;
			cnt2 := cnt2 + 1;
		END;
	END;
END;
RUN(Example);

See Also:

GetLocalizedPluginParameter   GetLocalizedPluginChoice  



  GetLocalizedPluginParameter Objects - Custom 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   GetLocalizedPluginParameter
(   inPluginName :STRING;
    inParameterName :STRING;
  VAR  outParameter :STRING
) :BOOLEAN ;

Python:

def  vs.GetLocalizedPluginParameter(inPluginName, inParameterName):
   return (BOOLEAN, outParameter)

Description:

Get the localized name of a plug-in parameter.

When Vectorworks plug-ins are localized by distributors in other countries, their parameter names are translated to the appropriate language. The plug-in file stores both the original universal name and this translated localized name for each parameter. The translated name is displayed by the Vectorworks user interface instead of the original name. If a script needs to display the name of a plug-in parameter in a dialog or message then it should call this function to determine the localized name. (Note that scripts will use the universal name to specify a plug-in parameter when the name is not being displayed to the user.)

If the plug-in has not been localized, then this function will return the universal name of the parameter.

Parameters:

inPluginName Universal name of the plug-in.
inParameterName Universal name of the parameter.
outParameter Localized name of the parameter.

Result:

Returns true if the specified plug-in exists, and false if it is not found.

See Also:

GetLocalizedPluginName  



  GetPluginChoiceIndex Objects - Custom 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   GetPluginChoiceIndex
(   inPluginName :STRING;
    inParameterName :STRING;
    inChoiceName :STRING;
  VAR  outIndex :INTEGER
) :BOOLEAN ;

Python:

def  vs.GetPluginChoiceIndex(inPluginName, inParameterName, inChoiceName):
   return (BOOLEAN, outIndex)

Description:

Returns true with outIndex as specified by inPluginNameand inParameterName. Each of the input names are universal names.

Parameters:

inPluginName The universal name of the plug-in.
inParameterName The universal name of the parameter.
inChoiceName The universal name of the choice.
outIndex The index of the requested choice. ( range is 1 to n)

Result:

Returns true if the function succeeded.



  GetPluginInfo Objects - Custom 
VectorWorks8.5

VectorScript Declaration:

FUNCTION   GetPluginInfo
( VAR  pluginName :STRING;
  VAR  recordHand :HANDLE
) :BOOLEAN ;

Python:

def  vs.GetPluginInfo():
   return (BOOLEAN, pluginName, recordHand)

Description:

Returns the name and attached parameter record of the currently executing plug-in. Use with menu command or tool item plug-ins.

Parameters:

pluginName Name of plug-in.
recordHand Handle to parameter record of plug-in.



  GetPluginString Objects - Custom 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   GetPluginString
( stringIndex:INTEGER ) :STRING ;

Python:

def  vs.GetPluginString(stringIndex):
   return STRING

Description:

Returns the string specified by stringIndex. The strings are created using the "Strings" button in the plug-in editor.

Parameters:

stringIndex The index of the string as represented in the plug-in editor.

Result:

The requested string.



  HasPlugin Objects - Custom 
VectorWorks10.0

VectorScript Declaration:

FUNCTION   HasPlugin
(   itemUniversalName :STRING;
  VAR  PaletteName :STRING
) :BOOLEAN ;

Python:

def  vs.HasPlugin(itemUniversalName):
   return (BOOLEAN, PaletteName)

Description:

Returns whether tool item or menu command is in current workspace.

Parameters:

itemUniversalName Universal name of the plug-in
PaletteName If plug-in is a tool, and is found in the workspace, the name of the palette in which it is contained will be returned in this parameter

Result:

Returns true if the plug-in is found in the workspace; false otherwise.



  IsNewCustomObject Objects - Custom 
VectorWorks8.0

VectorScript Declaration:

FUNCTION   IsNewCustomObject
( objectName:STRING ) :BOOLEAN ;

Python:

def  vs.IsNewCustomObject(objectName):
   return BOOLEAN

Description:

Function IsNewCustomObject returns whether the specified plug-in object is a new object, indicating that the object is being regenerated for the first time.


New object status is useful in specifying initialization and setup data, as well as calling initialization specific subroutines. This function should only be called in plug-in objects.



Parameters:

objectName Name of plugin object.

See Also:

GetCustomObjectInfo  



  IsPluginFormat Objects - Custom 
VectorWorks11.0

VectorScript Declaration:

FUNCTION   IsPluginFormat
( theFormat:HANDLE ) :BOOLEAN ;

Python:

def  vs.IsPluginFormat(theFormat):
   return BOOLEAN

Description:

Determines if the format node is used for the parameters of a plug-in object, plug-in tool or plug-in menu command.

Parameters:

theFormat Handle to the format node in question.

Result:

Returns true if format is used by a plug-in and false if it is a regular format that may have been created by the user.



  NumCustomObjectChoices Objects - Custom 
VectorWorks8.0

VectorScript Declaration:

FUNCTION   NumCustomObjectChoices
(   objectName :STRING;
    parameterName :STRING
) :INTEGER ;

Python:

def  vs.NumCustomObjectChoices(objectName, parameterName):
   return INTEGER

Description:

Function NumCustomObjectChoices returns the number of choice strings for a specified popup menu or radio group parameter in a plug-in object.

The string passed into the parameter name argument should use the parameter constant syntax, not the actual parameter name. The string should have the prefix character 'P', and should have all spaces replaced with underscore characters. For example, a parameter Jamb Depth would have a constant declared as PJAMB_DEPTH and therefore the parameter name argument to this function should be the string 'PJAMB_DEPTH'.

Parameters:

objectName Name of plugin object.
parameterName String indicating which parameter

Example:

maxChoices := NumCustomObjectChoices(objName, 'PDINNER_MENU');

See Also:

GetCustomObjectChoice  



  SetCustomObjectColor Objects - Custom 
VectorWorks 2008

VectorScript Declaration:

FUNCTION   SetCustomObjectColor
(   objectHand :HANDLE;
    inTagID :INTEGER;
    inColoIndex :INTEGER
) :BOOLEAN ;

Python:

def  vs.SetCustomObjectColor(objectHand, inTagID, inColoIndex):
   return BOOLEAN

Description:

Store/Set an auxilary color index in 'objectHand' so GetCustomObjectColor can access it later. Application will preserve the color mapped to inTagID.

Parameters:

objectHand Handle to object.

Result:

Returns TRUE if the operation was successful.

See Also:

GetCustomObjectColor  



  SetCustomObjectPath Objects - Custom 
VectorWorks8.5

VectorScript Declaration:

FUNCTION   SetCustomObjectPath
(   objectHand :HANDLE;
    path :HANDLE
) :BOOLEAN ;

Python:

def  vs.SetCustomObjectPath(objectHand, path):
   return BOOLEAN

Description:

Replaces the path of an existing path plug-in object. The path is used as-is; no translation of vertices is performed.

Parameters:

objectHand Handle to object.
path Handle to new path polygon.

Result:

Returns TRUE if the operation was successful.

See Also:

GetCustomObjectPath  



  SetCustomObjectProfileGroup Objects - Custom 
VectorWorks8.5

VectorScript Declaration:

FUNCTION   SetCustomObjectProfileGroup
(   objectHand :HANDLE;
    profileGroupHand :HANDLE
) :BOOLEAN ;

Python:

def  vs.SetCustomObjectProfileGroup(objectHand, profileGroupHand):
   return BOOLEAN

Description:

Sets the profile group for a path custom object.

Parameters:

objectHand Handle to object.
profileGroupHand Handle to profile group.

Result:

Returns TRUE if the operation was successful.

See Also:

GetCustomObjectProfileGroup  



  SetCustomObjectSelectionGroup Objects - Custom 
Vectorworks 2009

VectorScript Declaration:

FUNCTION   SetCustomObjectSelectionGroup
(   objectHand :HANDLE;
    selGroup :HANDLE
) :BOOLEAN ;

Python:

def  vs.SetCustomObjectSelectionGroup(objectHand, selGroup):
   return BOOLEAN

Description:

Set selection indication geometry for a parametric object.

Parameters:

objectHand Handle to parametric object.
selGroup Handle to object or group that contains geometry for selection indication.

Result:

Returns TRUE if the operation was successful.



  SetCustomObjectWallHoleGroup Objects - Custom 
Vectorworks 2009

VectorScript Declaration:

FUNCTION   SetCustomObjectWallHoleGroup
(   objectHand :HANDLE;
    holeGroup :HANDLE
) :BOOLEAN ;

Python:

def  vs.SetCustomObjectWallHoleGroup(objectHand, holeGroup):
   return BOOLEAN

Description:

Set wall hole geometry for a parametric object.

Parameters:

objectHand Handle to parametric object.
holeGroup Handle to object or group that contains geometry for wall hole.

Result:

Returns TRUE if the operation was successful.



  SetParameterVisibility Objects - Custom 
VectorWorks10.0

VectorScript Declaration:

PROCEDURE   SetParameterVisibility
(   inPlugin :HANDLE;
    inParameterName :STRING;
    inSetVisible :BOOLEAN
) ;

Python:

def  vs.SetParameterVisibility(inPlugin, inParameterName, inSetVisible):
   return None

Description:

For plug-in objects, this procedure sets whether or not the specified parameter is visible on the Object Info Palette. This routine is used inside plug-in object regeneration scripts to set their parameter visibility. This visibility is an object instance property.

Parameters:

inPlugin Handle to the currently executing plug-in object.
inParameterName Name of parameter, as it appears in the plug-in editor's parameter list.
inSetVisible The new visibility state for the parameter specified.