Table of Contents

Class CadUcsManager

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

The user coordinate systems of a drawing open in the presenter, as AutoCAD keeps them: the current system of model space and that of paper space, up to ten earlier ones of each for UCS Previous, the named systems of the drawing's UCS table, and how the UCS icon is shown.

public sealed class CadUcsManager
Inheritance
CadUcsManager
Inherited Members

Remarks

They are read from the drawing when first asked for: the current systems from the header ($UCSORG, $UCSXDIR, $UCSYDIR, $UCSNAME and the $PUCS ones of paper space), the named ones from the UCS table. As in AutoCAD 2021, a change of system is a step of the drawing's undo: every change (UCS in any of its forms, a named system saved, deleted or renamed) is one step named UCS, or part of the step of the command or group it is made in, and U takes it back with the earlier systems kept for UCS Previous, REDO puts it again. A 3point UCS, then World, then U, REDO and U gives back the 3point one with the World one in the list, as AutoCAD does. The drawing is given them when it is saved, the table and the header written as AutoCAD writes them; one with nothing changed is saved with its own bytes.

All the layouts share the one system of paper space the header keeps; AutoCAD keeps one in each layout as well.

Properties

Current

Gets the current system of the space the canvas shows.

FollowToPlan

Gets or sets whether the view goes to the plan of the system when it changes (UCSFOLLOW, "Update view to Plan when UCS is changed" of the UCS dialog); off until set, as AutoCAD's. The view of the presenter is not turned, so the setting is kept and changes nothing else.

IconAtOrigin

Gets or sets whether the UCS icon is drawn at the origin of the system where the origin is in view (UCSICON ORigin), else at the lower left corner (Noorigin); at the origin until set.

IconOn

Gets or sets whether the UCS icon is shown (UCSICON ON and OFF); on until set, as AutoCAD's.

IconSelectable

Gets or sets whether the UCS icon can be selected (UCSSELECTMODE, "Allow Selecting UCS icon" of the UCS dialog); on until set, as AutoCAD's. The presenter draws the icon and does not select it, so the setting is kept and changes nothing else.

IsModified

Gets whether the systems differ from those the drawing was opened or last saved with: a change taken back by U is none.

Model

Gets the current system of model space.

Named

Gets the named systems, in ordinal order of their names, letters of either case the same.

Paper

Gets the current system of paper space, which every layout shares.

SaveWithViewport

Gets or sets whether each viewport keeps its own UCS (UCSVP, "Save UCS with viewport" of the UCS dialog); on until set, as AutoCAD's. A space has one view here, so the setting is kept and changes nothing else.

Working

Gets the system points are given in for the space the canvas shows: the current one, or the world where the current one is not parallel to the view (IsPlanar), as a system turned out of the plan read from a file.

Methods

CurrentOf(CadSpace)

Gets the current system of a space: Model for model space, Paper for a layout.

Delete(string)

Deletes a named system, as UCS Delete; a current system of that name is left with none, as AutoCAD's NO NAME.

Find(string)

Gets the named system of a name, letters of either case the same; null for none.

Previous()

Makes the system current before the last change current again in the space the canvas shows, as UCS Previous.

Rename(string, string)

Renames a named system, as the UCS dialog does; a current system of that name takes the new one.

Restore(string)

Makes a named system current in the space the canvas shows, as UCS Restore.

Save(string)

Saves the current system of the space the canvas shows under a name, replacing a named system of that name, and names the current system so, as UCS Save; the system as it was, unnamed, is kept for Previous() first, as AutoCAD does.

SetCurrent(CadUcs)

Makes a system current in the space the canvas shows, the one it replaces kept for Previous(), ten at most. As in AutoCAD the current system is kept every time, a system of the same origin and axes as the current one, to the tolerance of Default, included: UCS World in the World UCS adds one more World for UCS Previous to give back.

WorkingOf(CadSpace)

Gets the system points are given in for a space, as Working says.

Events

Changed

Raised when a current system, a named one or the icon changes.