<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Export MTEXT Contents in AutoCAD Forum</title>
    <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6266501#M284458</link>
    <description>&lt;P&gt;Is it possible to use an AutoCad plugin to copy the contents&amp;nbsp;of each MTEXT item into the hyperlink&amp;nbsp;property field?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ask because the hyperlink property does transfer to Navisworks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply!&lt;/P&gt;</description>
    <pubDate>Tue, 12 Apr 2016 17:50:01 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-04-12T17:50:01Z</dc:date>
    <item>
      <title>Export MTEXT Contents</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6266304#M284456</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using the Navisworks API to create a plugin that performs certain tasks with mtext objects. However, the MTEXT properties in Navisworks do not contain the Contents property that is in AutoCad.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, here is a picture of the model item properties in AutoCad. It shows that the Contents are equal to "1138".&lt;/P&gt;&lt;P&gt;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/231502i92B0EFE6147259C6/image-size/original?v=lz-1&amp;amp;px=-1" border="0" alt="MTEXT Contents AC.PNG" title="MTEXT Contents AC.PNG" width="405" height="258" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the same model item in Navisworks. I've used a plugin that shows all of the properties for a model item so you can see that the contents aren't transferred when the .dwg imports into Navisworks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/231504iDAD514DDC7C9F2F3/image-size/original?v=lz-1&amp;amp;px=-1" border="0" alt="MTEXT Contents NW.PNG" title="MTEXT Contents NW.PNG" width="429" height="346" /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there something I can from the AutoCad side to make this work? Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 16:36:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6266304#M284456</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-12T16:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Export MTEXT Contents</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6266493#M284457</link>
      <description>Nope.</description>
      <pubDate>Tue, 12 Apr 2016 17:46:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6266493#M284457</guid>
      <dc:creator>pendean</dc:creator>
      <dc:date>2016-04-12T17:46:06Z</dc:date>
    </item>
    <item>
      <title>Re: Export MTEXT Contents</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6266501#M284458</link>
      <description>&lt;P&gt;Is it possible to use an AutoCad plugin to copy the contents&amp;nbsp;of each MTEXT item into the hyperlink&amp;nbsp;property field?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I ask because the hyperlink property does transfer to Navisworks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply!&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 17:50:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6266501#M284458</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-12T17:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: Export MTEXT Contents</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6267257#M284459</link>
      <description>&lt;P&gt;Hi&amp;nbsp;austin.rausch9NCU2&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Are you trying to capture all the text from the AutoCAD drawing or just certain pieces? if you are doing the latter, do blocks and attributes&amp;nbsp;work better to get it into Navisworks?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Apr 2016 23:35:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6267257#M284459</guid>
      <dc:creator>john.vellek</dc:creator>
      <dc:date>2016-04-12T23:35:09Z</dc:date>
    </item>
    <item>
      <title>Re: Export MTEXT Contents</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6271260#M284460</link>
      <description>&lt;P&gt;Good morning&amp;nbsp;austin.rausch9NCU2,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I am checking back to see if you had resolved your&amp;nbsp;problem. Please add a post with your results so other Forum users can benefit.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Apr 2016 16:30:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6271260#M284460</guid>
      <dc:creator>john.vellek</dc:creator>
      <dc:date>2016-04-14T16:30:12Z</dc:date>
    </item>
    <item>
      <title>Re: Export MTEXT Contents</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6273714#M284461</link>
      <description>&lt;P&gt;I'm trying to capture the contents of only the MTEXT items and have them persist when I open the file in Navisworks. From what I've seen, I don't think this is possible unless I put the contents into another property field. There may be a solution by not creating them using MTEXT, but I'm not creating the models. I'm using models that are given to me by other departments.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to make a Navisworks plugin that generates saved viewpoints over each individual room. Everything works fine, except I need the saved viewpoint names to be the room numbers. This isn't possible because Navisworks sees MTEXT as a model item and the "contents" property field of the MTEXT model item aren't loaded into Navisworks.&lt;/P&gt;</description>
      <pubDate>Fri, 15 Apr 2016 18:50:46 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6273714#M284461</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-15T18:50:46Z</dc:date>
    </item>
    <item>
      <title>Re: Export MTEXT Contents</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6276905#M284462</link>
      <description>&lt;P&gt;I've found a solution that works for me. I wrote a small Autocad Plugin that finds all MTEXT items and creates a hyperlink in each with the URL and Description both equal to the contents. Navisworks will import hyperlinks (if there is a description) from .dwg files, so instead of searching for the MTEXT contents in my navisworks plugin, I just search for the MTEXT URL. The code for the plugin is below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using Autodesk.AutoCAD.Runtime;
using Autodesk.AutoCAD.ApplicationServices;
using Autodesk.AutoCAD.DatabaseServices;
using Autodesk.AutoCAD.Geometry;

[assembly: CommandClass(typeof(SaveContents.Class1))]

namespace SaveContents
{
    public class Class1
    {
        [CommandMethod("SaveCon")]
        public static void TestTextChange()
        {
            Document doc = Application.DocumentManager.MdiActiveDocument;
            Database db = doc.Database;

            using (Transaction tr = db.TransactionManager.StartTransaction())
            {
                BlockTableRecord btr = (BlockTableRecord)tr.GetObject
                    (SymbolUtilityServices.GetBlockModelSpaceId(db), OpenMode.ForRead);

                foreach (ObjectId id in btr)
                {
                    Entity currentEntity = tr.GetObject(id, OpenMode.ForWrite, false) as Entity;
                    if (currentEntity == null)
                    {
                        continue;
                    }
                    if (currentEntity.GetType() == typeof(MText))
                    {
                        HyperLink hyper = new HyperLink();
                        hyper.Name = ((MText)currentEntity).Contents;
                        hyper.Description = ((MText)currentEntity).Contents;
                        ((MText)currentEntity).Hyperlinks.Add(hyper);
                    }
                }
                tr.Commit();
            }
        }
    }
}&lt;/PRE&gt;</description>
      <pubDate>Mon, 18 Apr 2016 15:09:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6276905#M284462</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-04-18T15:09:36Z</dc:date>
    </item>
    <item>
      <title>Re: Export MTEXT Contents</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6750676#M284463</link>
      <description>&lt;P&gt;Hi Austin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would you mind sharing the plugin you created?? I am very interested in trying it out...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 05:52:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6750676#M284463</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-15T05:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Export MTEXT Contents</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6752677#M284464</link>
      <description>&lt;P&gt;Hi Paul,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the plugin itself. Extract that to your&amp;nbsp;"C:\Program Files\Autodesk\AutoCAD 2016\Plugins" folder (I'm using 2016 MEP version). Once you've done that, open the file you want to use and do a NETLOAD and select the SaveContents plugin from that directory. After that, just select all MTEXT items (or only the MTEXT you want to use) and run the command SAVECON. This will save the Text Contents field from each MTEXT item selected as a Hyperlink on it's parent MTEXT model item. Then, if you open the file in Navisworks, you can use these hyperlinks to find the text contents of each MTEXT&amp;nbsp;programmatically. I usually use a script in Navisworks that eliminates the "/L" or "/P" from the MTEXT if it has multiple lines.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope it helps you!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Dec 2016 20:16:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6752677#M284464</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-15T20:16:20Z</dc:date>
    </item>
    <item>
      <title>Re: Export MTEXT Contents</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6753201#M284465</link>
      <description>&lt;P&gt;That works great, thanks so much Austin!! &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to use an objects layer to fill out the hyperlink?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also&amp;nbsp;do you know of a way to script Navisworks to change selected items Hyperlinks to Labels and wipe the 'Link to file or URL'&amp;nbsp;field?&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 01:08:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6753201#M284465</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-16T01:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: Export MTEXT Contents</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6754906#M284466</link>
      <description>&lt;P&gt;Glad it could help somebody!&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To answer your first question, just turn on the "Layer Properties" window and select the model item that you want to edit. You should be able to manually edit the hyperlink from there. I think that's what you were asking me...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As for the second question, I'm sure there are ways to do both of those things but I haven't researched enough to know what they are. I would assume that they probably have to be done in AutoCad, seeing as how Navisworks isn't really designed for editing ModelItems.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Anyway, I hope that helps. I'm not really an Autodesk expert, I'm definitely more of a coder first. I'm definitely not familiar with all of the Autodesk products and the functionalities of their APIs.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Dec 2016 19:31:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6754906#M284466</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-12-16T19:31:39Z</dc:date>
    </item>
    <item>
      <title>Re: Export MTEXT Contents</title>
      <link>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6809343#M284467</link>
      <description>&lt;P&gt;No sorry for not being clear, I was wondering if your code could be changed to to fill out the hyperlinks of multiple object types to match the layer name the objects are on?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;&lt;P&gt;Paul&lt;/P&gt;</description>
      <pubDate>Mon, 16 Jan 2017 23:55:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/autocad-forum/export-mtext-contents/m-p/6809343#M284467</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-16T23:55:21Z</dc:date>
    </item>
  </channel>
</rss>

