public LibWireSymbol WireSymbol {get; set;}
public LibWireSymbol WireSymbol {get; set;}
Exception | Description |
---|---|
EPLAN.Harness.API.Exceptions.HpdApiNotInitializedException | Api is not in an initialized state. You can get current state from Status property. If API is uninitialized, you can initialize it by calling Init(String,String[]) method. If API is in failed state, you can not resurrect it. |
EPLAN.Harness.API.Exceptions.ArgumentNullException | Argument is null. |
EPLAN.Harness.API.Exceptions.LibraryNotFoundException | The exception that is thrown when the active library is not found or the active library is empty. |
// Init API HpdApi api = HpdApi.GetInstance(); // Open project. Project project = api.OpenProject(@"d:\MyProject.hxproj"); // Get a default nailboard display configuration DisplayConfiguration dc = project.NailboardDisplayConfigurations.DefaultDisplayConfiguration; // Get the wire symbol. LibWireSymbol wireSymbol = dc.WireSymbol; // Close the project. project.Close();
// Init API HpdApi api = HpdApi.GetInstance(); // Open project. Project project = api.OpenProject(@"d:\MyProject.hxproj"); // Get a default nailboard display configuration DisplayConfiguration dc = project.NailboardDisplayConfigurations.DefaultDisplayConfiguration; // The wire symbol is the library part. Get the library connection to select the symbol. ActiveLibraryConnection lc = project.ActiveConnection; LibWireSymbol ws = lc.GetAllLibraryPartsInfo().OfType<LibWireSymbol>().FirstOrDefault(w => w.PartNumber == "Wire symbol (round) + Cross-section"); // Allow placing of the symbol and set it up. dc.WireSymbol.Place = true; dc.WireSymbol = ws; // Or reset the symbol // dc.WireSymbol.Place = false; // dc.WireSymbol = null; // Save and close the project. project.Save(); project.Close();