SclSetNamedAttributeValue
Overview
This command allows you to set the value of a named attribute within a trisolation.
Synopsis
$TrisolationHandle SclSetNamedAttributeValue attributeName attributeValue
Description
If the specified attribute does not exist in the trisolation, a new attribute is created, and its value is set.
Arguments
| Argument | Description |
|---|---|
| $TrisolationHandle | Handle to the trisolation for which to set the named attribute. Passed by value. |
| attributeName | Name of the named attribute for which to set the value. Passed by value. |
| attributeValue | Value of the named attribute. Passed by value. |
Returns
Returns SCL_True if there are triobjects (or trisolations in the triobject) in the SWA.
Returns SCL_False if there are no triobjects (or trisolations in the triobject) in the SWA.
Examples
# For each trisolation in each triobject displayed in the active layer in Graphics,
# create an attribute called rocktype and set its value to quartz
# after running the macro you can use the Select Segment/Trisolation icon
# on the Tools toolbar to see the properties of each trisolation
# including the new rocktype attribute
SclGetActiveViewport ViewportHandle
$ViewportHandle SclGetActiveLayer SwaHandle
$SwaHandle SclGetTriobjects TriobjectsHandle
$TriobjectsHandle SclIterateFirst TriobjectsIterator
while {[$TriobjectsIterator SclIterateNext TriobjectHandle] == $SCL_TRUE} {
$TriobjectHandle SclIterateFirst TrisolationIterator
while {[$TrisolationIterator SclIterateNext TrisolationHandle] == $SCL_TRUE} {
$TrisolationHandle SclSetNamedAttributeValue rocktype quartz
}
}
puts "Each trisolation in the active layer now has an 'rocktype' attribute with \
a value of 'quartz'."
puts "To confirm this, on the Tools toolbar, click Select Segment/Trisolation, \
select a trisolation in Graphics, and look in the Properties pane."
|