Harness proD API Help
EPLAN.Harness.API.Projects.Documents Namespace / Workdesk Class / ImportDrawing Method
Path of drawing file.
The position in space.
Example
In This Topic
    ImportDrawing Method (Workdesk)
    In This Topic
    Import drawings to workdesk.
    Syntax

    Parameters

    path
    Path of drawing file.
    position
    The position in space.

    Return Value

    Imported drawing.
    Exceptions
    ExceptionDescription
    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.
    The object is in invalid state. Obtain a new one.
    This file is not opened.
    Remarks
    Dwg and Dxf formats are supported only.
    Example
    This example shows how to import a drawing.
    // Get workdesk.
    Workdesk workdesk = ...
    
    // Create position.
    TransformProperty<LengthProperty> position =  new TransformProperty<LengthProperty>(new LengthProperty(0, Unit.Millimeter), new LengthProperty(0, Unit.Millimeter), new LengthProperty(0, Unit.Millimeter));
    
    // Define path to the drawing file to be imported.
    string path = ...;
    
    // Import into workdesk.
    OccWdDrawing drawing = workdesk.ImportDrawing(path, position);
    See Also