<?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: Extract Text string from Field in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144411#M49680</link>
    <description>Figured it out, Thanks.

AcadEntity works with FIELD. Thats what I was looking for. Got my code
working now.



Have a great week,

Dan

"Dan" &lt;DANDERSON&gt; wrote in message
news:415982b6$1_2@newsprd01...
&amp;gt; I understand how to truncate text to get what I want from the text string,
&amp;gt; but I have not figured out how to get the string from the field yet.  I
know
&amp;gt; how to get the field expression.
&amp;gt;
&amp;gt; I must be overlooking something:
&amp;gt;
&amp;gt; Sub CaptureFieldText()
&amp;gt;
&amp;gt;  ' Create the selection set
&amp;gt; Dim ssetObj As AcadSelectionSet
&amp;gt; Dim point(0 To 2) As Double
&amp;gt; Dim fText As AcadText                                                ' Not
&amp;gt; sure if this is the right object for the field
&amp;gt; Dim sysVarName As String
&amp;gt; Dim sysVarData As String
&amp;gt;         sysVarName = "CTAB"
&amp;gt;         sysVarData = "Model"
&amp;gt;         ThisDrawing.SetVariable sysVarName, sysVarData
&amp;gt;         Set ssetObj = ThisDrawing.SelectionSets.Add("capField")
&amp;gt;         point(0) = -100: point(1) = 525.221859: point(2) = 0
&amp;gt;         ssetObj.SelectAtPoint point
&amp;gt;         For Each fText In ssetObj
&amp;gt;
&amp;gt; 'Here is where I wanted to place code to extract string from field
&amp;gt;
&amp;gt;         Next fText
&amp;gt;             ThisDrawing.SelectionSets.Item("capField").Delete
&amp;gt;         Set Layout = Nothing
&amp;gt;         Set fText = Nothing
&amp;gt; End Sub
&amp;gt;
&amp;gt; Any help is appreciated. I am sure there are better habits, and coding
could
&amp;gt; be optimized, flame awway.
&amp;gt; I am still very new at this,
&amp;gt;
&amp;gt; Thanks,
&amp;gt; Dan
&amp;gt;
&amp;gt; "Ed Jobe" &lt;NOT.EDLJOBE&gt; wrote in message
&amp;gt; news:415878f2$1_1@newsprd01...
&amp;gt; &amp;gt; Use the TextString property to get what was evaluated. If there is other
&amp;gt; &amp;gt; text besides the field, use the standard string manipulation functions
&amp;gt; (e.g.
&amp;gt; &amp;gt; InStr) to extract the field info from the TexString.
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; -- 
&amp;gt; &amp;gt; ----
&amp;gt; &amp;gt; Ed
&amp;gt; &amp;gt; ----
&amp;gt; &amp;gt; "Dan" &lt;DANDERSON&gt; wrote in message
&amp;gt; &amp;gt; news:41586a3f_3@newsprd01...
&amp;gt; &amp;gt; &amp;gt; I have learned how to create a field in VB using the Object Id, but I
am
&amp;gt; &amp;gt; &amp;gt; struggling with how to extract the string itself from a field, place
it
&amp;gt; &amp;gt; into
&amp;gt; &amp;gt; &amp;gt; the clipboard, to be copied into another application (Excel).
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Thank you,
&amp;gt; &amp;gt; &amp;gt; Dan
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt;
&amp;gt;&lt;/DANDERSON&gt;&lt;/NOT.EDLJOBE&gt;&lt;/DANDERSON&gt;</description>
    <pubDate>Tue, 28 Sep 2004 21:36:04 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2004-09-28T21:36:04Z</dc:date>
    <item>
      <title>Extract Text string from Field</title>
      <link>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144408#M49677</link>
      <description>I have learned how to create a field in VB using the Object Id, but I am
struggling with how to extract the string itself from a field, place it into
the clipboard, to be copied into another application (Excel).


Thank you,
Dan</description>
      <pubDate>Mon, 27 Sep 2004 19:29:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144408#M49677</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-09-27T19:29:53Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Text string from Field</title>
      <link>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144409#M49678</link>
      <description>Use the TextString property to get what was evaluated. If there is other
text besides the field, use the standard string manipulation functions (e.g.
InStr) to extract the field info from the TexString.

-- 
----
Ed
----
"Dan" &lt;DANDERSON&gt; wrote in message
news:41586a3f_3@newsprd01...
&amp;gt; I have learned how to create a field in VB using the Object Id, but I am
&amp;gt; struggling with how to extract the string itself from a field, place it
into
&amp;gt; the clipboard, to be copied into another application (Excel).
&amp;gt;
&amp;gt;
&amp;gt; Thank you,
&amp;gt; Dan
&amp;gt;
&amp;gt;&lt;/DANDERSON&gt;</description>
      <pubDate>Mon, 27 Sep 2004 20:32:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144409#M49678</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-09-27T20:32:50Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Text string from Field</title>
      <link>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144410#M49679</link>
      <description>I understand how to truncate text to get what I want from the text string,
but I have not figured out how to get the string from the field yet.  I know
how to get the field expression.

I must be overlooking something:

Sub CaptureFieldText()

 ' Create the selection set
Dim ssetObj As AcadSelectionSet
Dim point(0 To 2) As Double
Dim fText As AcadText                                                ' Not
sure if this is the right object for the field
Dim sysVarName As String
Dim sysVarData As String
        sysVarName = "CTAB"
        sysVarData = "Model"
        ThisDrawing.SetVariable sysVarName, sysVarData
        Set ssetObj = ThisDrawing.SelectionSets.Add("capField")
        point(0) = -100: point(1) = 525.221859: point(2) = 0
        ssetObj.SelectAtPoint point
        For Each fText In ssetObj

'Here is where I wanted to place code to extract string from field

        Next fText
            ThisDrawing.SelectionSets.Item("capField").Delete
        Set Layout = Nothing
        Set fText = Nothing
End Sub

Any help is appreciated. I am sure there are better habits, and coding could
be optimized, flame awway.
I am still very new at this,

Thanks,
Dan

"Ed Jobe" &lt;NOT.EDLJOBE&gt; wrote in message
news:415878f2$1_1@newsprd01...
&amp;gt; Use the TextString property to get what was evaluated. If there is other
&amp;gt; text besides the field, use the standard string manipulation functions
(e.g.
&amp;gt; InStr) to extract the field info from the TexString.
&amp;gt;
&amp;gt; -- 
&amp;gt; ----
&amp;gt; Ed
&amp;gt; ----
&amp;gt; "Dan" &lt;DANDERSON&gt; wrote in message
&amp;gt; news:41586a3f_3@newsprd01...
&amp;gt; &amp;gt; I have learned how to create a field in VB using the Object Id, but I am
&amp;gt; &amp;gt; struggling with how to extract the string itself from a field, place it
&amp;gt; into
&amp;gt; &amp;gt; the clipboard, to be copied into another application (Excel).
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; Thank you,
&amp;gt; &amp;gt; Dan
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt;
&amp;gt;&lt;/DANDERSON&gt;&lt;/NOT.EDLJOBE&gt;</description>
      <pubDate>Tue, 28 Sep 2004 15:26:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144410#M49679</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-09-28T15:26:33Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Text string from Field</title>
      <link>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144411#M49680</link>
      <description>Figured it out, Thanks.

AcadEntity works with FIELD. Thats what I was looking for. Got my code
working now.



Have a great week,

Dan

"Dan" &lt;DANDERSON&gt; wrote in message
news:415982b6$1_2@newsprd01...
&amp;gt; I understand how to truncate text to get what I want from the text string,
&amp;gt; but I have not figured out how to get the string from the field yet.  I
know
&amp;gt; how to get the field expression.
&amp;gt;
&amp;gt; I must be overlooking something:
&amp;gt;
&amp;gt; Sub CaptureFieldText()
&amp;gt;
&amp;gt;  ' Create the selection set
&amp;gt; Dim ssetObj As AcadSelectionSet
&amp;gt; Dim point(0 To 2) As Double
&amp;gt; Dim fText As AcadText                                                ' Not
&amp;gt; sure if this is the right object for the field
&amp;gt; Dim sysVarName As String
&amp;gt; Dim sysVarData As String
&amp;gt;         sysVarName = "CTAB"
&amp;gt;         sysVarData = "Model"
&amp;gt;         ThisDrawing.SetVariable sysVarName, sysVarData
&amp;gt;         Set ssetObj = ThisDrawing.SelectionSets.Add("capField")
&amp;gt;         point(0) = -100: point(1) = 525.221859: point(2) = 0
&amp;gt;         ssetObj.SelectAtPoint point
&amp;gt;         For Each fText In ssetObj
&amp;gt;
&amp;gt; 'Here is where I wanted to place code to extract string from field
&amp;gt;
&amp;gt;         Next fText
&amp;gt;             ThisDrawing.SelectionSets.Item("capField").Delete
&amp;gt;         Set Layout = Nothing
&amp;gt;         Set fText = Nothing
&amp;gt; End Sub
&amp;gt;
&amp;gt; Any help is appreciated. I am sure there are better habits, and coding
could
&amp;gt; be optimized, flame awway.
&amp;gt; I am still very new at this,
&amp;gt;
&amp;gt; Thanks,
&amp;gt; Dan
&amp;gt;
&amp;gt; "Ed Jobe" &lt;NOT.EDLJOBE&gt; wrote in message
&amp;gt; news:415878f2$1_1@newsprd01...
&amp;gt; &amp;gt; Use the TextString property to get what was evaluated. If there is other
&amp;gt; &amp;gt; text besides the field, use the standard string manipulation functions
&amp;gt; (e.g.
&amp;gt; &amp;gt; InStr) to extract the field info from the TexString.
&amp;gt; &amp;gt;
&amp;gt; &amp;gt; -- 
&amp;gt; &amp;gt; ----
&amp;gt; &amp;gt; Ed
&amp;gt; &amp;gt; ----
&amp;gt; &amp;gt; "Dan" &lt;DANDERSON&gt; wrote in message
&amp;gt; &amp;gt; news:41586a3f_3@newsprd01...
&amp;gt; &amp;gt; &amp;gt; I have learned how to create a field in VB using the Object Id, but I
am
&amp;gt; &amp;gt; &amp;gt; struggling with how to extract the string itself from a field, place
it
&amp;gt; &amp;gt; into
&amp;gt; &amp;gt; &amp;gt; the clipboard, to be copied into another application (Excel).
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt; Thank you,
&amp;gt; &amp;gt; &amp;gt; Dan
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt; &amp;gt;
&amp;gt;
&amp;gt;&lt;/DANDERSON&gt;&lt;/NOT.EDLJOBE&gt;&lt;/DANDERSON&gt;</description>
      <pubDate>Tue, 28 Sep 2004 21:36:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144411#M49680</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2004-09-28T21:36:04Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Text string from Field</title>
      <link>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144412#M49681</link>
      <description>I am too struggling to extract the string form the field could you please advise on how you accomplished this.&lt;BR /&gt;
&lt;BR /&gt;
Thanks in Advance&lt;BR /&gt;
&lt;BR /&gt;
Lee</description>
      <pubDate>Wed, 21 Apr 2010 09:45:52 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144412#M49681</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-21T09:45:52Z</dc:date>
    </item>
    <item>
      <title>Re: Extract Text string from Field</title>
      <link>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144413#M49682</link>
      <description>Well Lee,&lt;BR /&gt;
Thinking back, it should be something as simple as the following:&lt;BR /&gt;
&lt;BR /&gt;
{code}&lt;BR /&gt;
Sub FindFieldTextString()&lt;BR /&gt;
Dim entText As AcadEntity&lt;BR /&gt;
Dim Pt As Variant&lt;BR /&gt;
&lt;BR /&gt;
    ThisDrawing.Utility.GetEntity entText, Pt, vbCr &amp;amp; "Select text entity:"&lt;BR /&gt;
    If TypeOf entText Is AcadText Or TypeOf entText Is AcadMText Then&lt;BR /&gt;
        MsgBox entText.TextString&lt;BR /&gt;
    End If&lt;BR /&gt;
    &lt;BR /&gt;
End Sub&lt;BR /&gt;
{code}</description>
      <pubDate>Wed, 21 Apr 2010 15:34:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/extract-text-string-from-field/m-p/1144413#M49682</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-04-21T15:34:43Z</dc:date>
    </item>
  </channel>
</rss>

