span8
斯潘4
There are several ways to style a DWG file with FME.The most common methods are by either implementing the use of the DWGStyler transformer,在编写器中设置层属性或利用现有模板dwg文件。本文将介绍每种方法,并提供一些下载示例,以便您自己进行实验。
Before we get started there are a few considerations to note when working with DWG files,尤其是,FME和AutoCAD表示样式的不同。即,the FME Data Inspector is limited in the way it displays lines.它只能显示线条颜色,但不包括线条类型或线条粗细等。FME数据检查员也不会显示任何区域填充模式(例如,舱口)和几乎所有的dwg翻译一样,因此,强烈建议您在AutoCAD中检查输出数据。That being said,just because the FME Data Inspector does not display these details,属性仍然存在。可以在给定要素的格式属性中(在右侧的要素信息窗口中)看到特定于AutoCAD的特性。
It is important to note that when a DWG file is written with one of the DWG writers the writer looks for and makes use of AutoCAD specific format attributes.这些可以通过“autocad_uuu”前缀来识别。
有关FME如何表示dwg功能的详细信息,请参阅FME documentation.
还建议您查看Getting Started with AutoCAD tutorial如果你还没有,在FME知识库上。本教程提供了一些关于FME如何处理AutoCAD DWG文件的好技巧。
每当您想要更多地控制输出dwg文件中各个图层的外观和状态时,强烈建议您使用模板dwg文件。模板是包含线条样式的现有dwg文件,layer properties,或块等。that you would like to be applied in your written product.This template can be applied in two places: in the writer (in the navigator pane,在“模板文件”)下,在德格斯泰勒变压器。在dwgstyler中使用模板文件时,还必须在编写器中包含模板,this is discussed further below.
模板dwg文件已被选为acad writer中的参数。
当写出dwg文件时,可以在fme中设置dwg文件的默认图层属性。There are two simple ways to assign these:
如果没有已定义层属性的模板文件,then the simplest method of setting styles for a DWG is by adjusting the Feature Type Properties in the output feature type.这在第一实例.
关于输出,DWG Feature Type,通过双击输出特征类型打开特征类型属性,然后选择带有绿色中心距的“格式参数”选项卡。在这里,您可以设置您的AutoCAD图层属性(请注意,在FME Workbench 2017中,格式参数可以在“常规”选项卡中找到)。Layer Properties will only apply to features which do not already have a color assigned to them.
This screenshot shows the default settings of the DWG writers format parameters.颜色值10对应于AutoCAD中的红色。如果没有定义了不同线型的模板文件,将无法在此处更改默认线型。
示例1的输出如autocad 2017所示。当工作区运行时,我们得到一个红色的输出,绿色和蓝色道路线。如果我们打开层属性,我们可以验证我们的设置在哪里以及如何应用。
如果已经有一个包含已定义样式的图层的dwg文件,比如里面的那个template.dwg,然后,FME允许您将这些属性作为模板文件使用。
To add a template file to a DWG writer,find the template file parameter in the Navigator pane on the left.要使模板文件正常工作,您需要确保模板dwg文件中的层名称与工作区中的输出层名称匹配。
这在example2.
示例2在表面上与示例1相同,however,our ACAD writer now has a template DWG file defined.模板dwg文件已经预先定义了“道路主干线”和“道路住宅”层(请参见下文)。We no longer need to manually set the layer properties for each of these outgoing feature types.注意,尽管我们的模板没有定义其他道路。其他道路也会像例子一中那样工作,打开“其他道路”中的格式参数,查看我们可以期望的图层特性。
IMPORTANT:When you are using a template while writing a DWG,the writer will ignore any Layer Properties you have manually set in the writer if the feature type name matches a layer name in the template file.
通过导航器向Acad编写器添加模板文件。
Layer Properties in the attached template file as viewed in AutoCAD 2017.在这里,我们可以看到标题为“道路主干线”和“道路住宅(和0)”的图层都定义了样式。These properties will be copied to the output DWG file.
示例2的输出如autocad 2017所示。当工作区运行时,我们得到一个红色的输出,绿色和蓝色的道路线,正如我们在示例一中所做的。If we open up the Layer Properties we can verify that the Layer Properties from our template file have been applied.
如果希望对默认层属性进行更多控制,然后将模板dwg应用到编写器是实现所需输出的最佳方法之一。Dwgstyler的角色,however,是为了提供一个对特性级别(而不是图层级别(或特性类型级别)的特性进行一些额外更改的机会。
dwgstyler允许您修改块的外观,课文,数据集的线条和各种区域特征。如果使用AutoCAD,那么dwgstyler中的参数应该看起来有点熟悉。本文并没有涵盖dwgstyler的所有参数,如果你有兴趣了解更多,退房DWGStyler documentation或问一个问题on the Knowledge Center.
As with the DWG file writers,dwgstyler还允许您利用现有的模板文件。将模板应用到dwgstyler时,however,这不会影响输出,但是,它允许您访问块库,line-styles or other custom attributes which are defined within the template.如果要从原始模板库创建或修改块,或更改某些层的外观以更好地适合输出dwg(例如块旋转和缩放,线条样式或自定义填充图案)。
下面是两个使用dwgstyler的示例。The first one (example three)使用转换器为文本标签提供字体和颜色,the second example (例四)使用模板文件将点要素转换为预定义块。
如上所述,使用dwgstyler将在功能级别为数据集分配样式,我们可以,因此,设置不同功能的样式,并将它们全部保存为一个图层。dwgstyler还可以同时为多个几何图形设置样式,因此无需分离出几何图形。
在示例3中,我们已经使用dwgstyler为来自地理数据库的不同“道路类型”着色。同时还有一些文字功能,which get created in the workspace by a labeller,也开始流行了。Once the features have been styled they are merged back into a single layer in our DWG output.我们的输出dwg将在一个图层中包含具有不同样式的标记道路。
示例三-下载工作区在这里
示例3输出的特写视图,如AutoCAD 2017中所示,因此我们可以看到标签。
虽然FME能够创建AutoCAD块,使用模板文件中的预定义块更容易、更快。
将模板文件应用到dwgstyler时,这不会影响前面示例中所示的输出,但是它允许您访问块库,线条样式和模板中包含的其他自定义格式。This is very helpful for when you want to either create predefined blocks from point features or change the appearance of certain features to align with any custom styles.
Download and examine例4.在这个例子中,在Dwgstyler的帮助下,we quickly convert our point features from a geodatabase into blocks which are already predefined in our template file.由于dwgstyler的存在,路灯和交通信号灯各自有各自的块定义,然后被合并到一个称为“灯”的单层中。If we open up our output in AutoCAD we can see that what was once boring old points are now funky blocks!
**IMPORTANT**If you are using a template file in a DWGStyler to define blocks then you will also need to include the same template file in your DWG writer.在特性通过dwgstyler之后,它们仍然在fme中表示为点特性,however,这些功能现在将具有其他格式属性,包括autocad块名。当编写器遇到这些属性时,它将在模板文件中查找匹配项。如果编写器中不存在模板,则默认情况下,这些功能为拒绝它们不会被书写。
示例4:使用dwgstyler创建块。在这个例子中,我们使用带有模板文件的dwgstyler来为输入点分配一些时髦的块。在这个例子中,some simple labels have been created from an applicable attribute with the help of the LabelPonitReplacer and the Offsetter.标签和点特征都写入输出dwg中的同一层。写作时,在编写器中的模板文件的帮助下,将点转换为相应的块。您可能会注意到标签没有通过dwgstyler,它们将采用默认层属性,这些属性是使用上面概述的示例1中的方法设置的。
dwgstyler blocks参数:选中blocks框并使用模板文件,如下所示,我们可以单击突出显示的省略号来访问模板中定义的任何块。In this case we have two blocks ‘Light' and ‘Signal'.在这里,我们还可以选择缩放或旋转块。
A zoomed in view of the output of example four as viewed in AutoCAD 2017.在这个观点中,we can see labelled Light blocks surrounding a Signal block.
© 2019 亚搏在线Safe Software Inc |Legal