The Drawings is the Eyeshot environment designed for the 2D technical drawing in which you can create and annotate high quality 2D views of your 3D geometry.
The Drawings can be made up of one or more Sheets and each Sheet can contain a title block and multiple views. The current sheet is the one set in Drawings.ActiveSheet property.
The title block is a block reference containing information about the author, the date, the scaling factor, and any logos and additional information needed.
var units = linearUnitsType.Millimeters; var formatType = devDept.CustomControls.formatType.A3_ISO; Tuple<double, double> size = devDept.CustomControls.DrawingsPanel.GetFormatSize(units, formatType); Sheet sheet = new Sheet(units, size.Item1, size.Item2, "Sheet1"); Block block; BlockReference br = devDept.CustomControls.DrawingsPanel.BuildFormatBlock(formatType, sheet, out block); // Initializes attributes br.Attributes["Title"] = new AttributeReference("AR15"); br.Attributes["Format"] = new AttributeReference(formatType.GetDisplayName()); br.Attributes["DwgNo"] = new AttributeReference("Root"); br.Attributes["Scale"] = new AttributeReference(DrawingsPanel.GetFormattedScaleAttributeValue("1:2")); br.Attributes["Sheet"] = new AttributeReference("SHEET 1 OF 1"); sheet.Entities.Add(br);
You can customize the Title Block overriding the CreateTitleBlock() method of the Sheet class. We represent the title block through Table entity, that you can customize on your side.
The main entities of this environment are the Views, which are grouped into RasterView and VectorView.
The AddViewPlaceHolder() method allows you to add a view's placeholder waiting for the build of the view itself.
VectorView vectorView = new VectorView(100, 130, viewType.Front, 0.5, "Sheet1 Front Vector View"); RasterView rasterView = new RasterView(300, 130, viewType.Trimetric, 0.5, "Sheet1 Trimetric Raster View"); sheet1.AddViewPlaceHolder(vectorView, model1, drawings1, "Front Vector View"); sheet1.AddViewPlaceHolder(rasterView, model1, drawings1, "Trimetric Raster View");
Once you placed the views on the sheet (or you simply need to update them) just call the rebuild method to start building the sheets:
drawings1.Rebuild(model1, async, dirtyOnly);
Changing some properties of the view can make it to be marked as "Dirty". In this case, the selection's rectangle will be shown in the below image.
To update those views, you can call the Rebuild() method as explained before.
If something is changed on the Model instead, you can just call the Rebuild() method with dirtyOnly parameter set to false to update all the views at once (see Video)
For a more detailed sample that illustrates the Drawings environment and its advanced features, you can check our PaperDemo sample.