PropertyValue

PropertyValue[{obj,item},name]
gives the property value associated with name for item in obj.

PropertyValue[{obj,itemspec},name]
gives the property values associated with name for items indicated by itemspec in obj.

PropertyValue[,{name1,name2,}]
gives a list of property values associated with , , etc.

DetailsDetails

  • Properties are used to store and manipulate pairs for specific named items within an object such as Graph, MeshRegion, and BoundaryMeshRegion.
  • The item specification itemspec typically has the form .
  • The index can typically have the following forms:
  • inda single index
    {ind1,ind2,}a list of indexes
    Allall possible indexes in collection
    pattindexes that match patt in collection
  • The collection can typically have the following forms:
  • cola single collection
    {col1,col2,}a list of collections
    Allall possible collections
    pattcollections that match patt
  • The item specification itemspec of the form collection refers to the default value for all indexes in the collection.
  • PropertyValue[{obj,itemspec},name] returns $Failed whenever there is no property value available for name.
  • PropertyValue[{obj,itemspec},name]=val can be used to modify the property value.
  • Objects that support properties include Graph, MeshRegion, and BoundaryMeshRegion. Item specifications for each type of object is given in their reference pages.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Generate a complete graph with properties:

In[1]:=
Click for copyable input
Out[1]=

Retrieve the property value associated with a property name:

In[2]:=
Click for copyable input
Out[2]=

Change the property value:

In[3]:=
Click for copyable input
In[4]:=
Click for copyable input
Out[4]=

Unset the property value:

In[5]:=
Click for copyable input
In[6]:=
Click for copyable input
Out[6]=
Introduced in 2010
(8.0)
| Updated in 2015
(10.2)
Translate this page: