Vr Mapping

ON-LINE REFERENCE DOCUMENTATION

CARDINAL SYSTEMS, LLC

www.cardinalsystems.net

Symbol Class Reference (PyVrSym)

Holds and manipulates VrOne symbol data. More…

Members

Init ()
Load (WsNum, SymNum, DispFlag=-1)
LoadLast ()
Rec (WsNum, DispFlag=-1)
ReRec (DispFlag=-1)
Del ()
Id (WsNum=-1)
GetWsNum ()
GetSymNum()
SetLayer (Layer)
SetGpoint (Gpoint)
SetPenNum (PenNum)
SetNpoint (Npoint)
SetLink (Link)
SetFc (Fc)
SetConstr (Constr)
SetRad (Rad)
SetRot (Rot)
SetCoord (x, y, z)
GetLayer ()
GetGpoint ()
GetPenNum ()
GetNpoint ()
GetLink ()
GetFc ()
GetConstr ()
GetRad ()
GetRot ()
GetFkeyParams (FkeyName)
GetCoord ()
ReRec ()
Plot ()
Erase ()

 


Description

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

Init ()

Initializes the symbol to default values. This is useful when reusing the symbol class.

 

Load (WsNum, SymNum)

Loads a symbol from disk.

WsNum

Workspace number (0-255).

SymNum

Symbol number.

returns

(ret)

 

ret

Loaded symbol number.

-1 = Workspace or symbol number out of range.

 

LoadLast ()

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.

returns

(ret)

 

ret

0 = OK.

-1 = No last symbol exists.

 

Rec (WsNum, DispFlag=-1)

Records a symbol at the end of a workspace.

WsNum

Number of workspace to which to record (0-255).

DispFlag

Optional display flag.

-1 = Do not condition.

0 = Do not display.

1 = Display.

returns

(ret)

 

 

ret

Symbol number.

-1 = Workspace number out of range.

 

ReRec (DispFlag=-1)

Re-records a previously loaded symbol by marking the original location as deleted and placing the symbol at the end of the workspace.

DispFlag

Optional display flag.

-1 = Do not condition.

0 = Do not display.

1 = Display.

returns

(ret)

 

ret

0 = OK.

-1 = Could not record symbol.

 

Del ()

Deletes a symbol by marking its layer number as a negative number on disk. Pack Vr removes deleted entities from a workspace.

returns

(ret)

 

ret

0 = OK.

1 = Could not delete symbol. Symbol was never loaded.

 

Id (WsNum=-1)

Allows interactive symbol selection. Returns a symbol number that may be used to load the symbol from disk.

WsNum

Number of workspace to search (0-255).

-1 = Search all open workspaces.

returns

(ret)

 

ret

Symbol number selected.

-1 = Symbol not selected.

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()

GetWsNum ()

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.

returns

(ret)

 

ret

Workspace number (0-255).

-1 = Symbol was never loaded from disk.

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()

GetSymNum ()

When a symbol is loaded, its symbol number is stored in the object. Gets this number.

returns

(ret)

 

ret

Symbol number.

-1 = Symbol was never loaded from disk.

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()

SetLayer (Layer)

Sets the symbol's layer.

Layer

Layer number (1-10001)

 

SetGpoint (Gpoint)

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.

Gpoint

Symbol graphic pointer (1-1000)

 

SetPenNum (PenNum)

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.

PenNum

Pen number (1-256).

 

SetNpoint (Npoint)

Sets the symbol's non-graphic pointer.

Npoint

Non-graphic pointer (-2,147,483,648 to 2,147,483,648).

 

SetLink (Link)

Sets the symbol's link.

Link

Symbol link (-2,147,483,648 to 2,147,483,648).

 

SetFc (Fc)

Sets the symbol's Feature Code.

Fc

Feature code (up to 48 characters).

 

SetConstr (Constr)

Sets the symbol's Construction display. The display of Symbols that have their construction flags set to 1 may be turned off.

Constr

Construction flag.

0 = On.

1 = Off.

 

SetRad (Rad)

Sets the symbol radius.

Rad

Symbol radius in ground units (double precision).

 

SetRot (Rot)

Sets the symbol rotation. The rotation is counterclockwise with zero along the X-axis.

Rot

Symbol rotation in degrees (double precision).

 

SetCoord (x, y, z)

Sets the symbol coordinate value.

X,y,z

Symbol coordinate values (double precision).

 

GetLayer ()

Gets the symbol's layer.

returns

(ret)

 

ret

Layer number (1-10001). A return layer of 0 or less represents a deleted entity.

 

GetGpoint ()

Returns the symbol's graphic pointer. The graphic pointer determines the graphic representation of a Symbol, like a fence or a tree symbol.

returns

(ret)

 

ret

Symbol graphic pointer (1-1000).

 

GetPenNum ()

Returns the symbol's pen number. The pen number determines the color to use when drawing a symbol.

returns

(ret)

 

ret

Symbol pen number (1-256).

 

GetNpoint ()

Returns the symbol's non-graphic pointer.

returns

(ret)

 

ret

Symbol non-graphic pointer number (-2,147,483,648 to 2,147,483,648).

GetLink ()

Returns the symbol's link.

returns

(ret)

 

ret

Symbol link number (-2,147,483,648 to 2,147,483,648).

 

GetFc ()

Returns the symbol's feature code.

returns

(ret)

 

ret

Symbol feature code (up to 48 characters).

 

GetConstr ()

Returns the construction flag of the symbol. The display of symbols that have their construction flags set to 1 may be turned off.

returns

(ret)

 

ret

Symbol construction flag (0-1).

 

GetRad ()

Returns the symbol's radius.

returns

(ret)

 

ret

Radius in ground units.

 

GetRot ()

Returns the symbol's rotation. The rotation is counterclockwise with zero along the X-axis.

returns

(ret)

 

ret

Symbol rotation in degrees.

 

GetFkeyParams (FkeyName)

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.

FkeyName

Function key name.

returns

(ret)

 

 

ret

0 = OK.

-1 = Function key does not exist.

 

GetCoord ()

Returns a coordinate value from the symbol

returns

(x,y,z)

 

 

ret

Symbol coordinate value (double precision).

ReRec ()

Re-records the symbol on disk.

 

Plot ()

Plots the symbol to all open graphics devices. The current header parameters are used.

 

Erase ()

Erases the symbol from all open graphics devices.