VS:BuildResourceList2
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
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.
- 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 |
FUNCTION BuildResourceList2(
TYPE :INTEGER;
folderIndex :INTEGER;
subFolderName :STRING;
VAR numItems :LONGINT;
useDefaultContent :BOOLEAN) : LONGINT;
def vs.BuildResourceList2(type, folderIndex, subFolderName, useDefaultContent): return (LONGINT, numItems)
Parameters
type INTEGER the type of resource to put in the list folderIndex INTEGER the index of a VW folder. subFolderName STRING 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 LONGINT the number of items in the list built useDefaultContent BOOLEAN determine if the list should contain default content
Remarks
_c_, 2016.02.29: Here some usage examples:resID := 127; { wall styles } pathID := 113; { Wall ~ Slabs folder } list := BuildResourceList2(resID, 0, '', cnt, FALSE); { current document } list := BuildResourceList2(resID, 0, '', cnt, TRUE); { current document } list := BuildResourceList2(resID, pathID, '', cnt, FALSE); { current document } list := BuildResourceList2(resID, pathID, '', cnt, TRUE); { app folder if def content = true } list := BuildResourceList2(resID, -pathID, '', cnt, FALSE); { returns nothing! } list := BuildResourceList2(resID, -pathID, '', cnt, TRUE); { user folder if def content = true }
Version
Availability: from Vectorworks 2014See Also
VS Functions:VS:BuildResourceList | VS:BuildResourceListN | VS:BuildResourceListN2 | VS:AddResourceToList | VS:DeleteResourceFromList | VS:GetNameFromResourceList | VS:GetResourceFromList | VS:ImportResourceToCurrentFile
[[VS:BuildResourceList]] | [[VS:BuildResourceListN]] | [[VS:BuildResourceListN2]] | [[VS:AddResourceToList]] | [[VS:DeleteResourceFromList]] | [[VS:GetNameFromResourceList]] | [[VS:GetResourceFromList]]
| [[VS:ImportResourceToCurrentFile]]