Cells and FME

From Fmepedia


Table of contents

General Info

Cells are an element type in DGN (IGDS) format datasets. They are a point feature that is represented by a symbol of some type. The symbol definition is stored in a file called a cell library. When a cell is placed in a DGN file (whether by MicroStation or by FME) it takes its definition from this cell library.

The definitions in the cell library are really just sets of DGN features stored as a cell definition; so when a cell is placed the symbol that represents the cell is made up of lines, circles, polygons etc. Think of it as a pre-defined aggregate or collection.

Cell library definitions can only be created within MicroStation; FME is not able to create them.


Support in FME

FME supports two different versions of DGN (v7 or earlier, and v8), within which are several different types of cell.


Cell Modes

Cells can exist in a shared mode where they share a single definition within a DGN file. That way, for example, (in MicroStation) changing the colour of one cell causes all cells to change colour.


FME distinguishes between these types of cells using different values for an igds format attribute. igds_type is set to igds_cell for standard cells (what we sometimes call named cells) and is set to igds_shared_cell for shared cells.


Cell Types

There are two basic types of cell; graphic cells and point cells.


Point Cells: When a point cell is placed, the elements that make up the symbol are assigned the active symbology; for example the currently defined level, colour and linestyle.

Graphic cells: When a graphic cell is placed, the elements that make up the symbol are assigned the symbology that was active when the cell was created.


The type of cell is determined at the time that the cell definition is created, so FME cannot change a cell from graphic to point, or write a point cell as if it were a graphic cell, and there is no setting in FME to define cell type.


Cell Type Support Table
  • = supported


FME2004 FME2004ICE FME2004ICE^3 FME2005 FME2006 FME2006GB FME2007
V7
Named Cells
Shared Cells
V8
Named Cells - - - - - -
Shared Cells -


Relative Cells

Graphic cells can be placed in a relative mode, that is the level they are placed on is the cell creation level plus the active level. So a graphic cell created on levels 5 and 6, and places into a DGN file in relative mode, with an active layer of 10, would get placed on levels 15 and 16.

FME doesn't support placing relative cells, though it is under consideration.


Nested Cells

Nested cells are cells whose definition contains a feature which is itself a cell.

FME supports reading and writing nested cells.


Cell Reading

When reading from DGN, FME converts cells into an FME point geometry. However, all of their original cell settings are stored as format attributes so that it's possible to convert straight from DGN to DGN.

The explode cell setting is an IGDS reader setting. When set to no FME will merely read cells as point features. When set to yes, FME will instead drop the cell definition into its individual components (lines, arcs, text etc). There is also an option called 'preserve cell insert' which also retains the cell as a point feature when explode is set to yes.


Cell Writing

Because IGDS supports point features in their own right - actually as a zero length line - all FME point features are by default converted to that type of geometry. Because there isn't a specific geometry type that relates to cells, the user has to write cells by setting the format attribute igds_type

FME has format attributes that control cell size, scale and rotation. See the FME Readers and Writers Manual (under the Design > Feature Representation section) for more information on what format attributes are available for controlling cell output.


See this workspace for an example of writing cells to a DGN dataset.


Miscellaneous

  • If you are writing to support with a problem regarding cells, don't forget to include a copy of your cell library!
  • FME includes a sample cell library at <fme install dir>\design\default.cel
  • The sample FME cell library is v7 format


Q+A

Q) How do I write CELLS to a Design File?

A) Cell writing is permitted for both V7 and V8 design files, but for V8 is currently limited to shared cells only.

To write cells - for example to convert points (say in Shape) to MicroStation cells, ensure...

  1. the relevant cell library is selected in the 'Cell Library File' destination dataset setting.
  2. The format attribute igds_type is exposed and set to idgs_cell or igds_shared_cell (use a 'constant')
  3. The format attribute igds_cell_name is exposed and set (you don't need to use Default Cell Name in the destination dataset settings)
  4. OPTIONAL: The format attributes igds_cell_size_x/y and igds_cell_scale_x/y can be set as required.

NB: igds_element_type does not need to be set (though if it is it should be set to 2)

Make sure you have the correct cell library version - a V7 library for a V7 dgn file, and a V8 library for a V8 dgn


Q) Are cell libraries version specific?

A) Yes. You can only write cells to a V8 dataset using a V8 cell library, and cells to a V7 dataset using a V7 cell library.


Q) What are UNNAMED CELLS in MicroStation DGN format?

A) Un-named cells are FME's method of dealing with islands (or donuts) in MicroStation, which does not have a native donut feature. The donut consists of two unnamed cells, one nested inside the other.

If your donut features are built from named cells then it is likely that FME will drop the hole part or ignore the feature completely.


Q) What is the difference between how FME treats graphic and point cells in MicroStation DGN format?

A) Pretty much the same differences as are experienced in MicroStation. The cells are defined in a MicroStation cell library and FME just uses that definition. The cell type (Graphic or Point) is determined by the type in the library - ie FME can't change a cell from one type to another.


Point Cells are positioned on the active layer and using the active colour in MicroStation. Therefore when you write a point cell in FME the elements of that cell will all be stored on whatever level you have set for that feature type. The header of the cell will still be written to layer 0.


Graphic Cells are positioned on whatever layer and in whatever colour they were defined in. Therefore when you write a graphic cell in FME the elements of that cell will get stored on their original layer, regardless of what level you have defined as a format attribute or feature type definition.


Q) How can I tell whether I am using a point or a graphic cell in FME?

A) You would have to open the cell library in MicroStation to check. It's worth checking because sometimes a user forgets that the cell is a graphic cell and wonders why it is not being placed on the active layer.


Q) When I write cells to DGN format they appear the wrong scale – my circles appear more like ellipses. Why?

A) When going from DGN to DGN the source features will have the format attributes igds_size_x and igds_size_y for cells. On the destination (writer) side if these attributes are present we use them to calculate a new scale for cells, to prevent problems when source UOR's are different from destination UOR's.

When source and destination have the same UORs this calculation causes some minor variation for scale values. To prevent this, when going from dgn to dgn with the same UOR's user should remove the igds_size_x and y attributes using an AttributeRemover transformer.


Q) I’m trying to use IGDS CELL SCALE X/Y to scale my cells but it doesn’t work. Why?

A) If IGDS_CELL_SIZE_X/Y attributes exist they will cancel out your scale attributes.

In a DGN to DGN translation even if your workspace hasn't exposed the IGDS_CELL_SIZE_X or Y attributes, or even set them anywhere, somehow, they're still 'there'. You'll have to expose them in the source schema, then use an AttributeRemover to get rid of them. Then the x and y scales should work properly


Q) How do I translate Microstation cells to AutoCAD blocks?

A) To convert Microstation cells to AutoCAD blocks, the blocks must first be defined in the AutoCAD template file. To make this process as painless as possible, attachment 'CellsToBlockDefs.zip|the attached workspace (CellsToBlockDefs.fmw)' not found will create AutoCAD block definition DWG files (one block per file at 0,0 with a scale of 1 and a rotation of 0) along with an AutoCAD script file that will load all the blocks automatically and place them at 0,0. After running the workspace, start AutoCAD, run the script, erase the placed blocks, then save the template file.


Q) For MicroStation DGN how do I find which level my cell is on - Why don't I get igds cell element level for all cell features?

A) There are two basic cells types in MicroStation; point cells and graphic cells.


When a graphic cell is placed in MicroStation the elements are on whatever level they were on when the cell was created.

In FME igds_level will tell you the cell header level, but igds_cell_element_level will give you the level that the elements exist on (or the first element if there are several with different levels).


When a point cell is placed in MicroStation all of the elements in that cell are given the same level as the active level.

In FME igds_level will give you the level that the cell was placed on (igds_cell_element_level is not necessary because the elements are on the same level as the cell header).

This doesn't apply to nested cells which you would need to explode to find the element level.

Attached Files
filesizedate
comment.jpg<1kB06/05/07
yes.jpg<1kB06/05/07
User Comments Add a new comment