TXLWizard.Patterns.Reference

Implements a class for Pattern objects of type Reference (SREF).

Renders a copy of the referenced structure.

Classes

Reference(ReferencedStructureID, ...) Implements a class for Pattern objects of type Reference.
class TXLWizard.Patterns.Reference.Reference(ReferencedStructureID, OriginPoint, **kwargs)[source]

Bases: TXLWizard.Patterns.AbstractPattern.AbstractPattern

Implements a class for Pattern objects of type Reference.

Corresponds to the TXL command SREF.

Renders a copy of the structure identified by ReferencedStructureID at OriginPoint.

Parameters:
  • ReferencedStructureID (str) – ID of the structure being referenced to
  • OriginPoint (list of float) – x- and y-coordinates of the starting point
  • **kwargs – keyword arguments passed to the TXLWizard.Patterns.AbstractPattern.AbstractPattern constructor. Can specify attributes of the current pattern.

Examples

Import required modules

>>> import TXLWizard.TXLWriter

Initialize TXLWriter

>>> TXLWriter = TXLWizard.TXLWriter.TXLWriter()

Create Content Structure for Circle that will be reused. Could also be a definition structure.

>>> CircleStructure = TXLWriter.AddContentStructure('MyCircleID')
>>> CircleStructure.AddPattern(
...     'Circle',
...     Center=[0, 0],
...     Radius=50,
...     Layer=1
... ) 
<TXLWizard.Patterns.Circle.Circle object at 0x...>

Create copy of the content structure above.

>>> CircleCopy = TXLWriter.AddContentStructure('MyCircleCopy')
>>> CircleCopy.AddPattern(
...     'Reference',
...     ReferencedStructureID=CircleStructure.ID,
...     OriginPoint=[40,60]
... ) 
<TXLWizard.Patterns.Reference.Reference object at 0x...>

Generate Files

>>> TXLWriter.GenerateFiles('Tests/Results/Patterns/Reference')
ReferencedStructureID = None

str – ID of the structure being referenced to

Type = None

str – specifies the type of the pattern. Set to ‘Reference’