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–Create a bending schedule for a drawing file
-
DeleteDocument–Delete a drawing file/document
-
ExportBendingMachine–Export the reinforcement data for the bending machine
-
ExportBendingMachinePerPrecast–Export the reinforcement data for the bending machine per PrecastElement
-
GetActiveFileNumber–Get the currently active drawing file number
-
GetDrawingFileName–Get the name of a drawing file
-
GetFileState–Get the state of a drawing file
-
GetFullDrawingFileName–Get the full drawing drawing file name
-
LoadFile–Load drawing file
-
RenameDrawingFile–Rename a drawing file
-
SetScalingFactor–Set the scaling factor of the current document
-
ShowDrawingFileDialog–Show a dialog to select drawing files.
-
UnloadAll–Unload All
-
UnloadFile–Unload drawing file
-
__init__–Overloaded function. See individual overloads.
CreateBendingSchedule
CreateBendingSchedule(doc: DocumentAdapter, refPnt: Point2D)
Create a bending schedule for a drawing file
Parameters:
-
doc(DocumentAdapter) –Document
-
refPnt(Point2D) –File index
Returns:
-
–
bool Success
DeleteDocument
DeleteDocument(doc: DocumentAdapter)
Delete a drawing file/document
Parameters:
-
doc(DocumentAdapter) –Document File index:
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
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]]
GetFullDrawingFileName
staticmethod
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:
-
doc(DocumentAdapter) –Document
-
fileIndex(int) –fileIndex
-
loadState(DrawingFileLoadState) –Load state
RenameDrawingFile
staticmethod
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.
UnloadFile
UnloadFile(doc: DocumentAdapter, fileIndex: int)