span8
span4
The two most popular CAD formats,MicroStation DGN和AutoCAD DWG,have their symbology defined by a large number of format attributes.It can be very time consuming to create database table fields to store all of these attributes,but most are required in order to recreate the data's appearance when writing back to CAD.As well,FME continues to add format attributes as it increases it CAD capabilities,so the table may need occasional updates.
An alternative to individual fields for each format attribute is to pack all the attributes into a single blob field,which would be unpacked when the features are written back to CAD.
The FME function @SupplyAttributes (accessible through the FunctionCaller transformer) has a mode that will pack all of the feature's attributes into a single new attribute in the structure name:value:name:value:name:value:etc.@SupplyAttributes can also unpack this packed attribute back to the original attributes.However,when packing,@SupplyAttributes包含所有属性,including those that are not required or desired.
The custom transformer PackAttributes (available for download above,或者通过fme store)使用pythoncaller将特性属性打包到@supplyAttributes结构中,but allows you to set a filter prefix for the attributes to be packed.So to store all of the DGN file's format attributes,but ignore any user or generic FME attributes,you can set the filter to "igds_".For DWG files,你可以用“acad_uuu”代替。
The workspaces DGNToSqlite and SqliteToDGN (available for download above) illustrate how to implement this process:
DGNToSqlite reads the Microstation DGN file MajorRoads.dgn (also available for download above),使用pack attributes将格式属性打包为新属性“igds-packed”,then writes the geometry and the packed attribute to Sqlite Spatial.
SqliteToDGN reads the Sqlite table,uses @SupplyAttributes in a FunctionCaller to restore the packed attributes back on to the feature,then writes out to a new DGN file.
All of the symbology from MajorRoads.DGN,including multi-lines and custom linestyles,is restored in the new file.
This method of storing CAD attributes is future-proofed.Any additional format attributes added in future versions of FME will be automatically included in the packed attribute due to the format prefix,and no table modifications will be necessary.
If you will be editing the location of CAD data while it is stored in the database,you will need to remove any locational attributes from the packed attribute and store them in separate fields.The easiest way to do this is to rename the attributes to remove the common filter prefix before packing.
How do I convert curved text from Geodatabase to Microstation DGN?
MicroStation Text Styles in FME 2015.1 and newer
Reading Basic Geodatabase Annotation - GDB to DGN
MicroStation Text Styles in FME 2015.0 and older
Reading Basic Geodatabase Annotation - GDB to DWG
© 2019 亚搏在线Safe Software Inc |法律