Component object
s represent instances of symbols. They contain
other object
s copied from the original symbol when it is
instantiated into a schematic.
A component's basename is a string used to identify which symbol it originated from. When instantiating a symbol on initial placement in a schematic, or when recreating a component while loading a schematic, the basename is used to find the underlying symbol file in the component library.
See Component objects.
Note: In the gEDA C source code, these are normally called “complex” objects. However, as Guile Scheme supports complex numbers, and the procedures related to working with complex numbers use the word ‘complex’ to describe them, this API uses ‘component’ to avoid ambiguity.
The position, angle and mirror flag of a component indicates the transformation that was applied to the contents of the original symbol. The transformation is applied in the following order:
The component's contents (as returned by component-contents
)
have the transformation already applied to them. Updating the
translation information using e.g. set-component!
will not
alter them – that must be done separately (e.g. by reloading the
symbol).
Creates and returns a new, empty component
object
with the given basename. position, angle and mirror specify the symbol transformation. If locked is true, the component will be protected against accidental selection by the user (this is used in gschem e.g. for titleblocks).No attempt is made to load a symbol matching basename from component libraries, and the returned component is flagged as embedded.
Searches the component libraries for a symbol matching basename, and if found, instantiates the symbol and returns the resulting component (which is not flagged as embedded). Arguments are as for
make-component
.If no match for basename is found, ‘#f’ is returned.
Sets the parameters of component. Arguments are the same as to
make-component
. Returns component.Note: Remember that modifying the transformation parameters of a component does not update the component's contents.
Returns the parameters of component as a list of the form:
(basename (x . y) angle mirror locked)
Returns the position to which the original symbol was translated when creating component.
Returns the angle by which the original symbol was rotated when creating component, as an integer number of degrees.
Returns true if the original symbol was mirrored when creating component.
Appends objects (which must not be component
object
s) to the contents of component. Any objects which are already included in component are ignored. If any objects are already part of apage
or of another componentobject
, an ‘object-state’ error is raised. Returns component.
Removes objects from the contents of component. Any objects which are not part of a component or of a page are ignored. Returns component.
An ‘object-state’ error will be raised if any objects satisfy any of the following conditions:
- are part of a
page
;- are part of a component
object
other than component;- have attached attributes
- are attached as an attribute.