Table of Contents

CadUcs

from OpenCAD2D import CadUcs

class CadUcs(System.Object) · CadUcs in the .NET reference

A user coordinate system, as AutoCAD's UCS: an origin and X and Y axes in world coordinates, the Z axis square to both, and a name where it is one of the drawing's named systems. Points typed at a prompt, the readout of the status bar, the grid, snap, ortho and polar tracking are in the current system, while the drawing keeps its objects in world coordinates.

Constructors

__init__

.NET

def __init__(self, origin: GeoPoint3, xAxis: GeoVector3, yAxis: GeoVector3, name: str | None = ...) -> None

Makes a system of an origin and two axes, the axes made of unit length and the Y axis square to the X axis in the plane of both.

Properties and fields

Angle

.NET

@property
def Angle(self) -> float

Gets the angle of the X axis from the world's X axis, counter-clockwise in radians from -π to π: π/6 for a system turned 30 degrees.

IsPlanar

.NET

@property
def IsPlanar(self) -> bool

Gets whether the Z axis is the world's, to the vector tolerance of Tolerance.Default, so that the presenter, which shows the drawing from above, can work in the system.

IsWorld

.NET

@property
def IsWorld(self) -> bool

Gets whether this is the world's own system: the origin at nought and the axes the world's, to the bit.

Name

.NET

@property
def Name(self) -> str | None

Gets the name of a named system, as UCS Save gave it; null for one with no name, as AutoCAD's *NO NAME*.

Origin

.NET

@property
def Origin(self) -> GeoPoint3

Gets the origin, in world coordinates.

World

.NET

World: ClassVar[CadUcs]

Gets the world coordinate system, AutoCAD's WCS.

XAxis

.NET

@property
def XAxis(self) -> GeoVector3

Gets the X axis, of unit length, in world coordinates.

YAxis

.NET

@property
def YAxis(self) -> GeoVector3

Gets the Y axis, of unit length and square to the X axis, in world coordinates.

ZAxis

.NET

@property
def ZAxis(self) -> GeoVector3

Gets the Z axis, of unit length and square to the other two.

Methods

AngleToUcs

.NET

def AngleToUcs(self, world: float) -> float

Gets the angle from this system's X axis of an angle measured from the world's.

AngleToWorld

.NET

def AngleToWorld(self, ucs: float) -> float

Gets the world angle of an angle measured from this system's X axis: 30 degrees in a system turned 45 is 75 in the world.

InPlane

.NET

@staticmethod
def InPlane(origin: GeoPoint2, angle: float, name: str | None = ...) -> CadUcs

Makes a system in the plane of the world's XY: its origin and the angle of its X axis.

IsSameAs

.NET

def IsSameAs(self, other: CadUcs, tolerance: Tolerance) -> bool

Gets whether two systems have the same origin and axes, to a tolerance, whatever their names.

ToString

.NET

def ToString(self) -> str

Gives the system as a line: its name, origin and angle.

ToUcs

.NET

def ToUcs(self, world: GeoPoint2) -> GeoPoint2

Gets a point of the world in this system: its distances along the X and Y axes from the origin.

def ToUcs(self, world: GeoPoint3) -> GeoPoint3

Gets a point of the world in this system, in three dimensions.

def ToUcs(self, world: GeoVector2) -> GeoVector2

Gets a direction of the world in this system.

ToWorld

.NET

def ToWorld(self, ucs: GeoPoint2) -> GeoPoint2

Gets the world point of a point given in this system.

def ToWorld(self, ucs: GeoPoint3) -> GeoPoint3

Gets the world point of a point given in this system, in three dimensions.

def ToWorld(self, ucs: GeoVector2) -> GeoVector2

Gets the world direction of a direction given in this system: turned by CadUcs.Angle.

WithName

.NET

def WithName(self, name: str) -> CadUcs

Gets this system under another name, or with none.