| AddResourceToList | Document List Handling VectorWorks12.0 |
VectorScript Declaration:
FUNCTION AddResourceToList
( listID :LONGINT; resource :HANDLE ) :LONGINT ; Python:
return LONGINT
def vs.AddResourceToList(listID, resource): Description:
Adds the indicated resource to the specified resource list, if it is of the same type as the items already in the list. Returns the index of the resource in the list or 0.Parameters:
listID an ID for a resource list created by the BuildResourceList command. resource a resource to add to the resource list. Example:
{ 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);
| BuildResourceList | Document List Handling VectorWorks12.0 |
VectorScript Declaration:
FUNCTION BuildResourceList
( type :INTEGER; folderIndex :INTEGER; subFolderName :STRING; VAR numItems :LONGINT ) :LONGINT ; Python:
return (LONGINT, numItems)
def vs.BuildResourceList(type, folderIndex, subFolderName): Description:
Creates an implicit list of resources of a specified type, and returns an ID for the list. Values in the list can be retrieved using GetNameFromResourceList.
If the Display Default Content preference (#130) is on and folderIndex is not 0, it will also include all the resources of the specified type in all the files in the selected folder.
If folderIndex is positive, the list will include all the resources of that type from the current document, as well as from the specified folder. If folderIndex is 0, only the resources in the current document will be in the list. If folderIndex is negative, only the resources in the specified folder will be in the list.
A complete listing of supported object types may be found in the Appendix.
Table - Folder Path Selectors
Note that use of the negative values of these constants can be used to get the user-based folder path. The positive values are for application-based paths, which should not be used for writing.
Folder Name Constant Application 1 Plug-Ins 2 Workspaces 4 Templates 7 Standards 8 Help 9 Dictionaries 10 User App Data 12 Libraries 13 Defaults 14 Settings 15 PDF Resources 18 Plug-In Data 20 Plug-In Includes 21 Plug-In interfaces 22 Favorites 23 Renderworks - Textures 100 Cabinet - Handles 101 Door - Hardware 102 Attributes - Gradients 103 Hardscape - Hatches 104 Attributes - Hatches 105 Attributes - Image Fills 106 Plants 107 Toilet Stall - Fixtures 108 RenderWorks - Backgrounds 109 Seating Layout - Symbols 110 Tile - Symbols 111 Human Figure - Textures 112 Walls 113 Stairs 114 Drawing Border - Title Blocks 115 Section - Markers 116 Repetitive Unit 117 Door - Custom Leaves 118 Lighting Instrument - Gobos 119 Reports~Schedules 120 Lighting Instrument - Symbols 121 Plants - Hatches 124 Repetitive Unit: Flooring/Decking 125 Repetitive Unit: Framing 126 Repetitive Unit: Masonry Units 127 Repetitive Unit: Miscellaneous 128 Repetitive Unit: Roofing 129 Repetitive Unit: Siding 130 Walls - Hatches 131 Walls - Textures 132 Window - Custom Shutters 133 Sketch Styles 134 Plant Database 135 VW Plants 136 Color Palettes 137 Framing Member - Custom Profile 138 Spaces - Occupant Organization Name Lists 140 Spaces - Space Name Lists and Libraries 141 Structural Shapes 142 Parameters:
type the type of resource to put in the list folderIndex the index of a VW folder. subFolderName the name of a subfolder inside the folder specified by folderIndex. This can also be a partial path. Use an empty string to request the resources from all files in the folderIndex folder. numItems the number of items in the list built Example:
const kHatch = 66; kDefHatchFolder = 105; var listID, numItems: LONGINT; begin { Create a resource list of hatches from the current document and } { the default hatch folder. } listID := BuildResourceList(kHatch, kDefHatchFolder, '', numItems);See Also:
AddResourceToList DeleteResourceFromList GetNameFromResourceList GetResourceFromList ImportResourceToCurrentFile
| BuildResourceList2 | Document List Handling Vectorworks 2014 |
VectorScript Declaration:
FUNCTION BuildResourceList2
( type :INTEGER; folderIndex :INTEGER; subFolderName :STRING; VAR numItems :LONGINT; useDefaultContent :BOOLEAN ) :LONGINT ; Python:
return (LONGINT, numItems)
def vs.BuildResourceList2(type, folderIndex, subFolderName, useDefaultContent): Description:
Creates an implicit list of resources of a specified type, and returns an ID for the list. Values in the list can be retrieved using GetNameFromResourceList.
If the Display Default Content preference (#130) is on and folderIndex is not 0, it will also include all the resources of the specified type in all the files in the selected folder.
If folderIndex is positive, the list will include all the resources of that type from the current document, as well as from the specified folder. If folderIndex is 0, only the resources in the current document will be in the list. If folderIndex is negative, only the resources in the specified folder will be in the list.
A complete listing of supported object types may be found in the Appendix.
Table - Folder Path Selectors
Note that use of the negative values of these constants can be used to get the user-based folder path. The positive values are for application-based paths, which should not be used for writing.
Folder Name Constant Application 1 Plug-Ins 2 Workspaces 4 Templates 7 Standards 8 Help 9 Dictionaries 10 User App Data 12 Libraries 13 Defaults 14 Settings 15 PDF Resources 18 Plug-In Data 20 Plug-In Includes 21 Plug-In interfaces 22 Favorites 23 Renderworks - Textures 100 Cabinet - Handles 101 Door - Hardware 102 Attributes - Gradients 103 Hardscape - Hatches 104 Attributes - Hatches 105 Attributes - Image Fills 106 Plants 107 Toilet Stall - Fixtures 108 RenderWorks - Backgrounds 109 Seating Layout - Symbols 110 Tile - Symbols 111 Human Figure - Textures 112 Walls 113 Stairs 114 Drawing Border - Title Blocks 115 Section - Markers 116 Repetitive Unit 117 Door - Custom Leaves 118 Lighting Instrument - Gobos 119 Reports~Schedules 120 Lighting Instrument - Symbols 121 Plants - Hatches 124 Repetitive Unit: Flooring/Decking 125 Repetitive Unit: Framing 126 Repetitive Unit: Masonry Units 127 Repetitive Unit: Miscellaneous 128 Repetitive Unit: Roofing 129 Repetitive Unit: Siding 130 Walls - Hatches 131 Walls - Textures 132 Window - Custom Shutters 133 Sketch Styles 134 Plant Database 135 VW Plants 136 Color Palettes 137 Framing Member - Custom Profile 138 Spaces - Occupant Organization Name Lists 140 Spaces - Space Name Lists and Libraries 141 Structural Shapes 142 Parameters:
type the type of resource to put in the list folderIndex the index of a VW folder. subFolderName the name of a subfolder inside the folder specified by folderIndex. This can also be a partial path. Use an empty string to request the resources from all files in the folderIndex folder. numItems the number of items in the list built useDefaultContent determine if the list should contain default content See Also:
BuildResourceList BuildResourceListN BuildResourceListN2 AddResourceToList DeleteResourceFromList GetNameFromResourceList GetResourceFromList ImportResourceToCurrentFile
| BuildResourceListN | Document List Handling Vectorworks 2013 |
VectorScript Declaration:
FUNCTION BuildResourceListN
( type :INTEGER; fullPath :DYNARRAY[] of CHAR; VAR numItems :LONGINT ) :LONGINT ; Python:
return (LONGINT, numItems)
def vs.BuildResourceListN(type, fullPath): Description:
Build a resource list from the specified file.Parameters:
type the type of resource to put in the list fullPath The path to the file that provides the resources. numItems the number of items in the list built See Also:
BuildResourceList
| BuildResourceListN2 | Document List Handling Vectorworks 2014 |
VectorScript Declaration:
FUNCTION BuildResourceListN2
( type :INTEGER; fullPath :DYNARRAY[] of CHAR; VAR numItems :LONGINT; useDefaultContent :BOOLEAN ) :LONGINT ; Python:
return (LONGINT, numItems)
def vs.BuildResourceListN2(type, fullPath, useDefaultContent): Description:
Build a resource list from the specified file.Parameters:
type the type of resource to put in the list fullPath The path to the file that provides the resources. numItems the number of items in the list built useDefaultContent determine if the list should contain default content See Also:
BuildResourceListN BuildResourceList BuildResourceList2
| DeleteResourceFromList | Document List Handling VectorWorks12.0 |
VectorScript Declaration:
PROCEDURE DeleteResourceFromList
( listID :LONGINT; index :LONGINT ) ; Python:
return None
def vs.DeleteResourceFromList(listID, index): Description:
Deletes the indicated object in the specified resource list.Parameters:
listID an ID for a resource list created by the BuildResourceList function. index an index into the list. Example:
hatchName := GetNameFromResourceList(listID, index); if (pos('P', hatchName) = 1) then DeleteResourceFromList(listID, index)
| FActLayer | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION FActLayer
:HANDLE ; Python:
return HANDLE
def vs.FActLayer(): Description:
Function FActLayer returns a handle to the first object on the active layer. If the object does not exist, the function returns NIL.
| FIn3D | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION FIn3D
( objectHd:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.FIn3D(objectHd): Description:
Function FIn3D returns a handle to the first component object in the referenced 3D object definition.Parameters:
objectHd Handle to object.
| FInFolder | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION FInFolder
( sfHd:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.FInFolder(sfHd): Description:
Function FInFolder returns a handle to the first object in the referenced symbol folder. The object can be either a symbol definition or a nested symbol folder.
If the folder is empty, the function returns NIL.
Parameters:
sfHd Handle to symbol definition or symbol folder.
| FInGroup | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION FInGroup
( ObjectHd:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.FInGroup(ObjectHd): Description:
Function FInGroup returns a handle to the first component object of the referenced group.
Parameters:
ObjectHd Handle to group object. Example:
PROCEDURE Example; VAR h :HANDLE; BEGIN h := FInGroup(FSActLayer); WHILE h <> NIL DO BEGIN SetClass(h, 'None'); h := NextObj(h); END; END; RUN(Example);
| FInLayer | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION FInLayer
( h:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.FInLayer(h): Description:
Function FInLayer returns a handle to the first object within the referenced layer. If the layer is empty, the function returns NIL.
Parameters:
h Handle to layer.
| FInSymDef | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION FInSymDef
( sdHd:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.FInSymDef(sdHd): Description:
Function FInSymDef returns a handle to the first component object within the referenced symbol definition.
Parameters:
sdHd Handle to symbol definition.
| FObject | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION FObject
:HANDLE ; Python:
return HANDLE
def vs.FObject(): Description:
Function FObject returns a handle to the first object in the active document. If the document is empty, the function returns NIL.
| FSActLayer | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION FSActLayer
:HANDLE ; Python:
return HANDLE
def vs.FSActLayer(): Description:
Function FSActLayer returns a handle to the first selected object on the active layer. If no objects are selected, the function returns NIL.
| FSObject | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION FSObject
( h:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.FSObject(h): Description:
Function FSObject returns the handle to the first selected object in the referenced layer. If no objects are selected, the function returns NIL.
Parameters:
h Handle to layer.
| FSymDef | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION FSymDef
:HANDLE ; Python:
return HANDLE
def vs.FSymDef(): Description:
Function FSymDef returns a handle to the first symbol definition in the current document's symbol library. If the symbol library is empty, the function returns NIL.
| GetActualNameFromResourceList | Document List Handling VectorWorks12.0 |
VectorScript Declaration:
FUNCTION GetActualNameFromResourceList
( listID :LONGINT; index :LONGINT ) :STRING ; Python:
return STRING
def vs.GetActualNameFromResourceList(listID, index): Description:
Returns the actual name of the indicated item in the specified resource list. This call will delete the filename that is appended for resources with same name from different files.
Parameters:
listID an ID for a resouce list created by the BuildResourceList function. index an index into the list. Example:
displayName := GetActualNameFromResourceList(listID, index);See Also:
GetNameFromResourceList
| GetNameFromResourceList | Document List Handling VectorWorks12.0 |
VectorScript Declaration:
FUNCTION GetNameFromResourceList
( listID :LONGINT; index :LONGINT ) :STRING ; Python:
return STRING
def vs.GetNameFromResourceList(listID, index): Description:
Returns the name to display of the indicated item in the specified resource list. If the list has items with the same name from different files, the display name will have the filename added to it in parentheses.Parameters:
listID an ID for a resouce list created by the BuildResourceList function. index an index into the list. Example:
hatchName := GetNameFromResourceList(listID, index); if (pos('P', hatchName) = 1) then DeleteResourceFromList(listID, index)See Also:
GetActualNameFromResourceList
| GetResourceFromList | Document List Handling VectorWorks12.0 |
VectorScript Declaration:
FUNCTION GetResourceFromList
( listID :LONGINT; index :LONGINT ) :HANDLE ; Python:
return HANDLE
def vs.GetResourceFromList(listID, index): Description:
Returns the indicated resource from the indicated resource list, if the resource is in the current document. Otherwise it returns nil.Parameters:
listID an ID for a resource list created by the BuildResourceList command. index an index into the list. Example:
hatch := GetResourceFromList(listID, index); if (hatch = NIL) then hatch := ImportResourceToCurrentFile(listID, index);
| ImportResourceToCurrentFile | Document List Handling VectorWorks12.0 |
VectorScript Declaration:
FUNCTION ImportResourceToCurrentFile
( listID :LONGINT; index :LONGINT ) :HANDLE ; Python:
return HANDLE
def vs.ImportResourceToCurrentFile(listID, index): Description:
Imports the indicated resource from the specified list to the current file, if it is not already in the current file, and returns the handle to the resource.Parameters:
listID an ID for a resource list created by the BuildResourceList command. index an index into the list. Example:
hatch := GetResourceFromList(listID, index); if (hatch = NIL) then hatch := ImportResourceToCurrentFile(listID, index);
| ImportResToCurFileN | Document List Handling Vectorworks 2014 |
VectorScript Declaration:
FUNCTION ImportResToCurFileN
( listID :LONGINT; index :LONGINT; callback :PROCEDURE ) :HANDLE ; Python:
return HANDLE
def vs.ImportResToCurFileN(listID, index, callback): Description:
Imports the indicated resource from the specified list to the current file, if it is not already in the current file, and returns the handle to the resource. It will use a callback function to determine how to handle duplicate resouce.
| LActLayer | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION LActLayer
:HANDLE ; Python:
return HANDLE
def vs.LActLayer(): Description:
Function LActLayer returns a handle to the last object in the active layer.
| LNewObj | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION LNewObj
:HANDLE ; Python:
return HANDLE
def vs.LNewObj(): Description:
Returns a handle to the last object created by a VectorScript function call during the current script execution.
Result:
Returns a HANDLE to the most recently created object, otherwise returns NIL.
| LObject | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION LObject
:HANDLE ; Python:
return HANDLE
def vs.LObject(): Description:
Function LObject returns a handle to the last object in the active document.
| LSActLayer | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION LSActLayer
:HANDLE ; Python:
return HANDLE
def vs.LSActLayer(): Description:
Function LSActLayer returns a handle to the last selected object on the active layer. If no objects are selected, the function returns NIL.
| NextDObj | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION NextDObj
( h:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.NextDObj(h): Description:
Function NextDObj returns the next deselected object after the referenced object in a list. If the end of the list is reached, the function returns NIL.
Parameters:
h Handle to object. Example:
handleToObject:=FObject; WHILE handleToObject <> NIL DO BEGIN SetSelect(handleToObject); handleToObject:=NextDObj(handleToObject); END; { selects all deselected objects }
| NextLayer | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION NextLayer
( h:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.NextLayer(h): Description:
Function NextLayer returns a handle to the next layer in the document after the referenced. If the end of the list has been reached, the function returns NIL.
Parameters:
h Handle to layer. Example:
handleToLayer:=FLayer; WHILE handleToLayer <> NIL DO BEGIN SysBeep; handleToLayer:=NextLayer(handleToLayer); END; { will process through all the layers in the list }
| NextObj | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION NextObj
( h:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.NextObj(h): Description:
Function NextObj returns the next object in any list . If the end of the list is reached, the function returns NIL. This procedure can be used with other handle routines such as FirstIn3D,FInGroup, FirstInSymDef, or FLayer.
Parameters:
h Handle to object, group, or symbol definition. Example:
handleToObject:=FObject; WHILE handleToObject <> NIL DO BEGIN i:=i+1; handleToObject:=NextObj(handleToObject); END;
| NextSObj | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION NextSObj
( h:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.NextSObj(h): Description:
Function NextSObj returns the next selected object in a list. If the end of the list is reached, the function returns NIL.
Parameters:
h Handle to object.
| NextSymDef | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION NextSymDef
( symHd:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.NextSymDef(symHd): Description:
Function NextSymDef returns a handle to the next definition in the symbol library after the referenced symbol. If the end of the list has been reached, the function returns NIL.
Parameters:
symHd Handle to symbol definition in library.
| PrevDObj | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION PrevDObj
( h:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.PrevDObj(h): Description:
Function PrevDObj returns the previous deselected object in a list of objects . If the end of the object list is reached, the function returns NIL.
Parameters:
h Handle to object.
| PrevLayer | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION PrevLayer
( h:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.PrevLayer(h): Description:
Function PrevLayer returns a handle to the layer in the document preceding the referenced layer.Parameters:
h Handle to layer.
| PrevObj | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION PrevObj
( h:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.PrevObj(h): Description:
Function PrevObj returns the object in any list which precedes the specified object. If the end of the list is reached, the function returns NIL.
Parameters:
h Handle to object, group, or symbol definition.
| PrevSObj | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION PrevSObj
( h:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.PrevSObj(h): Description:
Function PrevSObj returns the previous selected object in the list preceding the referenced object.
Parameters:
h Handle to object.
| PrevSymDef | Document List Handling MiniCAD |
VectorScript Declaration:
FUNCTION PrevSymDef
( symHd:HANDLE ) :HANDLE ; Python:
return HANDLE
def vs.PrevSymDef(symHd): Description:
Function PrevSymDef returns a handle to the symbol definition in the symbol library preceding the referenced definition.
Parameters:
symHd Handle to symbol definition.
| ResourceListSize | Document List Handling VectorWorks12.0 |
VectorScript Declaration:
FUNCTION ResourceListSize
( listID:LONGINT ) :LONGINT ; Python:
return LONGINT
def vs.ResourceListSize(listID): Description:
Returns the number of items in the specified resource list.Parameters:
listID an ID for a resouce list created by the BuildResourceList function. Example:
{ Update numItems as the number of items in the resource list has } { changed. } numItems := ResourceListSize(listID);
| SetParent | Document List Handling VectorWorks10.0 |
VectorScript Declaration:
FUNCTION SetParent
( obj :HANDLE; container :HANDLE ) :BOOLEAN ; Python:
return BOOLEAN
def vs.SetParent(obj, container): Description:
Removes the object from its current container and places it within the given container. For example, SetParent can be used to put the referenced object into a group, or into a symbol definition, or to change the layer of the referenced object.Parameters:
obj Handle to the object to move. container Handle to the object that will become the parent of the obj variable. Example:
PROCEDURE SetParentExample; VAR h1, h2 :HANDLE; boo :BOOLEAN; BEGIN h1 := FSActLayer; h2 := NextObj(h1); boo := SetParent(h2, h1); END; RUN(SetParentExample);See Also:
CreateDuplicateObject