Harness proD API Help
EPLAN.Harness.API.DataStructures.Appearance Namespace / MaterialInfo Class
Members Example
In This Topic
    MaterialInfo Class
    In This Topic
    Information about material.
    Object Model
    MaterialInfo ClassTextProperty Class
    Inheritance Hierarchy

    System.Object
       EPLAN.Harness.API.DataStructures.BaseAppearanceInfo
          EPLAN.Harness.API.DataStructures.Appearance.MaterialInfo

    Syntax
    Example
    This example shows how to obtain a MaterialInfo from connected library for predefined materials.
    Project project = ...
    OccWdBundle occurrence = ...
    
    ActiveLibraryConnection activeLibrary = null;
    IEnumerable<MaterialInfo> materials = null;
    try
    {
    	activeLibrary = project.ActiveConnection;
    	if (activeLibrary == null)
    	{
    		materials = MaterialInfo.GetPredefinedMaterials();
    	}
    	else
    	{
    		materials = activeLibrary.GetMaterials();
    	}
    }
    catch (API.Exceptions.NoActiveLibraryException ex)
    {
    	materials = MaterialInfo.GetPredefinedMaterials();
    }
    
    MaterialInfo material = materials.FirstOrDefault(m => m.Name.Value == "My favourite material");
    if (material == null)
    {
    	Console.WriteLine("Material not found.");
    }
    else
    {
    	occurrence.Material = material;
    }
    Public Properties
     NameDescription
    Public PropertyName of this appearance. (Inherited from EPLAN.Harness.API.DataStructures.BaseAppearanceInfo)
    Public PropertyOverridden. Preview of this appearance.  
    Top
    Public Methods
     NameDescription
    Public MethodIs this appearance equal to the following object? (Inherited from EPLAN.Harness.API.DataStructures.BaseAppearanceInfo)
    Public MethodServes as the default hash function. (Inherited from EPLAN.Harness.API.DataStructures.BaseAppearanceInfo)
    Public Methodstatic (Shared in Visual Basic) Gets predefined materials. These are not real materials but only colors.  
    Top
    See Also