斯潘8
斯潘4
有几种方法可以使用FME设置dwg文件的样式。最常见的方法是通过实现dwgstyler变压器的使用,在编写器中设置层属性或利用现有模板dwg文件。This article touches on each method and includes a few examples for download so you can experiment for yourself.
在开始使用dwg文件之前,需要注意一些注意事项,and in particular,differences in how FME and AutoCAD represent styles.即,FME数据检查器在显示行的方式上受到限制。It can only display line colour,但不包括线条类型或线条重量等。The FME Data Inspector also will not display any area fill patterns (e.g.,hatches).As with almost all DWG translations,it is therefore strongly recommended that you inspect your output data in AutoCAD.据说,只是因为FME数据检查器没有显示这些细节,属性仍然存在。You can see AutoCAD specific properties in the format attributes for a given feature (in the right-hand Feature Information window).
重要的是要注意,当使用dwg编写器之一编写dwg文件时,编写器会查找并使用AutoCAD特定的格式属性。这些可以通过“AutoCADI”前缀来标识。
For more information on how FME represents DWG features check out this section of theFME文档.
It is also recommended that you check out theAutoCAD教程入门在FME的知识基础上,如果你还没有。The tutorial provides some good tips on how FME handles AutoCAD DWG files.
每当您想要更多地控制输出dwg文件中各个图层的外观和状态时,强烈建议您使用模板dwg文件。A template is an existing DWG file that contains the line-styles,层属性,or blocks etc.你希望在你的书面产品中得到应用。此模板可以应用于两个位置:在编写器中(在导航窗格中,under 'Template File'),and in the DWGStyler transformer.在DWGSTER中使用模板文件时,在编写程序中还必须包含模板,这将在下面进一步讨论。
模板dwg文件已被选为acad writer中的参数。
在写dwg文件时,可以在fme中设置dwg文件的默认层属性。有两种简单的分配方法:
If you do not have a template file with Layer Properties already defined,然后,设置dwg样式的最简单方法是调整输出要素类型中的要素类型属性。This is demonstrated in the第一实例.
On the output,dwg特征类型,通过双击输出特征类型打开特征类型属性,然后选择带有绿色中心距的“格式参数”选项卡。Here you can set your AutoCAD layers properties (Note in FME Workbench 2017 the Format Parameters can be found in the General tab).图层属性仅适用于尚未指定颜色的要素。
此屏幕截图显示dwg编写器格式参数的默认设置。A color value of 10 corresponds to Red in AutoCAD.如果没有定义了不同线型的模板文件,将无法在此处更改默认线型。
The output of example one as seen in AutoCAD 2017.When the workspace is run we get an output of red,green and blue road lines.如果我们打开层属性,我们可以验证我们的设置在哪里以及如何应用。
如果已经有一个包含已定义样式的图层的dwg文件,such as the one in the模板文件,then FME lets you leverage these properties by using it as a template file.
要将模板文件添加到dwg编写器中,在左侧的导航器窗格中查找模板文件参数。For a template file to work correctly you will need to ensure that your layer names in your template DWG file match the output layer names in your workspace.
这在例2.
示例2在表面上与示例1相同,然而,我们的acad编写器现在定义了一个模板dwg文件。The template DWG file already has the layers Roads-Arterial and Roads-Residential predefined (see below).我们不再需要为这些输出特性类型手动设置层属性。Notice though that our template does not define Roads-Other.Roads-Other will work just as it did in example one,open up the Format Parameters in Roads-Other to see what Layer Properties we can expect.
重要的是:在编写dwg时使用模板时,如果要素类型名称与模板文件中的图层名称匹配,则编写器将忽略在编写器中手动设置的任何图层属性。
Adding a template file to your ACAD writer through the navigator.
在AutoCAD 2017中查看附加的模板文件中的层属性。Here we can see that the layers titled Roads-Arterial and Roads-Residential (and 0) both have defined styles.这些属性将被复制到输出dwg文件中。
示例2的输出,如autocad 2017所示。When the workspace is run we get an output of red,green and blue road lines just as we did in example one.如果打开层属性,我们可以验证模板文件中的层属性是否已应用。
If you want more control over your default layer properties,然后将模板DWG应用于写入器是实现期望输出的最佳方法之一。DWGStyler的角色,然而,是为了提供一个对特性级别(而不是图层级别(或特性类型级别)的特性进行一些额外更改的机会。
The DWGStyler lets you modify the appearance of blocks,texts,数据集的线条和各种区域特征。If you use AutoCAD then the parameters in the DWGStyler should look somewhat familiar.本文并没有涵盖dwgstyler的所有参数,如果你有兴趣了解更多,check out thedwgstyler文档or问一个问题在知识中心。
和dwg文件编写器一样,dwgstyler还允许您利用现有的模板文件。将模板应用到dwgstyler时,然而,这不会影响输出,但是,它允许您访问块库,在模板中定义的线条样式或其他自定义属性。This is very useful when you want to create or modify blocks from an original template library or change the appearance of certain layers to better suit your output DWG (e.g.block rotation and scale,线条样式或自定义填充图案)。
下面是两个使用dwgstyler的示例。第一个(例三)使用转换器为文本标签提供字体和颜色,第二个例子(例四)使用模板文件将点特征转换为预定义的块。
As mentioned above,使用dwgstyler将在功能级别为数据集分配样式,we can,因此,设置不同功能的样式,并将它们全部保存为一个图层。The DWGStyler can also style multiple geometries at the same time so there's no need to separate out geometries.
In example three,我们已经使用dwgstyler为来自地理数据库的不同“道路类型”着色。同时还有一些文字功能,它是由一个贴标工在工作区创建的,也开始流行了。一旦这些特性被设计成样式,它们就被合并回dwg输出中的单个层。我们的输出dwg将在一个图层中包含具有不同样式的标记道路。
示例三-下载工作区here
A close-up view of the output from example three as seen in AutoCAD 2017 so we can see the labels.
While FME is capable of creating AutoCAD blocks,使用模板文件中的预定义块更容易、更快。
将模板文件应用到dwgstyler时,this will not affect the output as shown in the previous examples,but rather it allows you to access the block libraries,线条样式和模板中包含的其他自定义格式。当您要从点要素创建预定义块或更改某些要素的外观以与任何自定义样式对齐时,这非常有用。
下载并检查example4.In this example,在Dwgstyler的帮助下,我们可以快速地将点特征从地理数据库转换为已经在模板文件中预定义的块。由于dwgstyler的存在,路灯和交通信号灯各自有各自的块定义,然后被合并到一个称为“灯”的单层中。如果我们在autocad中打开我们的输出,我们可以看到曾经无聊的老点现在是时髦的块!
**重要**如果使用dwgstyler中的模板文件定义块,则还需要在dwg编写器中包含相同的模板文件。在特性通过dwgstyler之后,它们仍然在fme中表示为点特性,然而,the features will now have additional format attributes including autocad_block_name.When the writer encounters these attributes it will look in the template file to find a match.If no template exists in the writer then by default these features are拒绝and they will not be written.
Example 4: Creating blocks with the DWGStyler.In this example,我们使用带有模板文件的dwgstyler来为输入点分配一些时髦的块。在这个例子中,在labelponitreplacer和offsetter的帮助下,从一个适用的属性创建了一些简单的标签。标签和点特征都写入输出dwg中的同一层。Upon writing,the points are converted to the respective blocks with the help of the template file in the writer.您可能会注意到标签没有通过dwgstyler,它们将采用默认层属性,这些属性是使用上面概述的示例1中的方法设置的。
DWGSTESTLE块参数:如图所示,使用块框和使用的模板文件,我们可以单击突出显示的省略号来访问模板中定义的任何块。在这种情况下,我们有两个模块“灯”和“信号”。Here we could have also chosen to scale or rotate the blocks.
A放大了示例4的输出视图,如在AutoCAD 2017中查看的。在这个观点中,we can see labelled Light blocks surrounding a Signal block.
?2019安全亚搏在线软件公司|合法的