Class CadLayerTranslatorRequest
- Namespace
- OpenCAD2D
- Assembly
- OpenCAD2D.Core.dll
The Layer Translator of LAYTRANS, as data its command and the window share. Translate From lists the layers of the drawing; Translate To lists the layers it can be mapped to, those of the drawing to start with and those of the standards files loaded (a DWG, DWS, DWT or DXF) added, a layer of a name the list has taking the settings of the file's; Map and Map same make the mappings, Edit changes the settings a mapping gives, Save writes the standards file of the Translate To list with the mappings, and Translate carries them out. A drawing with OLD-WALL and OLD-DOOR, loaded with a standards file of WALL and DOOR, maps OLD-WALL to WALL and OLD-DOOR to DOOR, and translates them as one undo step.
public sealed class CadLayerTranslatorRequest
- Inheritance
-
CadLayerTranslatorRequest
- Inherited Members
Properties
- Action
Gets or sets what the dialog closed with: OK for Translate, Cancel for Cancel; Cancel until set.
- Document
Gets the document.
- FromLayers
Gets the layers of the drawing that can be translated, in ordinal order of the names, letters of either case alike: those of external references are left out.
- LoadedFiles
Gets the standards files loaded, in the order loaded.
- Log
Gets the lines of the transaction log of the last Translate, in order.
- LogFile
Gets the file the last Translate wrote its log to; null where none was written.
- Mappings
Gets the mappings made, in ordinal order of the layers translated.
- Message
Gets what the last change said where it was refused or could not be made; null where it was made.
- Settings
Gets the translator's settings; each is on until set.
- ToLayers
Gets the layers that can be translated to: the drawing's own, then those of the files loaded, in ordinal order of the names.
Methods
- Edit(IEnumerable<string>, CadTranslateLayer)
Edit…: gives the mappings of the layers named the settings of the layer they go to, as the Edit Layer dialog sets them; the layer in the Translate To list and the file it came from are left as they are.
- HideContents()
Puts the layers back as they were before any contents were shown; done when the dialog closes.
- Load(string)
Load…: adds the layers of a standards file to the Translate To list, a layer of a name the list has taking the file's settings, and the mappings the file keeps (those a Save of this wrote) for layers of the drawing that are not mapped yet. A file that cannot be read, or has no layer, changes nothing.
- Map(IEnumerable<string>, string)
Map: maps layers of the drawing to a layer of the Translate To list; a layer mapped already is mapped again. Layer 0 and Defpoints are not mapped to another layer.
- MapSame()
Map same: maps each layer of the drawing to the layer of the Translate To list of its name, letters of either case alike.
- NewLayer(CadTranslateLayer)
New…: adds a layer to the Translate To list, to map layers to and make in the drawing where it has none of the name.
- Remove(IEnumerable<string>)
Remove: takes the mappings of the layers named away, so that those layers are not translated.
- Save(string)
Save…: writes the Translate To list as a standards file, a DWG for a name ending in .dws or .dwg and a DXF otherwise, with the mappings made kept in it, so that Load reads them again. A linetype a layer names is copied into the file from the drawing or the file it came from.
- ShowContents(IReadOnlyCollection<string>)
Show layer contents when selected: shows only the layers named in the drawing, every other layer turned off, until HideContents(); nothing is done where the setting is off. None named is the drawing as it was.
- Translate()
Translate: carries the mappings out as Translate(CadDocument, IReadOnlyList<CadLayerMapping>, CadLayerTranslatorSettings, IList<string>) says, and writes the transaction log beside the drawing (
plan.dxfasplan.log) where the settings ask and the drawing has a file.