fillarea

# Fillarea (Tf) module

class vcs.fillarea.Tf(Tf_name=None, Tf_name_src='default')[source]

The Fillarea class allows the user to edit fillarea attributes, including fillarea interior style, style index, and color index.

This class is used to define an fillarea table entry used in VCS, or it can be used to change some or all of the fillarea attributes in an existing fillarea table entry.

Useful Functions:
# VCS Canvas Constructor
a=vcs.init()
# Show predefined fillarea objects
a.show('fillarea')
# Updates the VCS Canvas at user's request
a.update()
Create a fillarea object:
#Create a VCS Canvas object
a=vcs.init()

# Two ways to create a fillarea:

# Copies content of 'def37' to 'new'ea:
fa=a.createfillarea('new','def37')
# Copies content of 'default' to 'new'
fa=a.createfillarea('new')
Modify an existing fillarea:
fa=a.getfillarea('red')
  • Overview of fillarea attributes:

    • List all the fillarea attribute values

      fa.list()
      
    • There are three possibilities for setting the isofill style:

      fa.style = 'solid'
      fa.style = 'hatch'
      fa.style = 'pattern'
      
    • Setting index, color, opacity:

      # Range from 1 to 20
      fa.index=1
      # Range from 1 to 256
      fa.color=100
      # Range from 0 to 100
      fa.opacity=100
      
    • Setting the graphics priority viewport, worldcoordinate:

      fa.priority=1
      # FloatType [0,1]x[0,1]
      fa.viewport=[0, 1.0, 0,1.0]
      # FloatType [#,#]x[#,#]
      fa.worldcoordinate=[0,1.0,0,1.0]
      
    • Setting x and y values:

      #List of FloatTypes
      fa.x=[[0,.1,.2], [.3,.4,.5]]
      # List of FloatTypes
      fa.y=[[.5,.4,.3], [.2,.1,0]]
      
list()[source]

Lists the current values of object attributes

Example
>>> a=vcs.init()
>>> obj=a.getfillarea() # default
>>> obj.list() # print fillarea attributes
---------- ... ----------
...
script(script_filename=None, mode=None)[source]

Saves out a copy of the fillarea secondary method, in JSON or Python format to a designated file.

Note

If the the filename has a ‘.py’ at the end, it will produce a Python script. If no extension is given, then by default a .json file containing a JSON serialization of the object’s data will be produced.

Warning

VCS Scripts Deprecated. SCR script files are no longer generated by this function.

Example
>>> a=vcs.init()
>>> ex=a.getfillarea()
>>> ex.script('filename.py') # append to 'filename.py'
>>> ex.script('filename','w') # make/overwrite 'filename.json'
Parameters
  • script_filename (str) – Output name of the script file. If no extension is specified, a .json object is created.

  • mode (str) – Either ‘w’ for replace, or ‘a’ for append. Defaults to ‘a’, if not specified.