Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / GraphicDocument Class / ReloadPropertyPanel Method
Example
In This Topic
    ReloadPropertyPanel Method
    In This Topic
    Reload property panel of this document to show current state of all controls in the panel.
    Syntax
    public void ReloadPropertyPanel()
    Remarks
    This method is useful only from plugins.
    Example
    This example shows the case when is useful to call this method.
    // HpD API plugin invoked from Workspace:
    
    Workspace workspace = api.CurrentProject.GetActiveDocument() as Workspace;
    					
    // Get desired occurrence.
    ILibraryOccurrence occurrence = workspace.GetAllOccurrences<ILibraryOccurrence>().FirstOrDefault();
    
    // Add the occurrence to the SelectSet -> in the property panel are visible all properties of this occurrence.
    workspace.SelectSet.Clear();
    workspace.SelectSet.Add(occurrence);
    
    // Get new value for property 'Manufacturer' of this occurrence.
    LibraryPartNumber partNumber = occurrence.LibraryPart.PartNumbers.FirstOrDefault(n => n.Type == ApiPartNumberType.Manufacturer);
    
    // Set the new value to the occurrence.
    occurrence.Manufacturer = partNumber;
    
    // The old value is still shown in the property panel.
    // But the property returns correct value:
    // LibraryPartNumber newPartNumber = occurrence.Manufacturer;
    
    // It is neccessary to reload property panel.
    workspace.ReloadPropertyPanel();
    
    // Alternative way is to re-add the occurrence to the SelectSet.
    // workspace.SelectSet.Clear();
    // workspace.SelectSet.Add(occ);
    
    // The new value is shown in the property panel now.
    See Also