public IEnumerable<IOccComplexEntity> ImportComplexEntity( string path )
Parameters
- path
- Path to .hxce file.
Return Value
Imported complex entities.
public IEnumerable<IOccComplexEntity> ImportComplexEntity( string path )
Exception | Description |
---|---|
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.ObjectInvalidException | The object is in invalid state. Obtain a new one. |
EPLAN.Harness.API.Exceptions.ArgumentNullException | Argument is null. |
EPLAN.Harness.API.Exceptions.FileClosedException | This file is not opened. |
System.IO.FileLoadException | The exception that is thrown when a managed assembly is found but cannot be loaded. |
// Init API HpdApi api = HpdApi.GetInstance(); api.Init(); // Open project and select variant Project project = api.OpenProject(@"c:\Projects\Demo\Demo.hxproj"); Variant variant = project.GetVariants()[0]; // Create a new workspace or workdesk Designer designer = variant.CreateWorkspace("MyWorkspace1"); // Or open an existing one: // Designer designer = variant.GetWorkspaces().FirstOrDefault(d => d.Name == "Workspace_1"); designer.Open(false, false); // Import complex entity from file. IEnumerable<IOccComplexEntity> complexEntities = designer.ImportComplexEntity(@"c:\Projects\CEtoImport.hxce"); // Work with complex entities here. // Save changes and close documents. designer.Save(); project.Save(); designer.Close(); variant.Close(); project.Close(); api.Close();