public IList<ElectricalOptionSetting> ElectricalOptions {get; set;}
public IList<ElectricalOptionSetting> ElectricalOptions {get; set;}
Exception | Description |
---|---|
EPLAN.Harness.API.Exceptions.ObjectInvalidException | The object is in invalid state. Obtain a new one. |
EPLAN.Harness.API.Exceptions.HpdApiNotInitializedException | Api is not in an initialized state. You can get current state from EPLAN.Harness.API.HpdApi.Status property. If API is uninitialized, you can initialize it by calling EPLAN.Harness.API.HpdApi.Init method. If API is in failed state, you can not resurrect it. |
EPLAN.Harness.API.Exceptions.ProjectClosedException | The exception that is thrown when no project is open. |
EPLAN.Harness.API.Exceptions.FileOpenedAsReadOnlyException | You can not perform this action on a document opened as read only. |
EPLAN.Harness.API.Exceptions.ArgumentNullException | Argument is null. |
// Get electrical options of the project. IList<ElectricalOptionSetting> elOptions = project.ElectricalOptions; // Edit list of electrical options: // Remove option: elOptions.Remove(elOptions.Last()); // Add new option: elOptions.Add(new ElectricalOptionSetting("Name of the option", "Description of the option")); // Edit option's name: elOptions.First(p => p.Name == "Option's name").Name = "New name"; // Save the project. project.Save();
// Create a new list of electrical option settings. IList<ElectricalOptionSetting> elOptions = new List<ElectricalOptionSetting>() { new ElectricalOptionSetting("First option", "Description 1"), new ElectricalOptionSetting("Second option", "Description 2") }; // Set the whole list to this project. (Old values are lost!) project.ElectricalOptions = elOptions; // Save the project. project.Save();