Symbol Class Reference (PyVrSym) Holds and manipulates VrOne symbol data. More… Members
The VrOne/Python Symbol class is used to define VrOne Symbol data. A Symbol consists of a header and an xyz coordinate. An existing Symbol class may be loaded from the disk. Header information may be defined by a Python script or may be inherited from a VrOne Function Key. The user of this class should understand the VrOne Data Structure.
Example: # Loads all the symbols in the current workspace, change the layers # and graphic pointers and re-record them. # Filename: ChangeSymbols.py # WARNING: Changes data but is undoable
Ws = PyVrWs() # VrOne workspace manager object Sym = PyVrSym() # VrOne symbol object WsNum = Ws.Aws() # Current workspace
Ws.UndoBegin (WsNum, "ChangeSymbols") # Begin undo
for SymNum in range (0, Ws.GetSymCount (WsNum)):
Sym.Load (WsNum, SymNum) # Load symbol Sym.Erase() # Erase it from graphics Sym.SetLayer (23) # Change the layer Sym.SetGpoint (15) # Change the graphic pointer Sym.ReRec() # Re-record it Sym.Plot() # Re-plot it
Ws.UndoEnd (WsNum) # End undo
Member Function Documentation Initializes the symbol to default values. This is useful when reusing the symbol class.
Loads a symbol from disk.
Loads the last saved symbol. If a Python script is run as a Function Key’s OnEnd command it is possible for the script to further process the symbol that was just saved. See the AddCircle.py example.
Records a symbol at the end of a workspace.
Re-records a previously loaded symbol by marking the original location as deleted and placing the symbol at the end of the workspace.
Deletes a symbol by marking its layer number as a negative number on disk. Pack Vr removes deleted entities from a workspace.
Allows interactive symbol selection. Returns a symbol number that may be used to load the symbol from disk.
Example: # Select (Id) a symbol and print it Ws = PyVrWs() # VrOne workspace manager Sym = PyVrSym() # VrOne symbol object
if (Sym.Id() != -1): # Did we get a symbol? # Print some information about the symbol print "Layer ", Sym.GetLayer() print "Gpoint", Sym.GetGpoint() print "Coord ", Sym.GetCoord() When a symbol is loaded, the number of the workspace from which the symbol was loaded from is stored in the object. Gets this number.
Example: # Select (Id) a symbol and print it's Workspace and Symbol Number Ws = PyVrWs() # VrOne workspace manager Sym = PyVrSym() # VrOne symbol object
if (Sym.Id() != -1): # Did we get a symbol? print "Workspace ", Sym.GetWsNum() print "Symbol number", Sym.GetSymNum() When a symbol is loaded, its symbol number is stored in the object. Gets this number.
Example # Select (Id) a symbol and print it's Workspace and Symbol Number Ws = PyVrWs() # VrOne workspace manager Sym = PyVrSym() # VrOne symbol object
if (Sym.Id() != -1): # Did we get a symbol? print "Workspace ", Sym.GetWsNum() print "Symbol number", Sym.GetSymNum() Sets the symbol's layer.
Sets the graphic pointer of the symbol. The graphic pointer determines the graphic representation of a Symbol, like as a fence or a tree symbol.
Sets the symbol's pen number, which determines the color to use when drawing a Symbol. NOTE: If a Pen Table is active, this command has no effect.
Sets the symbol's non-graphic pointer.
Sets the symbol's link.
Sets the symbol's Feature Code.
Sets the symbol's Construction display. The display of Symbols that have their construction flags set to 1 may be turned off.
Sets the symbol radius.
Sets the symbol rotation. The rotation is counterclockwise with zero along the X-axis.
Sets the symbol coordinate value.
Gets the symbol's layer.
Returns the symbol's graphic pointer. The graphic pointer determines the graphic representation of a Symbol, like a fence or a tree symbol.
Returns the symbol's pen number. The pen number determines the color to use when drawing a symbol.
Returns the symbol's non-graphic pointer.
Returns the symbol's link.
Returns the symbol's feature code.
Returns the construction flag of the symbol. The display of symbols that have their construction flags set to 1 may be turned off.
Returns the symbol's radius.
Returns the symbol's rotation. The rotation is counterclockwise with zero along the X-axis.
Fills the Symbol header data from a previously defined VrOne function key. If the function key requested does not exist, the Symbol header is filled with default parameters.
Returns a coordinate value from the symbol
Re-records the symbol on disk.
Plots the symbol to all open graphics devices. The current header parameters are used.
Erases the symbol from all open graphics devices.
|