Table of Contents

Method FromObject

Namespace
OpenCAD2D
Assembly
OpenCAD2D.Core.dll

FromObject(CadDocument, DxfEntity)

Makes a tool of an object of a drawing, as dragging it onto a palette does in AutoCAD: a block reference becomes a block tool (its block, the drawing open as source, the scale of the reference), a hatch a hatch tool (its pattern or fill, angle and scale), and a line, circle, arc, polyline, ellipse, spline, point, text, multiline text or dimension a command tool that runs the command which draws it. Each takes the object's layer, colour, linetype and lineweight as its overrides; a true colour, which a drawing's current colour cannot be, is left unset.

public static CadTool FromObject(CadDocument document, DxfEntity entity)

Parameters

document CadDocument

The document the object is in.

entity DxfEntity

The object.

Returns

CadTool

The tool; null for an object no tool draws (a table, a viewport, a block's attribute).

Exceptions

ArgumentNullException

Thrown when the document or the entity is null.