VS:GetFolderPath
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Function GetFolderPath returns the full path to the requested folder independent of localized folder names. It returns an empty string if the folder isn't found.
- Note
- 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~Slabs | 113 |
Stairs | 114 |
Sheet 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~Slabs - Hatches | 131 |
Walls~Slabs - 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 (obsolete as of VW16) |
140 |
Spaces - Space Name Lists and Libraries (obsolete as of VW16) |
141 |
Structural Shapes | 142 |
Attributes - Tile Fills | 163 |
Text Styles | 164 |
FUNCTION GetFolderPath(
whichPath :INTEGER) : STRING;
def vs.GetFolderPath(whichPath): return STRING
Parameters
whichPath INTEGER Path constant.
Remarks
[sd 8/18/98]:
Get folder path returns the fully qualified path with platform specific folder separators. On the Mac it returns the path with colons as the separator and uses the backslash on windows. If you are concatenating your own path on the end of a GetFolderPath return string you need to match the qualifier to the platform.
Orso [2007.06.17]: Always generates a minor alert if the path doesn't exist (VW 12.5.x). Can be annoying if user doesn't have "Display minor alerts on mode bar" on. Toggling the preference is also useless: by the end of the script, restoring user's preferences, the alert will be seen.
Orso [2007.06.21]: In order to access the user's settings folder use flag -15 (VW 12.5.x) alrtDialog(concat('User settings path: ', getFolderPath(-15))); Then I have no idea how to resolve eventual localizations of the SavedSettings.xml or SavedSettingsUser.xml file. I could find no string in the resources storing these file names. The SavedSettingsUser.xml can be accessed directly by GetSavedSetting/SetSavedSetting.
Orso [2008.03.29]: Since VW 13 the flag system has been expanded: negative flag number: user's folders (by default in Application Support) positive flag number: application folders (where the VW folder resides) The path defined with the flag (positive) 12 will point to the User's folder.
Example
VectorScript
PROCEDURE Example; BEGIN AlrtDialog(GetFolderPath(12)); END; RUN(Example);
Python
def Example(): vs.AlrtDialog(vs.GetFolderPath(12)) Example()
Version
Availability: from VectorWorks 8.0