Drawing is the Eyeshot workspace designed for the 2D technical drawing in which you can create and annotate high-quality 2D views of your 3D geometry.
The Drawing 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 Drawing.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.
You can use Sheet's helper methods named BuildXXX() to quickly build some standard title blocks format.
// Creates new sheet Sheet sheet1 = new Sheet(linearUnitsType.Millimeters, 210, 297, "Sheet 1"); // Gets the title block for A4 Iso standard format BlockReference br = sheet1.BuildA4ISO(out Block a4Block, "A4_ISO"); // Initializes title block's attributes br.Attributes["Title"] = new AttributeReference("My First Sheet"); br.Attributes["Format"] = new AttributeReference("A4"); br.Attributes["DwgNo"] = new AttributeReference("Root"); br.Attributes["Scale"] = new AttributeReference("SCALE: 1:2"); br.Attributes["Sheet"] = new AttributeReference("SHEET 1 OF 1"); // Adds the block related to the title block to the Blocks collection drawing1.Blocks.Add(a4Block); // Adds its reference to the sheet sheet1.Entities.Add(br); // Adds the sheet to the Sheets collection drawing1.Sheets.Add(sheet1); // Sets the sheet as the active one drawing1.ActiveSheet = sheet1; // Refresh the control drawing1.Invalidate();
All these helper methods, internally call some other sheet's virtual method like CreateTitleBlock(), CreateBorder(), CreateBorderSeparators(), etc. that you can customize by overriding them.
If you like the standard title blocks but you want to customize the logo, you just need to override the GetLogo() method.
We represent the title block through a single Table entity, but you can use one or more entities according to your goal.
The main entities of this workspace are the Views, which are grouped into RasterViews and VectorViews.
The AddViewPlaceHolder() method allows you to add a view's placeholder while 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, design1, drawing1, "Front Vector View"); sheet1.AddViewPlaceHolder(rasterView, design1, drawing1, "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:
drawing1.Rebuild(design1, async, dirtyOnly);
Changing some properties of the view can make it 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 Design workspace 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 Drawing workspace and its advanced features, you can check our PaperDemo sample.
Starting from Eyeshot 2021, the param named "dirtyOnly" has been replaced with "changedOnly" and the public property View.HasChanged has been added.