To use the functions described in this section, you will need to load
the (geda attrib)
module.
Attributes are text object
s with a particular format of string.
They can be floating, or they can be attached to another
object
.
Returns true if and only if object is an attribute (i.e. a text
object
and in attribute format).
Splits the string from text (a text
object
) into name and value, if it is in attribute format. If it is not in attribute format, raises an ‘attribute-format’ error. The return value is in the form ‘(name . value)’.
If attrib is attached to another
object
, returns that object. Otherwise, returns ‘#f’.
Attach attribs to object. All the attribs must be text
object
s. The following conditions must be satisfied, or an ‘object-state’ error will be raised:
- Neither object nor any of the attribs may be already attached as an attribute;
- Both object and all attribs must be part of the same
page
and/or componentobject
;Any attribs that are already attached to object are ignored. Returns object.
Note: For historical reasons,
attach-attribs!
does not require that all attribs satisfyattribute?
. Nevertheless, avoid attaching non-attribute text objects as attributes.
Detach attribs from object. Any attribs that are not attached as attributes are ignored. If any attribs are attached to
object
s other than object, an ‘object-state’ error is raised.
Inherited attributes are unattached attributes inside a
component object
.
Returns the inherited attributes of object, if object is a component. If object is not a component, returns the empty list.
promotable attributes are inherited attributes that are both
visible and have names that are in the list of promotable attributes
set with the always-promote-attributes
rc file parameter.
Promote all promotable attributes from component into the
page
that contains component. If component is not in a page, an ‘object-state’ error is raised.All promotable attributes are copied, and made invisible. The copies are added to the
page
, and attached as attributes of component.The promoted attributes are returned. If component is not in fact a component
object
, does nothing and returns the empty list.