Class: QgsCadUtils

class qgis.core.QgsCadUtils

Bases: sip.wrapper

The QgsCadUtils class provides routines for CAD editing.

Methods

alignMapPoint

Applies X/Y/angle/distance constraints from the given context to a map point.

class AlignMapPointConstraint

Bases: sip.wrapper

Structure with details of one constraint

QgsCadUtils.AlignMapPointConstraint(locked: bool = False, relative: bool = False, value: float = 0) Constructor for AlignMapPointConstraint.

QgsCadUtils.AlignMapPointConstraint(QgsCadUtils.AlignMapPointConstraint)

locked
relative
value
class AlignMapPointContext

Bases: sip.wrapper

Defines constraints for the QgsCadUtils.alignMapPoint() method.

angleConstraint
cadPoint(self, index: int) QgsPoint

Returns the recent CAD point at the specified index (in map coordinates).

See also

setCadPoint()

New in version 3.22.

Parameters:

index (int) –

Return type:

QgsPoint

property cadPointList

_cadPointList(self) -> List[QgsPointXY]

Return type:

List[QgsPointXY]

cadPoints(self) List[QgsPoint]

Returns the list of recent CAD points in map coordinates.

These are used to turn relative constraints to absolute. The first point is the most recent point.

See also

setCadPoints()

New in version 3.22.

Return type:

List[QgsPoint]

commonAngleConstraint
distanceConstraint
lineExtensionConstraint
mConstraint
mapUnitsPerPixel
setCadPoint(self, index: int, point: QgsPoint)

Sets the recent CAD point at the specified index to point (in map coordinates).

See also

cadPoint()

New in version 3.22.

Parameters:
setCadPoints(self, points: Iterable[QgsPoint])

Sets the list of recent CAD points (in map coordinates).

See also

cadPoints()

New in version 3.22.

Parameters:

points (Iterable[QgsPoint]) –

snappingToFeaturesOverridesCommonAngle
snappingUtils
xConstraint
xyVertexConstraint
yConstraint
zConstraint
class AlignMapPointOutput

Bases: sip.wrapper

Structure returned from alignMapPoint() method

edgeMatch
finalMapPoint
snapMatch
softLockCommonAngle
softLockLineExtension
softLockX
softLockY
valid
alignMapPoint(originalMapPoint: QgsPointXY, ctx: QgsCadUtils.AlignMapPointContext) QgsCadUtils.AlignMapPointOutput

Applies X/Y/angle/distance constraints from the given context to a map point. Returns a structure containing aligned map point, whether the constraints are valid and some extra information.

Parameters:
Return type:

QgsCadUtils.AlignMapPointOutput