VS:CopySymbol

From Vectorworks Developer
Revision as of 21:53, 21 June 2019 by CBM-c- (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

.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:

  • Macintosh HD:Applications:VectorWorks:Plug-Ins:Data:Notes.txt
  • C:Program Files/VectorWorksPlug-Ins/DataNotes.txt

If the filename includes a path relative to the location of the VectorWorks executable, the subfolder delimiters have to be backslashes:

  • Plug-Ins\DataNotes.txt

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 Libraries\Office Equipment.vwx', theSymbolName)  THEN
		Symbol(theSymbolName, 0, 0, 0);
END;
RUN(CopySym);

Python

def CopySym():
	theSymbolName = 'Fax'
	if vs.CopySymbol('Object Libraries\Office Equipment.vwx', theSymbolName): 
		vs.Symbol(theSymbolName, 0, 0, 0)
CopySym()

Version

Availability: from All Versions
Personal tools
NamespacesFFFF

Variants
Actions
Advanced Search
See Also
Navigation
Toolbox