You can use filtering to retrieve all materials in the document. Every Material object in the Document is identified by a unique name.
The following example illustrates how to use the material name to get material.
There are two ways to create a new Material object in the API.
When using the Duplicate() method, the returned Material object is the same type as the original.
Use the static method Material.Create() to add a new Material directly. No matter how it is applied, it is necessary to specify a unique name for the material and any assets belonging to the material. The unique name is the Material object key.
Document.Delete() is a generic method. See Editing Elements for details.