斯潘8
斯潘4
Text features,或标签,can be tricky to work with when translating between different formats,especially if you want to try and preserve some of the richer formattings like fonts,尺寸,弯曲的单词和段落结构。在本文中,we will look at how FME handles AutoCAD text features and explore some real-word examples.如果您发现您的标签变得无法管理,或者您想尝试其他方法,it might be worth checking out theMaptextLabeller插件,which you can try out for自由的.
It is important to note that when inspecting AutoCAD data with the FME Data Inspector it will almost always look different to how it is displayed in your Autodesk application (especially text).就像所有的dwg转换一样,强烈建议您使用适用的Autodesk应用程序查看和验证任何输出dwg文件。没有一个?您可以在线使用欧特克神奇的免费软件。360 Viewer.
This article will look atAutoCAD entities类型的:AutoCADPT文本和AutoCAD多文本.
如果您熟悉AutoCAD,您可能会意识到在dwg中创建文本功能有两个主要选项:
MText and Text features or entities as seen in AutoCAD 2017:Each simple text feature can only contain a single line whereas the MText feature includes all three lines.
文本is simple,单行文本功能,属性较少。在AutoCAD中,我们可以对简单的文本执行以下操作,例如移动,scale,旋转和伸展我们的话语,然而,我们在风格上有所限制,每一行新的文本都成为一个新的特性。简单文本不能用于编写较大的文本块。
MText功能提供额外的功能,它们可以包含多行文本,并且能够在同一功能中包含多个不同的字体和样式。在AutoCAD中,多行文字功能表现出您希望典型文字处理器表现的方式。
好啊,我们已经掩盖了autocad,now let's look at how FME represents these different features.
dwg文件中的所有文本功能都以点几何图形(包括多行文字)在地理上表示。此点由文本插入点决定。从dwg中读取文本功能时,最流行的文本属性,例如,尺寸(高度),旋转和字符串内容被复制并转换为FME格式属性。这些FME属性是FME数据检查器用来可视化特性的。
注:There are a number of AutoCAD specific format attributes which are不由FME数据检查器识别,这也是为什么您的dwg在FME和AutoCAD中看起来可能不同的原因。这些属性可以通过“autocad_uuu”前缀标识,并可以在FME数据检查器右侧的“格式属性”窗口中找到。每个属性都可以使用FME进行修改,但只能由AutoCAD编写器识别。For more about AutoCAD format attributes在这里.
Some interesting AutoCAD specific text attributes which are not recognised by the FME Data Inspector,但仍可以修改包括:
有关适用于文本功能的AutoCAD特定格式属性的完整列表,请参阅帮助文档。在这里
在开始使用mtext之前,让我们来看一下FME工作台中的一个简单的文本示例。让我们将一些道路(属性线特征)从地理数据库转换为dwg文件,and try to represent some of the attributes as simple labels in our output DWG and see what happens.
1.下载并打开小精灵:
eXPACTS 1reads in the Roads feature type from our geodatabase,使用贴标器从streetID和streetname创建两个线标签。It uses an AttributeManager to create and set the ‘autocad_oblique' attribute and then finally writes out the roads and labels into a single Roads layer in our output DWG.检查员就在作者面前。运行工作区,等待FME数据检查器加载。放大其中一个道路标签,您会注意到标签显示为两行文本,存储为单个文本功能。
2。运行工作区,等待FME数据检查器加载。放大其中一个道路标签,您会注意到标签显示为两行文本,存储为单个文本功能。
3.看看这些特性在由acad编写者编写之后发生了什么:找到Output.dwgfile and open it in AutoCAD.您将注意到,这两行文本已被拆分为两个单独的文本实体。我们还可以验证文本现在也是倾斜的。
output.dwg,如autocad 2017所示:标签中的每一行文本都已转换为单个简单文本实体,我们可以验证文本特征也被倾斜了15倍,正如在属性管理器.
好了,现在我们开始做更具挑战性的事情。我们看过简单的文字,那么多行文字呢?
多行文字(或多行文字)是AutoCAD实体(类型:AutoCAD多文本)它可以处理比简单的autocad_文本实体更丰富的格式。Formatting options include the ability to have multiple lines,多字体,text wrapping,还有要点,全部在一个功能中。FME可以读写AutoCAD多行文字功能,然而,与大多数AutoCAD实体一样,the appearance of such features will be different when viewed with the FME Data Inspector.
When adding a DWG reader to a workspace (and even when viewing features in the FME Data Inspector) it is always important to check the reader parameters,使用多行文字实体时尤其如此。使用FME读取多行文字实体时,用户可以选择将其多行文字功能分解为单独的文字实体(类似于this article)或者将多行文字功能保持为一个。
这个选项可以在实体选项部分的读卡器参数中找到(见下文)。选择分解多行文字实体将把每行文字拆分为单独的文字实体(这是默认设置)。如果要将多行文字保持为单个实体,请确保取消选中此框。
REALDWG reader default parameters:注意Explode MText Entitiesis selected by default.
When an unexploded MText feature is read into FME it is treated similarly to a simple text feature,然而,为了保留更丰富的格式,将创建其他格式属性。最重要的是autocad文本字符串。此格式属性包含AutoCAD使用的格式代码.如果要将其写入到AutoCAD DWG中,这一点很重要,我们将在下面的示例中看到。
在FME数据检查器中使用多行检查未爆炸的多行文字功能时,你可能会注意到它是作为一行读的,而在AutoCAD中,它被解读为若干个。This is because the text is wrapped in AutoCAD.包装宽度保留在“格式”属性中AutoCAD文本参考矩形宽度.查看FME帮助了解更多信息多行文字特定格式属性.
When FME explodes an MText feature it becomes a group of separateAutoCADPT文本所有功能共享相同AutoCAD实体处理格式属性。如果您想编辑某些部分,然后再将它们聚合在一起,这很方便。
Exploded vs unexploded MText in the FME Data Inspector:读卡器分解了绿色文本,多行文字实体的三行中的每一行现在都被视为三个单独的功能。The blue MText on the right is unexploded,请注意,我们在这里只看到一行(在AutoCAD中显示为三行)。
好的,现在我们知道如何从dwg文件引入多行文字功能,但您可能会问“我如何使用fme创建酷的多行文字功能?”
创建多行文字功能的最简单方法是德斯格斯泰勒变压器。示例2显示了一个基本工作区。Example 2 performs a similar transformation to Example 1,然而,this time our text will be written out as MText entities.
实例2: This is very similar to example1,然而,我们把属性管理器换成了dwgstyler
DWGStyler parameters:如何创建多行文字功能的简单示例。在这个例子中,我留下了文本大小,旋转和文本字段为空,因为贴标机已经为我们完成了这一部分。All we want the DWGStyler to do in this case is prepare the features so that the writer knows to save them as MText.
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),以查看正确的表示。放大标签,你会看到每个标签都是一个,two line MText entity centred on a road.在dwgstyler中设置了对正。For more information on justification check outthis article.
Text in AutoCAD:The result of example2 as seen in AutoCAD,以道路为中心的单个多行文字实体。
Intro: AutoCAD 亚搏在线workflowsγ上一节:给你的dwg一些样式:使用dwgstyler,template files,街区多γ下一步:使用AutoCAD布局
?2019安全亚搏在线软件公司|合法的