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 ClassTextProperty Class
    Inheritance Hierarchy

    System.Object
       EPLAN.Harness.API.LibraryParts.BaseLibraryItem
          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 Property Guid of the library item. (Inherited from EPLAN.Harness.API.DataStructures.BaseAppearanceInfo)
    Public PropertyName of this appearance. (Inherited from EPLAN.Harness.API.DataStructures.BaseAppearanceInfo)
    Public PropertyOverridden. Preview of this appearance.  
    Top
    Public Methods
     NameDescription
    Public MethodClose library item for editing. (Inherited from EPLAN.Harness.API.DataStructures.BaseAppearanceInfo)
    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)Create material from color.  
    Public Methodstatic (Shared in Visual Basic) Gets predefined materials. These are not real materials but only colors.  
    Public MethodOpen library item for editing. (Inherited from EPLAN.Harness.API.DataStructures.BaseAppearanceInfo)
    Public MethodSave all changes. (Inherited from EPLAN.Harness.API.DataStructures.BaseAppearanceInfo)
    Top
    See Also