Last modified: December 2013

URL: https://cxc.cfa.harvard.edu/chips/ahelp/get_attribute.html
Jump to: Description · Examples · Bugs · See Also


AHELP for CIAO 4.11 ChIPS v1

get_attribute

Context: utilities

Synopsis

Retrieves attribute value(s) for an object.

Syntax

get_attribute([id,] object_type [,attribute])

Description

The function arguments.

Argument Description
id A ChipsId structure identifying the item, or a string containing the name of the object.
object_type The type of object to modify - e.g. chips_window, chips_curve, chips_line - as descrined in the Object Type section of "ahelp chipsopt".
attribute The name of the attribute to retrieve, such as 'style' or 'line.color'.

The get_attribute command retrieves the value of a specific attribute. If an attribute is not specified, the values of all attributes of the specified object are returned.

The command can only operate on a single object. An error is returned if currency is set to "all" and there are multiple versions of the object present.

Some values are set to "None" in the returned structure. These entries generally correspond to attributes which may only be modified at creation time, such as the object id.


Examples

Example 1

chips> crv = get_attribute(chips_curve)
chips> print(crv.symbol.color)
default

Retrieve a structure containing the attribute values of the current curve and store the results in "crv". The print call is used to examine either one of the fields, as above, or the whole strtucture, as below:

chips> print(crv)
baddata = 1
depth = 100
err.caplength = 10
err.color = default
err.down = False
...
symbol.fill = True
symbol.size = 5
symbol.style = 4

Example 2

chips> print(get_attribute("win1", chips_window, "display"))
True

Retrieve the display attribute value for the window called "win1".


Bugs

See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.

See Also

concepts
attributes, setget
utilities
set_attribute, set_cascading_property, set_current