VS:GetFolder: Difference between revisions
Jump to navigation
Jump to search
m (1 revision) |
(expand) |
||
(4 intermediate revisions by the same user not shown) | |||
Line 5: | Line 5: | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<desc> | <desc> | ||
Gets the path to a user selected folder</desc> | |||
</desc> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<def> | <def> | ||
<funcDef lang="vs"> | <funcDef lang="vs"> | ||
FUNCTION GetFolder(promptStr :STRING; VAR directoryPath :STRING) :INTEGER; | FUNCTION GetFolder(promptStr:STRING; VAR directoryPath:STRING) : INTEGER; | ||
</funcDef> | </funcDef> | ||
<funcDef lang="py"> | <funcDef lang="py"> | ||
Line 30: | Line 29: | ||
directoryPath | directoryPath | ||
STRING | STRING | ||
</line> | </line> | ||
</lineList> | </lineList> | ||
</params> | </params> | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<remark> | <remark> | ||
([[User:Orso.b.schmid|Orso]], 2014.03.25): This was hidden since VW 10 (NOT 2010!), so the compatibility is far more than VW 2014 only. | |||
Prompts for the selection of a folder. Defaults to the folder name in the argument list. Returns 0 if the user hits OK, and -1 if the user hits cancel. The starting VAR directoryPath is overwritten with the path of the chosen folder | |||
</remark> | </remark> | ||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<sample> | <sample> | ||
<code lang="pas"> | See [[Python Sample Import Images as Symbols]] for example. | ||
PROCEDURE Example; | |||
<code lang="pas">PROCEDURE Example; | |||
VAR | VAR | ||
promptStr :STRING; | |||
directoryPath :STRING; | |||
result :INTEGER; | |||
BEGIN | BEGIN | ||
promptStr := 'Select the folder...'; | |||
directoryPath := GetFolderPath(3); | |||
result := GetFolder(promptStr, directoryPath); | |||
Message(directoryPath); | |||
END; | END; | ||
Run(Example);</code> | Run(Example);</code> | ||
</sample> | |||
</ | ----------------------------------------------------------------------------------------------------------- | ||
<seeAlso></seeAlso> | |||
----------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------- | ||
<version> | <version> | ||
Availability: from | Availability: from Vectorworks 2014 | ||
</version> | </version> | ||
</vwDoc> | </vwDoc> |
Revision as of 17:41, 20 September 2014
.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix
Description
Gets the path to a user selected folder
FUNCTION GetFolder(
promptStr :STRING;
VAR directoryPath :STRING) : INTEGER;
def vs.GetFolder(promptStr): return (INTEGER, directoryPath)
Parameters
promptStr STRING directoryPath STRING
Remarks
(Orso, 2014.03.25): This was hidden since VW 10 (NOT 2010!), so the compatibility is far more than VW 2014 only.
Prompts for the selection of a folder. Defaults to the folder name in the argument list. Returns 0 if the user hits OK, and -1 if the user hits cancel. The starting VAR directoryPath is overwritten with the path of the chosen folder
Example
See Python Sample Import Images as Symbols for example.
PROCEDURE Example; VAR promptStr :STRING; directoryPath :STRING; result :INTEGER; BEGIN promptStr := 'Select the folder...'; directoryPath := GetFolderPath(3); result := GetFolder(promptStr, directoryPath); Message(directoryPath); END; Run(Example);
Version
Availability: from Vectorworks 2014