VS:FindFileInPluginFolder

From Vectorworks Developer
Jump to: navigation, search

.VectorScript|VectorScript ..VS:Function Reference|Function Reference ..VS:Function_Reference_Appendix|Appendix


Description

Searches for filename in all plug-in folders. Returns TRUE if the file is found, FALSE otherwise. If found, the result is returned in the path parameter.
FUNCTION FindFileInPluginFolder(
filename  :STRING;
VAR path  :STRING) : BOOLEAN;
def vs.FindFileInPluginFolder(filename):
    return (BOOLEAN, path)

Parameters

filename STRING
path STRING

Remarks

(Orso 2016.05.16): This routine behaves differently according to where the searched file is placed:
  • if a file is placed in the upper level of the User/Plug-ins folder this will always be found
  • if a file is placed anywhere else (for example in a subfolder within the User/Plug-ins folder or in the Workgroup/Plug-ins folder) the routine will
    • find a file only at VW launch (you need to restart VW to make the file be found)
    • nevertheless it will detect immediately if the searched file is missing


On the Mac, path will use colons instead of foreslashes as the folder delimiter.

Example

VectorScript

PROCEDURE Example;
VAR
filename, path :STRING;
BEGIN
filename := 'Callout.vso';
IF FindFileInPluginFolder(filename, path) 
THEN AlrtDialog(path)
ELSE AlrtDialog('Could not find file.');
END;
RUN(Example);

Python

def Example():
	filename = 'Callout.vso';
	ifFileExist, path = vs.FindFileInPluginFolder(filename) 
	if ifFileExist:
		vs.AlrtDialog(path)
	else: 
		vs.AlrtDialog('Could not find file.')
		
Example()

Version

Availability: from VectorWorks 12.0
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox