Method CreateRegion
- Namespace
- GeometryHelper.Dxf
- Assembly
- GeometryHelper.dll
CreateRegion(DxfRegionShape, DxfDatabase)
Makes a REGION of a shape, for a drawing: its ACIS data written as AutoCAD 2021 writes it for the drawing's version, SAT text in the groups of the entity for R2000 to R2010 (version 400 of ACIS for R2000, ASM 208, 212 and 215 for R2004, R2007 and R2010) and, for R2013 and R2018, SAB in the data store of the file (the section ACDSDATA, which AppendEntity(DxfEntity) writes the record of), the entity naming its data by a GUID.
public static DxfUnknownEntity CreateRegion(DxfRegionShape shape, DxfDatabase database)
Parameters
shapeDxfRegionShapeThe shape: a box 40 by 30 with a hole of radius 5 makes a region of area 1 121.46.
databaseDxfDatabaseThe drawing the region is made for; it is added to a block of that drawing.
Returns
- DxfUnknownEntity
The region, on layer 0 in no drawing, to be added by AppendEntity(DxfEntity).
Remarks
The groups are those of AutoCAD's own: for R2000 to R2010 the marker AcDbModelerGeometry, group 70 of 1 and a group 1 for each line of the SAT, each character but a space written as 0x9F less it and a caret followed by a space; for R2013 and R2018 group 290 of 1 and group 2 with the GUID. A shape of several faces (the union of two regions far apart) is one region of several lumps, as AutoCAD keeps it. Appended to a drawing of another version than it was made for, AppendEntity(DxfEntity) refuses it.
Exceptions
- ArgumentNullException
Thrown when the shape or the drawing is null.
- NotSupportedException
Thrown when the drawing is of a version before R2000, whose regions are not written.