VS:CopySymbol: Difference between revisions

From Vectorworks Developer
Jump to navigation Jump to search
m (1 revision)
 
m (1 revision)
(No difference)

Revision as of 14:25, 12 August 2013

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

Description

Procedure CopySymbol will copy a symbol into the active document from a user specified source document.

If the filename includes a fully qualified path, the path has to use the appropriate notation for the local operating system:

<dir>Macintosh HD:Applications:VectorWorks:Plug-Ins:Data:Notes.txt</dir> <dir>C:Program FilesVectorWorksPlug-InsDataNotes.txt</dir> If the filename includes a path relative to the location of the VectorWorks executable, the subfolder delimiters have to be backslashes:

<dir>Plug-InsDataNotes.txt</dir> If the filename does not include a path, the file is assumed to exist in the same folder as the VectorWorks executable.

FUNCTION CopySymbol(
filePath :STRING;
symbol :STRING) : BOOLEAN;
def vs.CopySymbol(filePath, symbol):
    return BOOLEAN

Parameters

filePath STRING File path to document, relative to the application folder.
symbol STRING Name of symbol to import.

Return Value

Returns a BOOLEAN value indicating the success or failure of the import operation.

Example

VectorScript

PROCEDURE CopySym;
VAR
theSymbolName :STRING;
BEGIN
theSymbolName := 'Fax';
IF CopySymbol('Object LibrariesOffice Equipment.mcd', theSymbolName) 
THEN Symbol(theSymbolName, 0, 0, 0);
END;
RUN(CopySym);

Python

def CopySym():
	theSymbolName = 'Fax'
	if vs.CopySymbol('Object LibrariesOffice Equipment.mcd', theSymbolName): 
		vs.Symbol(theSymbolName, 0, 0, 0)
CopySym()

Version

Availability: from All Versions