LayoutFileService
Canonical path: NemAll_Python_BaseElements.LayoutFileService
Service for processing the print layout files
This class provides methods for processing the print layouts, such as loading a specific print layout, assigning a print profile to it or exporting CAD data.
Methods:
-
AssignPrintProfile–Set the print profile of the active document
-
CreateMasterLayoutElement–Create the master layout element
-
DeleteDocument–Delete the content of the current document
-
ExportDWG–Export the data to a DWG file
-
ExportPDF–Export the data to a PDF file
-
GetLayoutFileName–Get the layout file name
-
ImportDWG–Import the data from an DWG file
-
InsertDrawingFile–Insert drawing files in the layout file
-
LoadFile–Load the layout file
-
RenameLayoutFile–Rename the layout file
AssignPrintProfile
staticmethod
AssignPrintProfile(doc: DocumentAdapter, printProfile: str)
Set the print profile of the active document
Parameters:
-
doc(DocumentAdapter) –Document
-
printProfile(str) –Print profile of the active document
CreateMasterLayoutElement
staticmethod
CreateMasterLayoutElement(
doc: DocumentAdapter, layoutMasterData: LayoutMasterData
)
Create the master layout element
Parameters:
-
doc(DocumentAdapter) –Document
-
layoutMasterData(LayoutMasterData) –Layout master data
DeleteDocument
staticmethod
DeleteDocument(doc: DocumentAdapter)
ExportDWG
staticmethod
ExportDWG(
doc: DocumentAdapter,
layoutFileIndex: int,
fileName: str,
configFileName: str,
)
Export the data to a DWG file
Parameters:
-
doc(DocumentAdapter) –Layout file index
-
layoutFileIndex(int) –Output file name
-
fileName(str) –Config file name
-
configFileName(str) –
ExportPDF
staticmethod
ExportPDF(
doc: DocumentAdapter,
layoutFileIndex: int,
fileName: str,
configFileName: str,
)
Export the data to a PDF file
Parameters:
-
doc(DocumentAdapter) –Document
-
layoutFileIndex(int) –Layout file index
-
fileName(str) –Output file name
-
configFileName(str) –Config file name
GetLayoutFileName
staticmethod
GetLayoutFileName(layoutNumber: int) -> tuple
Get the layout file name
Parameters:
-
layoutNumber(int) –Layout file number
Returns:
-
tuple–(Success, Name of the layout file)
ImportDWG
ImportDWG(
doc: DocumentAdapter, fileName: str, configFileName: str, placePnt: Point2D
) -> BaseElementAdapterList
Import the data from an DWG file
Parameters:
-
doc(DocumentAdapter) –Document
-
fileName(str) –Input file name
-
configFileName(str) –Config file name
-
placePnt(Point2D) –Placement point
InsertDrawingFile
staticmethod
InsertDrawingFile(
doc: DocumentAdapter,
fileIndexList: list,
placePnt: Point2D,
rotationAngle: float,
scale: float,
clipBoxLeftBottom: Point2D,
clipBoxRightTop: Point2D,
layerList: list[int] | VecIntList,
textFactor: float,
bUseRefPnt: bool,
refPnt: Point2D,
drawingMinMaxClipping: MinMax3D,
)
Insert drawing files in the layout file
Parameters:
-
doc(DocumentAdapter) –Document
-
fileIndexList(list) –List with the drawing file indices
-
placePnt(Point2D) –Placement point
-
rotationAngle(float) –Rotation angle
-
scale(float) –Scale
-
clipBoxLeftBottom(Point2D) –Left bottom point of the clipping box
-
clipBoxRightTop(Point2D) –Top right point of the clipping box
-
layerList(list[int] | VecIntList) –List with the insertion layers
-
textFactor(float) –Text factor
-
bUseRefPnt(bool) –Use the reference point for the placement
-
refPnt(Point2D) –Reference point of the drawing file
-
drawingMinMaxClipping(MinMax3D) –Min/max coordinates of the clipping area from the drawing file"
LoadFile
staticmethod
LoadFile(doc: DocumentAdapter, fileIndex: int)
Load the layout file
Parameters:
-
doc(DocumentAdapter) –Document
-
fileIndex(int) –Layout file index