斯潘8
span4
文本功能,or labels,在不同格式之间进行翻译时可能很难处理,尤其是如果你想保留一些更丰富的格式,比如字体,尺寸,curved words and paragraph structure.In this article,我们将了解FME如何处理AutoCAD文本功能,并探索一些真实的单词示例。如果您发现您的标签变得无法管理,或者您想尝试其他方法,可能值得一看MaptextLabeller插件,你可以试试看free.
重要的是要注意,使用FME数据检查器检查AutoCAD数据时,其外观几乎总是与在Autodesk应用程序(尤其是文本)中显示的外观不同。就像所有的dwg转换一样,强烈建议您使用适用的Autodesk应用程序查看和验证任何输出dwg文件。没有?you can use Autodesk's fantastic free online360观众.
本文将介绍AutoCAD实体of type:autocad_text和AutoCAD多文本.
如果您熟悉AutoCAD,您可能会意识到在dwg中创建文本功能有两个主要选项:
如AutoCAD 2017中所示的多行文字和文本功能或实体:每个简单文本功能只能包含一行,而多行文本功能包含所有三行。
文本很简单,单行文本功能,属性较少。There are several things we can do with simple text in AutoCAD such as move,规模,rotate and stretch our words,然而,我们在风格上有所限制,每一行新的文本都成为一个新的特性。Simple text would not be used for writing larger blocks of text.
多文本功能提供额外的功能,它们可以包含多行文本,并且能够在同一功能中包含多个不同的字体和样式。In AutoCAD,MText features behave how you would expect typical word processors to behave.
好啊,we've covered off AutoCAD,现在让我们看看FME是如何表示这些不同的特性的。
dwg文件中的所有文本功能都以点几何图形(包括多行文字)在地理上表示。This point is determined by the text insertion point.从dwg中读取文本功能时,最流行的文本属性,例如,尺寸(高度)旋转和字符串内容被复制并转换为FME格式属性。这些FME属性是FME数据检查器用来可视化特性的。
注:有许多特定于AutoCAD的格式属性notrecognised by the FME Data Inspector and is the reason why your DWG might look different in FME and AutoCAD.These attributes can be identified by the ‘autocad_' prefix and can be found in the Format Attribute window on the right-hand side of the FME Data Inspector.Each of the attributes can be modified with FME but will only be recognised by the AutoCAD writers.有关AutoCAD格式属性的详细信息在这里.
一些有趣的特定于AutoCAD的文本属性,这些属性不被FME数据检查器识别,but can still be modified include:
For a full list of AutoCAD specific format attributes which are applicable to Text features check out the Help Documentation在这里
Before we get started on MText,let's take a look at a simple text example in FME Workbench.让我们将一些道路(属性线特征)从地理数据库转换为dwg文件,并尝试将一些属性表示为输出dwg中的简单标签,看看会发生什么。
1。Download and openexample1.fmwt:
E示例1从我们的地理数据库读取道路特征类型,uses the Labeller to create two line labels from StreetId and StreetName.它使用一个attributeManager来创建和设置“autocad_斜线”属性,然后最终在输出dwg中将道路和标签写出到一个单独的道路层中。检查员就在作者面前。运行工作区,等待FME数据检查器加载。Zoom into one of the road labels and you will notice that the labels are displayed as two lines of text that are stored as a single text feature.
2。运行工作区,等待FME数据检查器加载。Zoom into one of the road labels and you will notice that the labels are displayed as two lines of text that are stored as a single text feature.
三。看看这些特性在由acad编写者编写之后发生了什么:找到输出.dwg文件并在AutoCAD中打开。您将注意到,这两行文本已被拆分为两个单独的文本实体。我们还可以验证文本现在也是倾斜的。
output.dwg,如autocad 2017所示: Each of the lines of text from our labels have been converted to single simple text entities,we can verify that the text features are also obliquing by a factor of 15 as was set in theAttributeManager.
OK now we're getting into the more challenging stuff.我们看过简单的文字,so what about MText?
多行文字(或多行文字)是AutoCAD实体(类型:AutoCAD多文本)它可以处理比简单的autocad_文本实体更丰富的格式。格式化选项包括具有多行的功能,多种字体,文字环绕,还有要点,all within a single feature.FME可以读写AutoCAD多行文字功能,然而,as with most AutoCAD entities,使用FME数据检查员查看时,这些特征的外观会有所不同。
将dwg阅读器添加到工作区时(甚至在查看FME数据检查器中的功能时),检查阅读器参数总是很重要的,this is especially true when working with MText entities.使用FME读取多行文字实体时,a user can choose to either explode their MText features into individual text entities (similar to exploding blocks which is covered in这篇文章)或者将多行文字功能保持为一个。
这个选项可以在实体选项部分的读卡器参数中找到(见下文)。Choosing to explode your MText entities will split out each of the lines of text into separate text entities (this is the default).如果要将多行文字保持为单个实体,请确保取消选中此框。
realdwg阅读器默认参数:note that分解多行文字实体默认选中。
当一个未公开的多行文字特征被读取到FME中时,它被处理为类似于一个简单的文字特征。然而,in order to preserve the richer formatting,additional format attributes are created.最重要的是autocad文本字符串。此格式属性包含formatting code used by AutoCAD.如果要将其写入到AutoCAD DWG中,这一点很重要,我们将在下面的示例中看到。
在FME数据检查器中使用多行检查未爆炸的多行文字功能时,你可能会注意到它是作为一行读的,而在AutoCAD中,it is read as several.这是因为文本是用AutoCAD包装的。The wrapping width is preserved within the format attributeAutoCAD文本参考矩形宽度.Check out the FME help for more info onMText specific format attributes.
当FME分解多行文字功能时,它将成为一组单独的autocad_text所有功能共享相同AutoCAD实体处理format attribute.如果您想编辑某些部分,然后再将它们聚合在一起,这很方便。
FME数据检查员中的分解多行文字与未爆炸多行文字:The green text has been exploded by the reader and each of the three lines from the MText entity are now treated as three individual features.右边的蓝色多行文字未爆炸,请注意,我们在这里只看到一行(在AutoCAD中显示为三行)。
OK so now we know how to bring in MText features from a DWG file but you may be asking "how do I use FME to create cool MText features?"
创建多行文字功能的最简单方法是德格斯泰勒transformer.Example 2 shows this with a basic workspace.示例2执行与示例1类似的转换,然而,这一次,我们的文本将作为多行文本实体写出。
Example2: T他的与示例1非常相似,然而,we have swapped out the AttributeManager for a DWGStyler
dwgstyler参数:A simple example of how to create MText features.在这个例子中,我留下了文本大小,旋转和文本字段为空,因为贴标机已经为我们完成了这一部分。在这种情况下,我们只希望dwgstyler准备特性,以便编写人员知道将它们保存为多行文本。
autocad_attach_point (encoded: utf-8)autocad_middle_centerautocad_entity (encoded: utf-8)autocad_multi_textautocad_mtext_string (encoded: utf-8){\fTimes New Roman|b0|i0;Pendrell StID: 11418}
**重要**请记住在AutoCAD中打开结果(output_text.dwg),以查看正确的表示。放大标签,你会看到每个标签都是一个,以道路为中心的双线多行文字实体。The justification was set in the DWGStyler.有关理由的详细信息,请签出这篇文章.
AutoCAD中的文本:示例2在AutoCAD中的结果,a single MText entity centered on a road.
简介:AutoCAD工作流亚搏在线小精灵上一节:给你的dwg一些样式:使用dwgstyler,模板文件,块和更多小精灵下一步:使用AutoCAD布局
?2019安全亚搏在线软件公司|合法的