Skip to content

DrawingFileService

Canonical path: NemAll_Python_BaseElements.DrawingFileService

Bases: ExportImportService

Service for processing the drawing files

This class provides methods for changing the load state of drawing files (active in foreground, active in background or passive), as well as for changing the drawing-file-specific properties, such as scale.

Methods:

CreateBendingSchedule

CreateBendingSchedule(doc: DocumentAdapter, refPnt: Point2D)

Create a bending schedule for a drawing file

Parameters:

Returns:

  • bool Success

DeleteDocument

DeleteDocument(doc: DocumentAdapter)

Delete a drawing file/document

Parameters:

Returns:

  • bool Success

ExportBendingMachine

ExportBendingMachine(
    doc: DocumentAdapter,
    fileName: str,
    project: str,
    plan: str,
    index: str,
    bSplitGroups: bool,
)

Export the reinforcement data for the bending machine

Parameters:

  • doc (DocumentAdapter) –

    Document adapter providing access to the drawing data.

  • fileName (str) –

    Name (including path) of the output file to be created.

  • project (str) –

    Name of the project for the export.

  • plan (str) –

    Name of the plan for the export.

  • index (str) –

    Index as text for the export.

  • bSplitGroups (bool) –

    If true, split the reinforcement groups in the export.

ExportBendingMachinePerPrecast

ExportBendingMachinePerPrecast(
    doc: DocumentAdapter,
    fileName: str,
    project: str,
    plan: str,
    index: str,
    bSplitGroups: bool,
    precastelement: BaseElementAdapter,
)

Export the reinforcement data for the bending machine per PrecastElement

Parameters:

  • doc (DocumentAdapter) –

    Document adapter providing access to the drawing data.

  • fileName (str) –

    Name (including path) of the output file to be created.

  • project (str) –

    Name of the project for the export.

  • plan (str) –

    Name of the plan for the export.

  • index (str) –

    Index as text for the export.

  • bSplitGroups (bool) –

    If true, split the reinforcement groups in the export.

  • precastelement (BaseElementAdapter) –

    ElementAdapter providing access to the reinforcement data of a specific precast element.

GetActiveFileNumber staticmethod

GetActiveFileNumber() -> int

Get the currently active drawing file number

Returns:

  • int

    int Active file number

GetDrawingFileName staticmethod

GetDrawingFileName(drawingFileNumber: int) -> tuple[bool, str]

Get the name of a drawing file

Parameters:

  • drawingFileNumber (int) –

    Document File index:

Returns:

  • std ( tuple[bool, str] ) –

    :wstring Drawing file name

GetFileState

GetFileState() -> list[tuple[int, DrawingFileLoadState]]

Get the state of a drawing file

Returns:

  • list[tuple[int, DrawingFileLoadState]]

    list State code

GetFullDrawingFileName staticmethod

GetFullDrawingFileName(drawingFileNumber: int) -> str

Get the full drawing drawing file name

Parameters:

  • drawingFileNumber (int) –

    Drawing file number

Returns:

  • str

    Full drawing file name

LoadFile

LoadFile(doc: DocumentAdapter, fileIndex: int, loadState: DrawingFileLoadState)

Load drawing file

Parameters:

RenameDrawingFile staticmethod

RenameDrawingFile(fileIndex: int, newName: str) -> bool

Rename a drawing file

Parameters:

  • fileIndex (int) –

    Document

  • newName (str) –

    File index New file name:

Returns:

  • bool

    bool Success

SetScalingFactor

SetScalingFactor(doc: DocumentAdapter, scale: float)

Set the scaling factor of the current document

Parameters:

  • arg2

    Document adapter

  • arg3

    Scaling factor. For a scale of 1:20, set 20.0. For a scale 2:1, set 0.5

ShowDrawingFileDialog staticmethod

ShowDrawingFileDialog(
    doc: DocumentAdapter,
    singleSelection: bool,
    deactivateDerived: bool,
    drawingFilesPreselection: list[int] | VecIntList,
) -> list

Show a dialog to select drawing files.

Opens a dialog allowing the user to select one or more drawing files.

Parameters:

  • doc (DocumentAdapter) –

    Document adapter providing context for available drawing files.

  • singleSelection (bool) –

    If true, only a single file can be selected; otherwise, multiple selection is allowed.

  • deactivateDerived (bool) –

    If true derived structure is deactivated

  • drawingFilesPreselection (list[int] | VecIntList) –

    List of drawing files to preselect in the dialog

Returns:

  • std ( list ) –

    :vector Indices of the selected drawing files.

UnloadAll

UnloadAll(doc: DocumentAdapter)

Unload All

Parameters:

UnloadFile

UnloadFile(doc: DocumentAdapter, fileIndex: int)

Unload drawing file

Parameters:

__init__ overloaded

__init__()

Initialize

__init__(element: DrawingFileService)

Copy constructor

Parameters:

Placeholder