Core: Generation of python bindings for Techdraw (#22565)

* first working interfaces..

* adding the rest.

* updated all pyi files.

* running black for formatting.

* removing unused imports

* removing empty comments

* fixing typing declarations.

* removing inline comments.

* fixing pyObjectBase in CosmeticEdgePy

* removing erroneous tags.

* running black.

* fixing CenterLinePy

* fixing import issues.

* Fixing tuple.

* Enabling CosmeticEdge compilation.

* fixing comments, removing unused imports.

* fixing ordering
This commit is contained in:
Ian Abreu
2025-08-04 11:36:32 -04:00
committed by GitHub
parent ca95874813
commit 7c86817cbb
36 changed files with 986 additions and 16 deletions

View File

@@ -61,6 +61,34 @@ generate_from_xml(DrawWeldSymbolPy)
generate_from_xml(CosmeticExtensionPy)
generate_from_xml(DrawBrokenViewPy)
generate_from_py_(DrawHatchPy)
generate_from_py_(DrawViewPy)
generate_from_py_(DrawPagePy)
generate_from_py_(DrawViewPartPy)
generate_from_py_(DrawViewSymbolPy)
generate_from_py_(DrawTemplatePy)
generate_from_py_(DrawParametricTemplatePy)
generate_from_py_(DrawSVGTemplatePy)
generate_from_py_(DrawViewClipPy)
generate_from_py_(DrawViewDimensionPy)
generate_from_py_(DrawViewDimExtentPy)
generate_from_py_(DrawGeomHatchPy)
generate_from_py_(DrawViewCollectionPy)
generate_from_py_(DrawProjGroupPy)
generate_from_py_(DrawProjGroupItemPy)
generate_from_py_(DrawViewAnnotationPy)
generate_from_py_(DrawLeaderLinePy)
generate_from_py_(DrawRichAnnoPy)
generate_from_py_(GeomFormatPy)
generate_from_py_(CenterLinePy)
generate_from_py_(CosmeticEdgePy)
generate_from_py_(CosmeticVertexPy)
generate_from_py_(DrawTilePy)
generate_from_py_(DrawTileWeldPy)
generate_from_py_(DrawWeldSymbolPy)
generate_from_py_(CosmeticExtensionPy)
generate_from_py_(DrawBrokenViewPy)
SET(Draw_SRCS
DrawPage.cpp
DrawPage.h

View File

@@ -0,0 +1,66 @@
from typing import Any, Final
from Base.PyObjectBase import PyObjectBase
from Base.Metadata import constmethod, export
@export(
Father="PyObjectBase",
Name="CenterLinePy",
Twin="CenterLine",
TwinPointer="CenterLine",
Include="Mod/TechDraw/App/CenterLine.h",
Namespace="TechDraw",
FatherInclude="Base/PyObjectBase.h",
FatherNamespace="Base",
Constructor=True,
Delete=True,
)
class CenterLinePy(PyObjectBase):
"""
CenterLine specifies additional mark up edges in a View
"""
@constmethod
def clone(self) -> Any:
"""Create a clone of this centerline"""
...
@constmethod
def copy(self) -> Any:
"""Create a copy of this centerline"""
...
Tag: Final[str]
"""Gives the tag of the CenterLine as string."""
Type: Final[int]
"""0 - face, 1 - 2 line, 2 - 2 point."""
Mode: int
"""0 - vert/ 1 - horiz/ 2 - aligned."""
Format: dict[str, Any]
"""The appearance attributes (style, color, weight, visible) for this CenterLine."""
HorizShift: float
"""The left/right offset for this CenterLine."""
VertShift: float
"""The up/down offset for this CenterLine."""
Rotation: float
"""The rotation of the Centerline in degrees."""
Extension: float
"""The additional length to be added to this CenterLine."""
Flip: bool
"""Reverse the order of points for 2 point CenterLine."""
Edges: list[Any]
"""The names of source edges for this CenterLine."""
Faces: list[Any]
"""The names of source Faces for this CenterLine."""
Points: list[Any]
"""The names of source Points for this CenterLine."""

View File

@@ -0,0 +1,39 @@
from typing import Final
from Base.PyObjectBase import PyObjectBase
from Base.Metadata import export
@export(
Father="PyObjectBase",
Name="CosmeticEdgePy",
Twin="CosmeticEdge",
TwinPointer="CosmeticEdge",
Include="Mod/TechDraw/App/Cosmetic.h",
Namespace="TechDraw",
FatherInclude="Base/GeometryPyCXX.h",
FatherNamespace="Base",
Constructor=True,
Delete=True,
)
class CosmeticEdgePy(PyObjectBase):
"""
CosmeticEdge specifies an extra (cosmetic) edge in Views
"""
Tag: Final[str]
"""Gives the tag of the CosmeticEdge as string."""
Start: PyCXXVector
"""Gives the position of one end of this CosmeticEdge as vector."""
End: PyCXXVector
"""Gives the position of one end of this CosmeticEdge as vector."""
Center: PyCXXVector
"""Gives the position of center point of this CosmeticEdge as vector."""
Radius: float
"""Gives the radius of CosmeticEdge in mm."""
Format: dict
"""The appearance attributes (style, weight, color, visible) for this CosmeticEdge."""

View File

@@ -0,0 +1,18 @@
from Base.Metadata import export
from App.DocumentObjectExtension import DocumentObjectExtension
@export(
Father="DocumentObjectExtensionPy",
Name="CosmeticExtensionPy",
Twin="CosmeticExtension",
TwinPointer="CosmeticExtension",
Include="Mod/TechDraw/App/CosmeticExtension.h",
Namespace="TechDraw",
FatherInclude="App/DocumentObjectExtensionPy.h",
FatherNamespace="App",
)
class CosmeticExtensionPy(DocumentObjectExtension):
"""
This object represents cosmetic features for a DrawViewPart.
"""

View File

@@ -0,0 +1,48 @@
from typing import Any, Final
from Base.PyObjectBase import PyObjectBase
from Base.Metadata import constmethod, export
@export(
Father="PyObjectBase",
Name="CosmeticVertexPy",
Twin="CosmeticVertex",
TwinPointer="CosmeticVertex",
Include="Mod/TechDraw/App/Cosmetic.h",
Namespace="TechDraw",
FatherInclude="Base/PyObjectBase.h",
FatherNamespace="Base",
Constructor=True,
Delete=True,
)
class CosmeticVertexPy(PyObjectBase):
"""
CosmeticVertex specifies an extra (cosmetic) vertex in Views
"""
@constmethod
def clone(self) -> Any:
"""Create a clone of this CosmeticVertex"""
...
@constmethod
def copy(self) -> Any:
"""Create a copy of this CosmeticVertex"""
...
Tag: Final[str]
"""Gives the tag of the CosmeticVertex as string."""
Point: Any
"""Gives the position of this CosmeticVertex as vector."""
Show: bool
"""Show/hide the vertex."""
Color: Any # type: tuple[float, float, float, float]]
"""set/return the vertex's colour using a tuple (rgba)."""
Size: Any
"""set/return the vertex's radius in mm."""
Style: Any
"""set/return the vertex's style as integer."""

View File

@@ -0,0 +1,31 @@
from typing import Any
from Base.Metadata import export
from TechDraw.DrawViewPart import DrawViewPart
@export(
Father="DrawViewPartPy",
Name="DrawBrokenViewPy",
Twin="DrawBrokenView",
TwinPointer="DrawBrokenView",
Include="Mod/TechDraw/App/DrawBrokenView.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewPartPy.h",
FatherNamespace="TechDraw",
)
class DrawBrokenViewPy(DrawViewPart):
"""
Feature for creating and manipulating Technical Drawing broken views
"""
def mapPoint3dToView(self) -> Any:
"""point2d = mapPoint3dToView(point3d) - returns the position of the 3d point within the broken view."""
...
def mapPoint2dFromView(self) -> Any:
"""point2d = mapPoint2dFromView(point3d) - returns the position of the 2d point within an unbroken view."""
...
def getCompressedCenter(self) -> Any:
"""point3d = getCompressedCenter() - returns the geometric center of the source shapes after break cuts and gap compression."""
...

View File

@@ -0,0 +1,26 @@
from typing import Any
from Base.Metadata import export
from App.DocumentObject import DocumentObject
@export(
Father="DocumentObjectPy",
Name="DrawGeomHatchPy",
Twin="DrawGeomHatch",
TwinPointer="DrawGeomHatch",
Include="Mod/TechDraw/App/DrawGeomHatch.h",
Namespace="TechDraw",
FatherInclude="App/DocumentObjectPy.h",
FatherNamespace="App",
)
class DrawGeomHatchPy(DocumentObject):
"""
Feature for creating and manipulating Technical Drawing GeomHatch areas
"""
def translateLabel(self) -> Any:
"""
translateLabel(translationContext, objectBaseName, objectUniqueName).
No return value. Replace the current label with a translated version where possible.
"""
...

View File

@@ -16,7 +16,7 @@
<Methode Name="translateLabel">
<Documentation>
<UserDocu>translateLabel(translationContext, objectBaseName, objectUniqueName).
No return value. Replace the current label with a translated version where possible.
No return value. Replace the current label with a translated version where possible.
</UserDocu>
</Documentation>
</Methode>

View File

@@ -0,0 +1,25 @@
from typing import Any
from Base.Metadata import export
from App.DocumentObject import DocumentObject
@export(
Father="DocumentObjectPy",
Name="DrawHatchPy",
Twin="DrawHatch",
TwinPointer="DrawHatch",
Include="Mod/TechDraw/App/DrawHatch.h",
Namespace="TechDraw",
FatherInclude="App/DocumentObjectPy.h",
FatherNamespace="App",
)
class DrawHatchPy(DocumentObject):
"""
Feature for creating and manipulating Technical Drawing Hatch areas
"""
def translateLabel(self) -> Any:
"""
translateLabel(translationContext, objectBaseName, objectUniqueName).
No return value. Replace the current label with a translated version where possible.
"""
...

View File

@@ -16,7 +16,7 @@
<Methode Name="translateLabel">
<Documentation>
<UserDocu>translateLabel(translationContext, objectBaseName, objectUniqueName).
No return value. Replace the current label with a translated version where possible.
No return value. Replace the current label with a translated version where possible.
</UserDocu>
</Documentation>
</Methode>

View File

@@ -0,0 +1,17 @@
from Base.Metadata import export
from DrawView import DrawView
@export(
Father="DrawViewPy",
Name="DrawLeaderLinePy",
Twin="DrawLeaderLine",
TwinPointer="DrawLeaderLine",
Include="Mod/TechDraw/App/DrawLeaderLine.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewPy.h",
FatherNamespace="TechDraw",
)
class DrawLeaderLinePy(DrawView):
"""
Feature for adding leaders to Technical Drawings
"""

View File

@@ -0,0 +1,54 @@
from typing import Any, Final
from Base.Metadata import export
from App.DocumentObject import DocumentObject
@export(
Father="DocumentObjectPy",
Name="DrawPagePy",
Twin="DrawPage",
TwinPointer="DrawPage",
Include="Mod/TechDraw/App/DrawPage.h",
Namespace="TechDraw",
FatherInclude="App/DocumentObjectPy.h",
FatherNamespace="App",
)
class DrawPagePy(DocumentObject):
"""
Feature for creating and manipulating Technical Drawing Pages
"""
def addView(self) -> Any:
"""addView(DrawView) - Add a View to this Page"""
...
def removeView(self) -> Any:
"""removeView(DrawView) - Remove a View to this Page"""
...
def getViews(self) -> Any:
"""getViews() - returns a list of all the views on page excluding Views inside Collections"""
...
def getAllViews(self) -> Any:
"""getAllViews() - returns a list of all the views on page including Views inside Collections"""
...
def translateLabel(self) -> Any:
"""
translateLabel(translationContext, objectBaseName, objectUniqueName).
No return value. Replace the current label with a translated version where possible.
"""
...
def requestPaint(self) -> Any:
"""Ask the Gui to redraw this page"""
...
PageWidth: Final[float]
"""Returns the width of this page"""
PageHeight: Final[float]
"""Returns the height of this page"""
PageOrientation: Final[str]
"""Returns the orientation of this page"""

View File

@@ -36,7 +36,7 @@
<Methode Name="translateLabel">
<Documentation>
<UserDocu>translateLabel(translationContext, objectBaseName, objectUniqueName).
No return value. Replace the current label with a translated version where possible.
No return value. Replace the current label with a translated version where possible.
</UserDocu>
</Documentation>
</Methode>

View File

@@ -0,0 +1,25 @@
from typing import Any, Final
from Base.Metadata import export
from DrawTemplate import DrawTemplate
@export(
Father="DrawTemplatePy",
Name="DrawParametricTemplatePy",
Twin="DrawParametricTemplate",
TwinPointer="DrawParametricTemplate",
Include="Mod/TechDraw/App/DrawParametricTemplate.h",
Namespace="TechDraw",
FatherInclude="DrawTemplatePy.h",
FatherNamespace="TechDraw",
)
class DrawParametricTemplatePy(DrawTemplate):
"""
Feature for creating and manipulating Technical Drawing Templates
"""
def drawLine(self) -> Any:
"""Draw a line"""
...
GeometryCount: Final[int]
"""Number of geometry in template"""

View File

@@ -0,0 +1,23 @@
from typing import Any
from Base.Metadata import export
from TechDraw.DrawViewPart import DrawViewPart
@export(
Father="DrawViewPartPy",
Name="DrawProjGroupItemPy",
Twin="DrawProjGroupItem",
TwinPointer="DrawProjGroupItem",
Include="Mod/TechDraw/App/DrawProjGroupItem.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewPartPy.h",
FatherNamespace="TechDraw",
)
class DrawProjGroupItemPy(DrawViewPart):
"""
Feature for creating and manipulating component Views Technical Drawing Projection Groups
"""
def autoPosition(self) -> Any:
"""autoPosition() - Move to AutoDistribute/Unlocked position on Page. Returns none."""
...

View File

@@ -0,0 +1,39 @@
from typing import Any
from Base.Metadata import export
from TechDraw.DrawViewCollection import DrawViewCollection
@export(
Father="DrawViewCollectionPy",
Name="DrawProjGroupPy",
Twin="DrawProjGroup",
TwinPointer="DrawProjGroup",
Include="Mod/TechDraw/App/DrawProjGroup.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewCollectionPy.h",
FatherNamespace="TechDraw",
)
class DrawProjGroupPy(DrawViewCollection):
"""
Feature for creating and manipulating Technical Drawing Projection Groups
"""
def addProjection(self) -> Any:
"""addProjection(string projectionType) - Add a new Projection Item to this Group. Returns DocObj."""
...
def removeProjection(self) -> Any:
"""removeProjection(string projectionType) - Remove specified Projection Item from this Group. Returns int number of views in Group."""
...
def purgeProjections(self) -> Any:
"""purgeProjections() - Remove all Projection Items from this Group. Returns int number of views in Group (0)."""
...
def getItemByLabel(self) -> Any:
"""getItemByLabel(string projectionType) - return specified Projection Item"""
...
def getXYPosition(self) -> Any:
"""getXYPosition(string projectionType) - return the AutoDistribute position for specified Projection Item"""
...

View File

@@ -0,0 +1,17 @@
from Base.Metadata import export
from TechDraw.DrawView import DrawView
@export(
Father="DrawViewPy",
Name="DrawRichAnnoPy",
Twin="DrawRichAnno",
TwinPointer="DrawRichAnno",
Include="Mod/TechDraw/App/DrawRichAnno.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewPy.h",
FatherNamespace="TechDraw",
)
class DrawRichAnnoPy(DrawView):
"""
Feature for adding rich annotation blocks to Technical Drawings
"""

View File

@@ -0,0 +1,34 @@
from typing import Any
from Base.Metadata import export
from DrawTemplate import DrawTemplate
@export(
Father="DrawTemplatePy",
Name="DrawSVGTemplatePy",
Twin="DrawSVGTemplate",
TwinPointer="DrawSVGTemplate",
Include="Mod/TechDraw/App/DrawSVGTemplate.h",
Namespace="TechDraw",
FatherInclude="DrawTemplatePy.h",
FatherNamespace="TechDraw",
)
class DrawSVGTemplatePy(DrawTemplate):
"""
Feature for creating and manipulating Technical Drawing SVG Templates
"""
def getEditFieldContent(self) -> Any:
"""getEditFieldContent(EditFieldName) - returns the content of a specific Editable Text Field"""
...
def setEditFieldContent(self) -> Any:
"""setEditFieldContent(EditFieldName, NewContent) - sets a specific Editable Text Field to a new value"""
...
def translateLabel(self) -> Any:
"""
translateLabel(translationContext, objectBaseName, objectUniqueName).
No return value. Replace the current label with a translated version where possible.
"""
...

View File

@@ -26,7 +26,7 @@
<Methode Name="translateLabel">
<Documentation>
<UserDocu>translateLabel(translationContext, objectBaseName, objectUniqueName).
No return value. Replace the current label with a translated version where possible.
No return value. Replace the current label with a translated version where possible.
</UserDocu>
</Documentation>
</Methode>

View File

@@ -0,0 +1,18 @@
from Base.Metadata import export
from App.DocumentObject import DocumentObject
@export(
Father="DocumentObjectPy",
Name="DrawTemplatePy",
Twin="DrawTemplate",
TwinPointer="DrawTemplate",
Include="Mod/TechDraw/App/DrawTemplate.h",
Namespace="TechDraw",
FatherInclude="App/DocumentObjectPy.h",
FatherNamespace="App",
)
class DrawTemplatePy(DocumentObject):
"""
Feature for creating and manipulating Technical Drawing Templates
"""

View File

@@ -0,0 +1,18 @@
from Base.Metadata import export
from App.DocumentObject import DocumentObject
@export(
Father="DocumentObjectPy",
Name="DrawTilePy",
Twin="DrawTile",
TwinPointer="DrawTile",
Include="Mod/TechDraw/App/DrawTile.h",
Namespace="TechDraw",
FatherInclude="App/DocumentObjectPy.h",
FatherNamespace="App",
)
class DrawTilePy(DocumentObject):
"""
Feature for adding tiles to leader lines
"""

View File

@@ -0,0 +1,17 @@
from Base.Metadata import export
from TechDraw.DrawTile import DrawTile
@export(
Father="DrawTilePy",
Name="DrawTileWeldPy",
Twin="DrawTileWeld",
TwinPointer="DrawTileWeld",
Include="Mod/TechDraw/App/DrawTileWeld.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawTilePy.h",
FatherNamespace="TechDraw",
)
class DrawTileWeldPy(DrawTile):
"""
Feature for adding welding tiles to leader lines
"""

View File

@@ -0,0 +1,17 @@
from Base.Metadata import export
from TechDraw.Drawview import DrawView
@export(
Father="DrawViewPy",
Name="DrawViewAnnotationPy",
Twin="DrawViewAnnotation",
TwinPointer="DrawViewAnnotation",
Include="Mod/TechDraw/App/DrawViewAnnotation.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewPy.h",
FatherNamespace="TechDraw",
)
class DrawViewAnnotationPy(DrawView):
"""
Feature for creating and manipulating Technical Drawing Annotation Views
"""

View File

@@ -0,0 +1,31 @@
from typing import Any
from Base.Metadata import export
from TechDraw.DrawView import DrawView
@export(
Father="DrawViewPy",
Name="DrawViewClipPy",
Twin="DrawViewClip",
TwinPointer="DrawViewClip",
Include="Mod/TechDraw/App/DrawViewClip.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewPy.h",
FatherNamespace="TechDraw",
)
class DrawViewClipPy(DrawView):
"""
Feature for creating and manipulating Technical Drawing Clip Views
"""
def addView(self) -> Any:
"""addView(DrawView) - Add a View to this ClipView"""
...
def removeView(self) -> Any:
"""removeView(DrawView) - Remove specified View to this ClipView"""
...
def getChildViewNames(self) -> Any:
"""getChildViewNames() - get a list of the DrawViews in this ClipView"""
...

View File

@@ -0,0 +1,27 @@
from typing import Any
from Base.Metadata import export
from TechDraw.DrawView import DrawView
@export(
Father="DrawViewPy",
Name="DrawViewCollectionPy",
Twin="DrawViewCollection",
TwinPointer="DrawViewCollection",
Include="Mod/TechDraw/App/DrawViewCollection.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewPy.h",
FatherNamespace="TechDraw",
)
class DrawViewCollectionPy(DrawView):
"""
Feature for creating and manipulating Technical Drawing View Collections
"""
def addView(self) -> Any:
"""addView(DrawView object) - Add a new View to this Group. Returns count of views."""
...
def removeView(self) -> Any:
"""removeView(DrawView object) - Remove specified Viewfrom this Group. Returns count of views in Group."""
...

View File

@@ -0,0 +1,23 @@
from typing import Any
from Base.Metadata import export
from TechDraw.DrawViewDimension import DrawViewDimension
@export(
Father="DrawViewDimensionPy",
Name="DrawViewDimExtentPy",
Twin="DrawViewDimExtent",
TwinPointer="DrawViewDimExtent",
Include="Mod/TechDraw/App/DrawViewDimExtent.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewDimensionPy.h",
FatherNamespace="TechDraw",
)
class DrawViewDimExtentPy(DrawViewDimension):
"""
Feature for creating and manipulating Technical Drawing DimExtents
"""
def tbd(self) -> Any:
"""tbd() - returns tbd."""
...

View File

@@ -0,0 +1,47 @@
from typing import Any
from Base.Metadata import export
from TechDraw.DrawView import DrawView
@export(
Father="DrawViewPy",
Name="DrawViewDimensionPy",
Twin="DrawViewDimension",
TwinPointer="DrawViewDimension",
Include="Mod/TechDraw/App/DrawViewDimension.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewPy.h",
FatherNamespace="TechDraw",
)
class DrawViewDimensionPy(DrawView):
"""
Feature for creating and manipulating Technical Drawing Dimensions
"""
def getRawValue(self) -> Any:
"""getRawValue() - returns Dimension value in mm."""
...
def getText(self) -> Any:
"""getText() - returns Dimension text."""
...
def getLinearPoints(self) -> Any:
"""getLinearPoints() - returns list of points for linear Dimension"""
...
def getArcPoints(self) -> Any:
"""getArcPoints() - returns list of points for circle/arc Dimension"""
...
def getAnglePoints(self) -> Any:
"""getAnglePoints() - returns list of points for angle Dimension"""
...
def getAreaPoints(self) -> Any:
"""getAreaPoints() - returns list of values (center, filled area, actual area) for area Dimension."""
...
def getArrowPositions(self) -> Any:
"""getArrowPositions() - returns list of locations or Dimension Arrowheads. Locations are in unscaled coordinates of parent View"""
...

View File

@@ -0,0 +1,171 @@
from typing import Any
from Base.Metadata import export
from TechDraw.rawView import DrawView
@export(
Father="DrawViewPy",
Name="DrawViewPartPy",
Twin="DrawViewPart",
TwinPointer="DrawViewPart",
Include="Mod/TechDraw/App/DrawViewPart.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewPy.h",
FatherNamespace="TechDraw",
)
class DrawViewPartPy(DrawView):
"""
Feature for creating and manipulating Technical Drawing Part Views
"""
def getVisibleEdges(self) -> Any:
"""
getVisibleEdges([conventionalCoords]) - get the visible edges in the View as Part::TopoShapeEdges. Edges are returned
in conventional coordinates if conventionalCoords is True. The default is to return Qt inverted Y coordinates.
"""
...
def getVisibleVertexes(self) -> Any:
"""
getVisibleVertexes() - get the visible vertexes as App.Vector in the View's coordinate system. App.Vectors are returned
in conventional coordinates if conventionalCoords is True. The default is to return Qt inverted Y coordinates.
"""
...
def getHiddenEdges(self) -> Any:
"""
getHiddenEdges([conventionalCoords]) - get the hidden edges in the View as Part::TopoShapeEdges. Edges are returned
in conventional coordinates if conventionalCoords is True. The default is to return Qt inverted Y coordinates.
"""
...
def getHiddenVertexes(self) -> Any:
"""
getHiddenVertexes() - get the hidden vertexes as App.Vector in the View's coordinate system. App.Vectors are returned
in conventional coordinates if conventionalCoords is True. The default is to return Qt inverted Y coordinates.
"""
...
def makeCosmeticVertex(self) -> Any:
"""id = makeCosmeticVertex(p1) - add a CosmeticVertex at p1 (View coordinates). Returns unique id vertex."""
...
def makeCosmeticVertex3d(self) -> Any:
"""id = makeCosmeticVertex3d(p1) - add a CosmeticVertex at p1 (3d model coordinates). Returns unique id vertex."""
...
def getCosmeticVertex(self) -> Any:
"""cv = getCosmeticVertex(id) - returns CosmeticVertex with unique id."""
...
def getCosmeticVertexBySelection(self) -> Any:
"""cv = getCosmeticVertexBySelection(name) - returns CosmeticVertex with name (Vertex6). Used in selections."""
...
def removeCosmeticVertex(self) -> Any:
"""removeCosmeticVertex(cv) - remove CosmeticVertex from View. Returns None."""
...
def clearCosmeticVertices(self) -> Any:
"""clearCosmeticVertices() - remove all CosmeticVertices from the View. Returns None."""
...
def makeCosmeticLine(self) -> Any:
"""tag = makeCosmeticLine(p1, p2) - add a CosmeticEdge from p1 to p2(View coordinates). Returns tag of new CosmeticEdge."""
...
def makeCosmeticLine3D(self) -> Any:
"""tag = makeCosmeticLine3D(p1, p2) - add a CosmeticEdge from p1 to p2(3D coordinates). Returns tag of new CosmeticEdge."""
...
def makeCosmeticCircle(self) -> Any:
"""tag = makeCosmeticCircle(center, radius) - add a CosmeticEdge at center with radius radius(View coordinates). Returns tag of new CosmeticEdge."""
...
def makeCosmeticCircleArc(self) -> Any:
"""tag = makeCosmeticCircleArc(center, radius, start, end) - add a CosmeticEdge at center with radius radius(View coordinates) from start angle to end angle. Returns tag of new CosmeticEdge."""
...
def makeCosmeticCircle3d(self) -> Any:
"""tag = makeCosmeticCircle3d(center, radius) - add a CosmeticEdge at center (3d point) with radius. Returns tag of new CosmeticEdge."""
...
def makeCosmeticCircleArc3d(self) -> Any:
"""tag = makeCosmeticCircleArc3d(center, radius, start, end) - add a CosmeticEdge at center (3d point) with radius from start angle to end angle. Returns tag of new CosmeticEdge."""
...
def getCosmeticEdge(self) -> Any:
"""ce = getCosmeticEdge(id) - returns CosmeticEdge with unique id."""
...
def getCosmeticEdgeBySelection(self) -> Any:
"""ce = getCosmeticEdgeBySelection(name) - returns CosmeticEdge by name (Edge25). Used in selections"""
...
def removeCosmeticEdge(self) -> Any:
"""removeCosmeticEdge(ce) - remove CosmeticEdge ce from View. Returns None."""
...
def makeCenterLine(self) -> Any:
"""makeCenterLine(subNames, mode) - draw a center line on this viewPart. SubNames is a list of n Faces, 2 Edges or 2 Vertices (ex [Face1,Face2,Face3]. Returns unique tag of added CenterLine."""
...
def getCenterLine(self) -> Any:
"""cl = getCenterLine(id) - returns CenterLine with unique id."""
...
def getCenterLineBySelection(self) -> Any:
"""cl = getCenterLineBySelection(name) - returns CenterLine by name (Edge25). Used in selections"""
...
def removeCenterLine(self) -> Any:
"""removeCenterLine(cl) - remove CenterLine cl from View. Returns None."""
...
def clearCosmeticEdges(self) -> Any:
"""clearCosmeticEdges() - remove all CosmeticLines from the View. Returns None."""
...
def clearCenterLines(self) -> Any:
"""clearCenterLines() - remove all CenterLines from the View. Returns None."""
...
def clearGeomFormats(self) -> Any:
"""clearGeomFormats() - remove all GeomFormats from the View. Returns None."""
...
def formatGeometricEdge(self) -> Any:
"""formatGeometricEdge(index, style, weight, color, visible). Returns None."""
...
def getEdgeByIndex(self) -> Any:
"""getEdgeByIndex(edgeIndex). Returns Part.TopoShape."""
...
def getEdgeBySelection(self) -> Any:
"""getEdgeBySelection(edgeName). Returns Part.TopoShape."""
...
def getVertexByIndex(self) -> Any:
"""getVertexByIndex(vertexIndex). Returns Part.TopoShape."""
...
def getVertexBySelection(self) -> Any:
"""getVertexBySelection(vertexName). Returns Part.TopoShape."""
...
def projectPoint(self) -> Any:
"""
projectPoint(vector3d point, [bool invert]). Returns the projection of point in the
projection coordinate system of this DrawViewPart. Optionally inverts the Y coordinate of the
result.
"""
...
def getGeometricCenter(self) -> Any:
"""point3d = getGeometricCenter() - returns the geometric center of the source shapes."""
...
def requestPaint(self) -> Any:
"""requestPaint(). Redraw the graphic for this View."""
...

View File

@@ -15,26 +15,26 @@
</Documentation>
<Methode Name="getVisibleEdges">
<Documentation>
<UserDocu>getVisibleEdges([conventionalCoords]) - get the visible edges in the View as Part::TopoShapeEdges. Edges are returned\
in conventional coordinates if conventionalCoords is True. The default is to return Qt inverted Y coordinates.</UserDocu>
<UserDocu>getVisibleEdges([conventionalCoords]) - get the visible edges in the View as Part::TopoShapeEdges. Edges are returned
in conventional coordinates if conventionalCoords is True. The default is to return Qt inverted Y coordinates.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getVisibleVertexes">
<Documentation>
<UserDocu>getVisibleVertexes() - get the visible vertexes as App.Vector in the View's coordinate system. App.Vectors are returned\
in conventional coordinates if conventionalCoords is True. The default is to return Qt inverted Y coordinates.</UserDocu>
<UserDocu>getVisibleVertexes() - get the visible vertexes as App.Vector in the View's coordinate system. App.Vectors are returned
in conventional coordinates if conventionalCoords is True. The default is to return Qt inverted Y coordinates.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getHiddenEdges">
<Documentation>
<UserDocu>getHiddenEdges([conventionalCoords]) - get the hidden edges in the View as Part::TopoShapeEdges. Edges are returned\
in conventional coordinates if conventionalCoords is True. The default is to return Qt inverted Y coordinates.</UserDocu>
<UserDocu>getHiddenEdges([conventionalCoords]) - get the hidden edges in the View as Part::TopoShapeEdges. Edges are returned
in conventional coordinates if conventionalCoords is True. The default is to return Qt inverted Y coordinates.</UserDocu>
</Documentation>
</Methode>
<Methode Name="getHiddenVertexes">
<Documentation>
<UserDocu>getHiddenVertexes() - get the hidden vertexes as App.Vector in the View's coordinate system. App.Vectors are returned\
in conventional coordinates if conventionalCoords is True. The default is to return Qt inverted Y coordinates.</UserDocu>
<UserDocu>getHiddenVertexes() - get the hidden vertexes as App.Vector in the View's coordinate system. App.Vectors are returned
in conventional coordinates if conventionalCoords is True. The default is to return Qt inverted Y coordinates.</UserDocu>
</Documentation>
</Methode>
<Methode Name="makeCosmeticVertex">
@@ -175,8 +175,9 @@
<Methode Name="projectPoint">
<Documentation>
<UserDocu>projectPoint(vector3d point, [bool invert]). Returns the projection of point in the
projection coordinate system of this DrawViewPart. Optionally inverts the Y coordinate of the
result.</UserDocu>
projection coordinate system of this DrawViewPart. Optionally inverts the Y coordinate of the
result.
</UserDocu>
</Documentation>
</Methode>
<Methode Name="getGeometricCenter">

View File

@@ -0,0 +1,34 @@
from typing import Any
from Base.Metadata import export
from App.DocumentObject import DocumentObject
@export(
Father="DocumentObjectPy",
Name="DrawViewPy",
Twin="DrawView",
TwinPointer="DrawView",
Include="Mod/TechDraw/App/DrawView.h",
Namespace="TechDraw",
FatherInclude="App/DocumentObjectPy.h",
FatherNamespace="App",
)
class DrawViewPy(DocumentObject):
"""
Feature for creating and manipulating Technical Drawing Views
"""
def translateLabel(self) -> Any:
"""
translateLabel(translationContext, objectBaseName, objectUniqueName).
No return value. Replace the current label with a translated version where possible.
"""
...
def getScale(self) -> Any:
"""
float scale = getScale(). Returns the correct scale for this view. Handles whether to
use this view's scale property or a parent's view (as in a projection group).
"""
...

View File

@@ -16,14 +16,14 @@
<Methode Name="translateLabel">
<Documentation>
<UserDocu>translateLabel(translationContext, objectBaseName, objectUniqueName).
No return value. Replace the current label with a translated version where possible.
No return value. Replace the current label with a translated version where possible.
</UserDocu>
</Documentation>
</Methode>
<Methode Name="getScale">
<Documentation>
<UserDocu>float scale = getScale(). Returns the correct scale for this view. Handles whether to
use this view's scale property or a parent's view (as in a projection group).
use this view's scale property or a parent's view (as in a projection group).
</UserDocu>
</Documentation>
</Methode>

View File

@@ -0,0 +1,23 @@
from typing import Any
from Base.Metadata import export
from TechDraw.DrawView import DrawView
@export(
Father="DrawViewPy",
Name="DrawViewSymbolPy",
Twin="DrawViewSymbol",
TwinPointer="DrawViewSymbol",
Include="Mod/TechDraw/App/DrawViewSymbol.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewPy.h",
FatherNamespace="TechDraw",
)
class DrawViewSymbolPy(DrawView):
"""
Feature for creating and manipulating Drawing SVG Symbol Views
"""
def dumpSymbol(self) -> Any:
"""dumpSymbol(fileSpec) - dump the contents of Symbol to a file"""
...

View File

@@ -0,0 +1,17 @@
from Base.Metadata import export
from TechDraw.DrawView import DrawView
@export(
Father="DrawViewPy",
Name="DrawWeldSymbolPy",
Twin="DrawWeldSymbol",
TwinPointer="DrawWeldSymbol",
Include="Mod/TechDraw/App/DrawWeldSymbol.h",
Namespace="TechDraw",
FatherInclude="Mod/TechDraw/App/DrawViewPy.h",
FatherNamespace="TechDraw",
)
class DrawWeldSymbolPy(DrawView):
"""
Feature for adding welding tiles to leader lines
"""

View File

@@ -0,0 +1,33 @@
from typing import Any, Final
from Base.PyObjectBase import PyObjectBase
from Base.Metadata import constmethod, export
@export(
Father="PyObjectBase",
Name="GeomFormatPy",
Twin="GeomFormat",
TwinPointer="GeomFormat",
Include="Mod/TechDraw/App/Cosmetic.h",
Namespace="TechDraw",
FatherInclude="Base/PyObjectBase.h",
FatherNamespace="Base",
Constructor=True,
Delete=True,
)
class GeomFormatPy(PyObjectBase):
"""
GeomFormat specifies appearance parameters for TechDraw Geometry objects
"""
@constmethod
def clone(self) -> Any:
"""Create a clone of this geomformat"""
...
@constmethod
def copy(self) -> Any:
"""Create a copy of this geomformat"""
...
Tag: Final[str]
"""Gives the tag of the GeomFormat as string."""

View File

@@ -138,6 +138,8 @@ def _python_type_to_parameter_type(py_type: str) -> ParameterType:
return ParameterType.SEQUENCE
case _ if py_type.startswith(("tuple", "typing.tuple")):
return ParameterType.TUPLE
case _ if py_type.startswith(("pycxxvector")):
return ParameterType.VECTOR
case _:
return ParameterType.OBJECT

View File

@@ -24,6 +24,7 @@ class ParameterType(str, Enum):
MODULE = "Module"
CALLABLE = "Callable"
SEQUENCE = "Sequence"
VECTOR = "Vector"
def __str__(self):
return self.value