<?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: Ok Experts-Advice requested in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678486#M33513</link>
    <description>I couldn't to do it on VBA&lt;BR /&gt;
Try this one written on VLisp&lt;BR /&gt;
Copy this code to Notepad and save as ftt.lsp&lt;BR /&gt;
Load and type in command line ftt&lt;BR /&gt;
[code]&lt;BR /&gt;
; ========code starting here =========;&lt;BR /&gt;
; ftt.lsp &lt;BR /&gt;
; written by Fatty T.O.H. all rights removed&lt;BR /&gt;
; export fields with text contents to table&lt;BR /&gt;
; (beta-version)&lt;BR /&gt;
;;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;;&lt;BR /&gt;
&lt;BR /&gt;
(defun group-by-num (lst num / ls ret)&lt;BR /&gt;
  (if (= (rem (length lst) num) 0)&lt;BR /&gt;
    (progn&lt;BR /&gt;
      (setq ls nil)&lt;BR /&gt;
      (repeat (/ (length lst) num)&lt;BR /&gt;
	(repeat	num&lt;BR /&gt;
	  (setq	ls&lt;BR /&gt;
		    (cons (car lst) ls)&lt;BR /&gt;
		lst (cdr lst)&lt;BR /&gt;
	  )&lt;BR /&gt;
	)&lt;BR /&gt;
	(setq ret (append ret (list (reverse ls)))&lt;BR /&gt;
	      ls  nil&lt;BR /&gt;
	)&lt;BR /&gt;
      )&lt;BR /&gt;
    )&lt;BR /&gt;
  )&lt;BR /&gt;
  ret&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
(defun C:ftt (/	      acsp    adoc    atable  axss    cnt     col&lt;BR /&gt;
	      columns data    headers obj_list	      row     rows&lt;BR /&gt;
	      ss      tx_list&lt;BR /&gt;
	     )&lt;BR /&gt;
  (vl-load-com)&lt;BR /&gt;
  (alert&lt;BR /&gt;
  "Select text separatelly one by another\n&lt;BR /&gt;
       and one column by another columns only"&lt;BR /&gt;
  )&lt;BR /&gt;
  (setq	adoc (vla-get-activedocument (vlax-get-acad-object))&lt;BR /&gt;
	acsp (vla-get-modelspace adoc)&lt;BR /&gt;
  )&lt;BR /&gt;
  (setq ss (ssget (list (cons 0 "TEXT"))))&lt;BR /&gt;
  (setq axss (vla-get-activeselectionset adoc))&lt;BR /&gt;
  (vlax-for a axss&lt;BR /&gt;
    (setq obj_list (cons a obj_list))&lt;BR /&gt;
  )&lt;BR /&gt;
  (setq obj_list (reverse obj_list))&lt;BR /&gt;
  (setq	columns	 (getint "\nColumns number : ")&lt;BR /&gt;
	rows	 (/ (length obj_list) columns)&lt;BR /&gt;
	obj_list (group-by-num obj_list rows)&lt;BR /&gt;
  )&lt;BR /&gt;
&lt;BR /&gt;
  (setq	atable (vlax-invoke&lt;BR /&gt;
		 acsp&lt;BR /&gt;
		 'Addtable&lt;BR /&gt;
		 (getpoint "\nTable insertion point\n")&lt;BR /&gt;
		 (+ 2 rows)&lt;BR /&gt;
		 columns&lt;BR /&gt;
		 ;; rows height (change by suit)&lt;BR /&gt;
		 2.0&lt;BR /&gt;
		 ;; columns width (change by suit)&lt;BR /&gt;
		 15.0&lt;BR /&gt;
	       )&lt;BR /&gt;
  )&lt;BR /&gt;
  (vla-settext atable 0 0 "TABLE TITLE")&lt;BR /&gt;
&lt;BR /&gt;
  (setq	cnt 1&lt;BR /&gt;
	headers	'()&lt;BR /&gt;
  )&lt;BR /&gt;
  (repeat columns&lt;BR /&gt;
    (setq&lt;BR /&gt;
      headers (append headers (list (strcat "Header #" (itoa cnt))))&lt;BR /&gt;
    )&lt;BR /&gt;
    (setq cnt (1+ cnt))&lt;BR /&gt;
  )&lt;BR /&gt;
  (setq	col 0&lt;BR /&gt;
	row 1&lt;BR /&gt;
  )&lt;BR /&gt;
  (foreach a headers&lt;BR /&gt;
    (vla-settext atable row col a)&lt;BR /&gt;
    (setq col (1+ col))&lt;BR /&gt;
  )&lt;BR /&gt;
&lt;BR /&gt;
  (setq col 0)&lt;BR /&gt;
  (repeat rows&lt;BR /&gt;
    (setq row  2&lt;BR /&gt;
	  data (car obj_list)&lt;BR /&gt;
    )&lt;BR /&gt;
    (foreach obj data&lt;BR /&gt;
      (vla-settext&lt;BR /&gt;
	atable&lt;BR /&gt;
	row&lt;BR /&gt;
	col&lt;BR /&gt;
	(strcat	"%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "&lt;BR /&gt;
		(itoa (vlax-get obj 'ObjectID))&lt;BR /&gt;
		"&amp;gt;%).TextString \\f \"%bl2\"&amp;gt;%"&lt;BR /&gt;
	)&lt;BR /&gt;
      )&lt;BR /&gt;
      (setq row (1+ row))&lt;BR /&gt;
    )&lt;BR /&gt;
    (setq col	   (1+ col)&lt;BR /&gt;
	  obj_list (cdr obj_list)&lt;BR /&gt;
    )&lt;BR /&gt;
  )&lt;BR /&gt;
  (vlax-release-object atable)&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
(prompt&lt;BR /&gt;
  "\n\t\t\t   |-----------------------------|\n"&lt;BR /&gt;
)&lt;BR /&gt;
(prompt&lt;BR /&gt;
  "\n\t\t\t  &amp;lt;|  Start with FTT to execute  |&amp;gt;\n"&lt;BR /&gt;
)&lt;BR /&gt;
(prompt&lt;BR /&gt;
  "\n\t\t\t   |-----------------------------|\n"&lt;BR /&gt;
)&lt;BR /&gt;
; ========code ending here =========;&lt;BR /&gt;
[/code]&lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
    <pubDate>Sat, 17 Jun 2006 15:08:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2006-06-17T15:08:08Z</dc:date>
    <item>
      <title>Ok Experts-Advice requested</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678485#M33512</link>
      <description>I am trying to figure out the best approach to do the following (I am no VBA &lt;BR /&gt;
expert):&lt;BR /&gt;
&lt;BR /&gt;
1. Prompt user to select multiple text entities.&lt;BR /&gt;
&lt;BR /&gt;
2. Take the collection of text entities and remember column and row orders &lt;BR /&gt;
of text.&lt;BR /&gt;
&lt;BR /&gt;
3. Prompt user to select table to add a field linked to each text object &lt;BR /&gt;
into the appropriate cells.&lt;BR /&gt;
&lt;BR /&gt;
I think I can figure out how to place the field expression code into the &lt;BR /&gt;
text fine, but I am not sure how to progress with the rest.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Dan&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
A picture say a thousand words, so maybe the attached one will help.</description>
      <pubDate>Fri, 16 Jun 2006 19:36:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678485#M33512</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-16T19:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Ok Experts-Advice requested</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678486#M33513</link>
      <description>I couldn't to do it on VBA&lt;BR /&gt;
Try this one written on VLisp&lt;BR /&gt;
Copy this code to Notepad and save as ftt.lsp&lt;BR /&gt;
Load and type in command line ftt&lt;BR /&gt;
[code]&lt;BR /&gt;
; ========code starting here =========;&lt;BR /&gt;
; ftt.lsp &lt;BR /&gt;
; written by Fatty T.O.H. all rights removed&lt;BR /&gt;
; export fields with text contents to table&lt;BR /&gt;
; (beta-version)&lt;BR /&gt;
;;~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~;;&lt;BR /&gt;
&lt;BR /&gt;
(defun group-by-num (lst num / ls ret)&lt;BR /&gt;
  (if (= (rem (length lst) num) 0)&lt;BR /&gt;
    (progn&lt;BR /&gt;
      (setq ls nil)&lt;BR /&gt;
      (repeat (/ (length lst) num)&lt;BR /&gt;
	(repeat	num&lt;BR /&gt;
	  (setq	ls&lt;BR /&gt;
		    (cons (car lst) ls)&lt;BR /&gt;
		lst (cdr lst)&lt;BR /&gt;
	  )&lt;BR /&gt;
	)&lt;BR /&gt;
	(setq ret (append ret (list (reverse ls)))&lt;BR /&gt;
	      ls  nil&lt;BR /&gt;
	)&lt;BR /&gt;
      )&lt;BR /&gt;
    )&lt;BR /&gt;
  )&lt;BR /&gt;
  ret&lt;BR /&gt;
)&lt;BR /&gt;
&lt;BR /&gt;
(defun C:ftt (/	      acsp    adoc    atable  axss    cnt     col&lt;BR /&gt;
	      columns data    headers obj_list	      row     rows&lt;BR /&gt;
	      ss      tx_list&lt;BR /&gt;
	     )&lt;BR /&gt;
  (vl-load-com)&lt;BR /&gt;
  (alert&lt;BR /&gt;
  "Select text separatelly one by another\n&lt;BR /&gt;
       and one column by another columns only"&lt;BR /&gt;
  )&lt;BR /&gt;
  (setq	adoc (vla-get-activedocument (vlax-get-acad-object))&lt;BR /&gt;
	acsp (vla-get-modelspace adoc)&lt;BR /&gt;
  )&lt;BR /&gt;
  (setq ss (ssget (list (cons 0 "TEXT"))))&lt;BR /&gt;
  (setq axss (vla-get-activeselectionset adoc))&lt;BR /&gt;
  (vlax-for a axss&lt;BR /&gt;
    (setq obj_list (cons a obj_list))&lt;BR /&gt;
  )&lt;BR /&gt;
  (setq obj_list (reverse obj_list))&lt;BR /&gt;
  (setq	columns	 (getint "\nColumns number : ")&lt;BR /&gt;
	rows	 (/ (length obj_list) columns)&lt;BR /&gt;
	obj_list (group-by-num obj_list rows)&lt;BR /&gt;
  )&lt;BR /&gt;
&lt;BR /&gt;
  (setq	atable (vlax-invoke&lt;BR /&gt;
		 acsp&lt;BR /&gt;
		 'Addtable&lt;BR /&gt;
		 (getpoint "\nTable insertion point\n")&lt;BR /&gt;
		 (+ 2 rows)&lt;BR /&gt;
		 columns&lt;BR /&gt;
		 ;; rows height (change by suit)&lt;BR /&gt;
		 2.0&lt;BR /&gt;
		 ;; columns width (change by suit)&lt;BR /&gt;
		 15.0&lt;BR /&gt;
	       )&lt;BR /&gt;
  )&lt;BR /&gt;
  (vla-settext atable 0 0 "TABLE TITLE")&lt;BR /&gt;
&lt;BR /&gt;
  (setq	cnt 1&lt;BR /&gt;
	headers	'()&lt;BR /&gt;
  )&lt;BR /&gt;
  (repeat columns&lt;BR /&gt;
    (setq&lt;BR /&gt;
      headers (append headers (list (strcat "Header #" (itoa cnt))))&lt;BR /&gt;
    )&lt;BR /&gt;
    (setq cnt (1+ cnt))&lt;BR /&gt;
  )&lt;BR /&gt;
  (setq	col 0&lt;BR /&gt;
	row 1&lt;BR /&gt;
  )&lt;BR /&gt;
  (foreach a headers&lt;BR /&gt;
    (vla-settext atable row col a)&lt;BR /&gt;
    (setq col (1+ col))&lt;BR /&gt;
  )&lt;BR /&gt;
&lt;BR /&gt;
  (setq col 0)&lt;BR /&gt;
  (repeat rows&lt;BR /&gt;
    (setq row  2&lt;BR /&gt;
	  data (car obj_list)&lt;BR /&gt;
    )&lt;BR /&gt;
    (foreach obj data&lt;BR /&gt;
      (vla-settext&lt;BR /&gt;
	atable&lt;BR /&gt;
	row&lt;BR /&gt;
	col&lt;BR /&gt;
	(strcat	"%&amp;lt;\\AcObjProp Object(%&amp;lt;\\_ObjId "&lt;BR /&gt;
		(itoa (vlax-get obj 'ObjectID))&lt;BR /&gt;
		"&amp;gt;%).TextString \\f \"%bl2\"&amp;gt;%"&lt;BR /&gt;
	)&lt;BR /&gt;
      )&lt;BR /&gt;
      (setq row (1+ row))&lt;BR /&gt;
    )&lt;BR /&gt;
    (setq col	   (1+ col)&lt;BR /&gt;
	  obj_list (cdr obj_list)&lt;BR /&gt;
    )&lt;BR /&gt;
  )&lt;BR /&gt;
  (vlax-release-object atable)&lt;BR /&gt;
  (princ)&lt;BR /&gt;
)&lt;BR /&gt;
(prompt&lt;BR /&gt;
  "\n\t\t\t   |-----------------------------|\n"&lt;BR /&gt;
)&lt;BR /&gt;
(prompt&lt;BR /&gt;
  "\n\t\t\t  &amp;lt;|  Start with FTT to execute  |&amp;gt;\n"&lt;BR /&gt;
)&lt;BR /&gt;
(prompt&lt;BR /&gt;
  "\n\t\t\t   |-----------------------------|\n"&lt;BR /&gt;
)&lt;BR /&gt;
; ========code ending here =========;&lt;BR /&gt;
[/code]&lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Sat, 17 Jun 2006 15:08:08 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678486#M33513</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-17T15:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Ok Experts-Advice requested</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678487#M33514</link>
      <description>Ok I did it on VBA also:&lt;BR /&gt;
&lt;BR /&gt;
      Option Explicit&lt;BR /&gt;
      ''Fill table with fields&lt;BR /&gt;
      Sub FieldsToTable()&lt;BR /&gt;
      Dim oSsets As AcadSelectionSets&lt;BR /&gt;
      Dim oSset As AcadSelectionSet&lt;BR /&gt;
      Dim oTable As AcadTable&lt;BR /&gt;
      Dim oText As AcadText&lt;BR /&gt;
      Dim j, k, l, m As Long&lt;BR /&gt;
      Dim i, n As Integer&lt;BR /&gt;
      Dim ftype(0) As Integer&lt;BR /&gt;
      Dim fData(0) As Variant&lt;BR /&gt;
      Dim insPt As Variant&lt;BR /&gt;
      Dim tmpStr As String&lt;BR /&gt;
      &lt;BR /&gt;
      ftype(0) = 0: fData(0) = "TEXT"&lt;BR /&gt;
      MsgBox "NOTE:" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "Select text in following order:" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "Text1 Text5 Text9" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "Text2 Text6 Text10" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "Text3 Text7 Text11" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "Text4 Text8 Text12 e.t.c.", vbExclamation&lt;BR /&gt;
      &lt;BR /&gt;
      On Error GoTo ErrMsg&lt;BR /&gt;
      Set oSsets = ThisDrawing.SelectionSets&lt;BR /&gt;
      For Each oSset In oSsets&lt;BR /&gt;
      If oSset.Name = "$axss$" Then&lt;BR /&gt;
      oSset.Delete&lt;BR /&gt;
      End If&lt;BR /&gt;
      Next&lt;BR /&gt;
      &lt;BR /&gt;
      Set oSset = oSsets.Add("$axss$")&lt;BR /&gt;
      oSset.SelectOnScreen ftype, fData&lt;BR /&gt;
      &lt;BR /&gt;
      i = oSset.Count&lt;BR /&gt;
      k = CLng(InputBox("Enter column number", "Table columns"))&lt;BR /&gt;
      insPt = ThisDrawing.Utility.GetPoint(, "Table insertion point")&lt;BR /&gt;
      j = i \ k&lt;BR /&gt;
&lt;BR /&gt;
      Set oTable = ThisDrawing.ModelSpace.AddTable(insPt, j + 2, k, 2#, 15#)&lt;BR /&gt;
&lt;BR /&gt;
      m = 0&lt;BR /&gt;
      l = 0&lt;BR /&gt;
      tmpStr = "Tilte" ''Change title by suit&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      m = 1&lt;BR /&gt;
      For l = 0 To 2&lt;BR /&gt;
      tmpStr = "Header #" &amp;amp; CStr(l + 1)&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      Next l '' Change headers by suit&lt;BR /&gt;
      &lt;BR /&gt;
      n = 0&lt;BR /&gt;
      For l = 0 To k - 1&lt;BR /&gt;
      For m = 2 To j + 1&lt;BR /&gt;
      Set oText = oSset.Item(n)&lt;BR /&gt;
      &lt;BR /&gt;
      tmpStr = CStr(oText.ObjectID)&lt;BR /&gt;
      tmpStr = "%&amp;lt;\AcObjProp Object(%&amp;lt;\_ObjId " &amp;amp; tmpStr &amp;amp; _&lt;BR /&gt;
      "&amp;gt;%).TextString \f " &amp;amp; "" &amp;amp; "%bl2" &amp;amp; "" &amp;amp; "&amp;gt;%"&lt;BR /&gt;
      &lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      n = n + 1&lt;BR /&gt;
      Next&lt;BR /&gt;
      Next&lt;BR /&gt;
      &lt;BR /&gt;
      oSset.Clear&lt;BR /&gt;
      oSset.Delete&lt;BR /&gt;
      Set oSset = Nothing&lt;BR /&gt;
      Set oSsets = Nothing&lt;BR /&gt;
      Set oTable = Nothing&lt;BR /&gt;
      Exit Sub&lt;BR /&gt;
      &lt;BR /&gt;
ErrMsg:&lt;BR /&gt;
      MsgBox Err.Description&lt;BR /&gt;
      &lt;BR /&gt;
      End Sub&lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Sun, 18 Jun 2006 07:16:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678487#M33514</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-18T07:16:55Z</dc:date>
    </item>
    <item>
      <title>Re: Ok Experts-Advice requested</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678488#M33515</link>
      <description>Wow! Amazing...Fatty&lt;BR /&gt;
&lt;BR /&gt;
This is a huge start Thank you.&lt;BR /&gt;
&lt;BR /&gt;
Some clarifications:&lt;BR /&gt;
In my example I used 16 text entities. In reality there will be typically &lt;BR /&gt;
164 entities going into a larger table.  Selecting each entitiy individually &lt;BR /&gt;
will be to time consuming.&lt;BR /&gt;
(I have no idea how to do this.)&lt;BR /&gt;
Would it be possible to use a selection window to create the SSet?&lt;BR /&gt;
Next...a formatted table already exist, so I need to prompt the user to &lt;BR /&gt;
simply select the table to populate.&lt;BR /&gt;
&lt;BR /&gt;
Does this make sense?&lt;BR /&gt;
&lt;BR /&gt;
I apologize if I was not clear enough at first.&lt;BR /&gt;
&lt;BR /&gt;
The drawing file is attached.&lt;BR /&gt;
&lt;BR /&gt;
This is awesome,&lt;BR /&gt;
Dan</description>
      <pubDate>Mon, 19 Jun 2006 16:06:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678488#M33515</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-19T16:06:56Z</dc:date>
    </item>
    <item>
      <title>Re: Ok Experts-Advice requested</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678489#M33516</link>
      <description>I was able to modify the code provided easy enough to promt the user to &lt;BR /&gt;
select the preformattes table, but I am not sure about how to get the data &lt;BR /&gt;
selected with a window by the user into the right order.&lt;BR /&gt;
Please see ne thread "Sort an array of text objects Asc by their X and Y &lt;BR /&gt;
insertion point values". I thought it could server as a new topic.&lt;BR /&gt;
&lt;BR /&gt;
Thanks,&lt;BR /&gt;
Dan&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
"Dan" &lt;DANDERSON&gt; wrote in message &lt;BR /&gt;
news:5210907@discussion.autodesk.com...&lt;BR /&gt;
Wow! Amazing...Fatty&lt;BR /&gt;
&lt;BR /&gt;
This is a huge start Thank you.&lt;BR /&gt;
&lt;BR /&gt;
Some clarifications:&lt;BR /&gt;
In my example I used 16 text entities. In reality there will be typically&lt;BR /&gt;
164 entities going into a larger table.  Selecting each entitiy individually&lt;BR /&gt;
will be to time consuming.&lt;BR /&gt;
(I have no idea how to do this.)&lt;BR /&gt;
Would it be possible to use a selection window to create the SSet?&lt;BR /&gt;
Next...a formatted table already exist, so I need to prompt the user to&lt;BR /&gt;
simply select the table to populate.&lt;BR /&gt;
&lt;BR /&gt;
Does this make sen&lt;BR /&gt;
se?&lt;BR /&gt;
&lt;BR /&gt;
I apologize if I was not clear enough at first.&lt;BR /&gt;
&lt;BR /&gt;
The drawing file is attached.&lt;BR /&gt;
&lt;BR /&gt;
This is awesome,&lt;BR /&gt;
Dan&lt;/DANDERSON&gt;</description>
      <pubDate>Mon, 19 Jun 2006 22:49:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678489#M33516</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-19T22:49:50Z</dc:date>
    </item>
    <item>
      <title>Re: Ok Experts-Advice requested</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678490#M33517</link>
      <description>Hi Dan,&lt;BR /&gt;
&lt;BR /&gt;
Okay, I will work on your task further,&lt;BR /&gt;
but not sure I can do it&lt;BR /&gt;
Anyway I will try&lt;BR /&gt;
Thank you&lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Tue, 20 Jun 2006 06:08:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678490#M33517</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-20T06:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Ok Experts-Advice requested</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678491#M33518</link>
      <description>Please see new thread "Sort an array of text objects Asc by their X and Y&lt;BR /&gt;
insertion point values".&lt;BR /&gt;
&lt;BR /&gt;
I thought it could bew two separate animals, but I was wrong, and definitly &lt;BR /&gt;
more complex than I thought.&lt;BR /&gt;
I have a thread with My current code and a sample drawing with the tables &lt;BR /&gt;
that I use.&lt;BR /&gt;
&lt;BR /&gt;
Thanks again for all your help.  This will ssave a tremendous amount of &lt;BR /&gt;
rework.&lt;BR /&gt;
&lt;BR /&gt;
Dan&lt;BR /&gt;
&lt;FATTY&gt; wrote in message news:5211695@discussion.autodesk.com...&lt;BR /&gt;
Hi Dan,&lt;BR /&gt;
&lt;BR /&gt;
Okay, I will work on your task further,&lt;BR /&gt;
but not sure I can do it&lt;BR /&gt;
Anyway I will try&lt;BR /&gt;
Thank you&lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~&lt;/FATTY&gt;</description>
      <pubDate>Wed, 21 Jun 2006 00:06:40 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678491#M33518</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-21T00:06:40Z</dc:date>
    </item>
    <item>
      <title>Re: Ok Experts-Advice requested</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678492#M33519</link>
      <description>Try it on your table on top of your drawing&lt;BR /&gt;
I could't to write BubbleSort for whole text but&lt;BR /&gt;
with separate text columns this will work I hope&lt;BR /&gt;
See prompts inside the code&lt;BR /&gt;
&lt;BR /&gt;
[code]&lt;BR /&gt;
Option Explicit&lt;BR /&gt;
&lt;BR /&gt;
Sub FieldsToTable()&lt;BR /&gt;
Dim oSsets As AcadSelectionSets&lt;BR /&gt;
Dim oSset As AcadSelectionSet&lt;BR /&gt;
Dim oTable As AcadTable&lt;BR /&gt;
Dim i, j, k, l, m, n As Long&lt;BR /&gt;
Dim ftype(0) As Integer&lt;BR /&gt;
Dim fData(0) As Variant&lt;BR /&gt;
Dim insPt As Variant&lt;BR /&gt;
Dim tmpStr As String&lt;BR /&gt;
ftype(0) = 0: fData(0) = "TEXT"&lt;BR /&gt;
&lt;BR /&gt;
      MsgBox "NOTE:" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "Select by window every text column" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "separatelly: from top to bottom" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "and from left to right", vbExclamation&lt;BR /&gt;
      &lt;BR /&gt;
Set oSsets = ThisDrawing.SelectionSets&lt;BR /&gt;
For Each oSset In oSsets&lt;BR /&gt;
If oSset.Name = "$axss$" Then&lt;BR /&gt;
oSset.Delete&lt;BR /&gt;
End If&lt;BR /&gt;
Next&lt;BR /&gt;
Set oSset = oSsets.Add("$axss$")&lt;BR /&gt;
&lt;BR /&gt;
      Dim wPoint1 As Variant&lt;BR /&gt;
      Dim wPoint2 As Variant&lt;BR /&gt;
      Dim unitText As Object&lt;BR /&gt;
&lt;BR /&gt;
k = CLng(InputBox("Enter the number of columns", "Table parameters", 5))&lt;BR /&gt;
insPt = ThisDrawing.Utility.GetPoint(, "Table insertion point")&lt;BR /&gt;
&lt;BR /&gt;
n = 1&lt;BR /&gt;
l = 0&lt;BR /&gt;
&lt;BR /&gt;
While n &amp;lt; k + 1&lt;BR /&gt;
&lt;BR /&gt;
      m = 3&lt;BR /&gt;
      wPoint1 = ThisDrawing.Utility.GetPoint(, "Specify first corner point of " &amp;amp; CStr(n) &amp;amp; " column")&lt;BR /&gt;
      wPoint2 = ThisDrawing.Utility.GetCorner(wPoint1, "Specify opposite corner:")&lt;BR /&gt;
      oSset.Select acSelectionSetWindow, wPoint1, wPoint2, ftype, fData&lt;BR /&gt;
&lt;BR /&gt;
If n = 1 Then&lt;BR /&gt;
      i = oSset.Count&lt;BR /&gt;
      Set oTable = ThisDrawing.ModelSpace.AddTable(insPt, i + 3, k, 7.5, 15#)&lt;BR /&gt;
      oTable.RecomputeTableBlock False&lt;BR /&gt;
      oTable.SetTextHeight 1, 1.6875&lt;BR /&gt;
      oTable.TitleSuppressed = True&lt;BR /&gt;
      oTable.HeaderSuppressed = True&lt;BR /&gt;
      m = 0&lt;BR /&gt;
      l = 0&lt;BR /&gt;
      tmpStr = "NO"&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      oTable.SetCellAlignment m, l, acMiddleCenter&lt;BR /&gt;
      m = 0&lt;BR /&gt;
      l = 1&lt;BR /&gt;
      tmpStr = "Q1"&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      oTable.SetCellAlignment m, l, acMiddleCenter&lt;BR /&gt;
      m = 1&lt;BR /&gt;
      l = 0&lt;BR /&gt;
      tmpStr = "NO"&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      oTable.SetCellAlignment m, l, acMiddleCenter&lt;BR /&gt;
      m = 1&lt;BR /&gt;
      l = 1&lt;BR /&gt;
      tmpStr = "Q"&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      oTable.SetCellAlignment m, l, acMiddleCenter&lt;BR /&gt;
      Dim hdrArr As Variant&lt;BR /&gt;
      hdrArr = Array("Q2", "A", "B", "C", "D")&lt;BR /&gt;
      m = 2&lt;BR /&gt;
      For l = 0 To UBound(hdrArr)&lt;BR /&gt;
      tmpStr = hdrArr(l)&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      oTable.SetCellAlignment m, l, acMiddleCenter&lt;BR /&gt;
      Next l&lt;BR /&gt;
      l = 0&lt;BR /&gt;
      m = 3&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
Dim txtArr() As Variant&lt;BR /&gt;
ReDim Preserve txtArr(oSset.Count - 1, 1)&lt;BR /&gt;
      For i = 0 To oSset.Count - 1&lt;BR /&gt;
      Set unitText = oSset.Item(i)&lt;BR /&gt;
      &lt;BR /&gt;
      txtArr(i, 0) = unitText.InsertionPoint&lt;BR /&gt;
      txtArr(i, 1) = unitText.ObjectID&lt;BR /&gt;
      &lt;BR /&gt;
      Next&lt;BR /&gt;
&lt;BR /&gt;
txtArr = SortObjectsByRow(txtArr)&lt;BR /&gt;
&lt;BR /&gt;
      For i = 0 To UBound(txtArr, 1)&lt;BR /&gt;
      tmpStr = CStr(txtArr(i, 1))&lt;BR /&gt;
      tmpStr = "%&amp;lt;\AcObjProp Object(%&amp;lt;\_ObjId " &amp;amp; tmpStr &amp;amp; _&lt;BR /&gt;
      "&amp;gt;%).TextString \f" &amp;amp; " " &amp;amp; "" &amp;amp; "%bl2" &amp;amp; "" &amp;amp; "&amp;gt;%"&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      oTable.SetCellAlignment m, l, acMiddleCenter&lt;BR /&gt;
      m = m + 1&lt;BR /&gt;
      &lt;BR /&gt;
      Next i&lt;BR /&gt;
&lt;BR /&gt;
l = l + 1&lt;BR /&gt;
n = n + 1&lt;BR /&gt;
&lt;BR /&gt;
oSset.Clear&lt;BR /&gt;
Erase txtArr&lt;BR /&gt;
&lt;BR /&gt;
Wend&lt;BR /&gt;
&lt;BR /&gt;
oTable.RecomputeTableBlock True&lt;BR /&gt;
&lt;BR /&gt;
      MsgBox "Mattew 4:14" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "The people who set in darkness" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "have seen a light...", vbExclamation&lt;BR /&gt;
End Sub&lt;BR /&gt;
'@'~~~~~~~~~~~written by Fatty T.O.H~~~~~~~~~~~~~~~~'@'&lt;BR /&gt;
Public Function SortObjectsByRow(ByVal sourceArr As Variant)&lt;BR /&gt;
&lt;BR /&gt;
Dim OnCondition As Boolean&lt;BR /&gt;
Dim Depot(0, 1) As Variant&lt;BR /&gt;
Dim Enumer As Long&lt;BR /&gt;
OnCondition = False&lt;BR /&gt;
      Do Until OnCondition&lt;BR /&gt;
      OnCondition = True&lt;BR /&gt;
      For Enumer = LBound(sourceArr) To UBound(sourceArr) - 1&lt;BR /&gt;
      If sourceArr(Enumer, 0)(1) &amp;lt; sourceArr(Enumer + 1, 0)(1) Then&lt;BR /&gt;
      Depot(0, 0) = sourceArr(Enumer, 0)&lt;BR /&gt;
      Depot(0, 1) = sourceArr(Enumer, 1)&lt;BR /&gt;
      sourceArr(Enumer, 0) = sourceArr(Enumer + 1, 0)&lt;BR /&gt;
      sourceArr(Enumer, 1) = sourceArr(Enumer + 1, 1)&lt;BR /&gt;
      sourceArr(Enumer + 1, 0) = Depot(0, 0)&lt;BR /&gt;
      sourceArr(Enumer + 1, 1) = Depot(0, 1)&lt;BR /&gt;
      OnCondition = False&lt;BR /&gt;
      End If&lt;BR /&gt;
      Next&lt;BR /&gt;
      Loop&lt;BR /&gt;
SortObjectsByRow = sourceArr&lt;BR /&gt;
End Function&lt;BR /&gt;
[/code]&lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Thu, 22 Jun 2006 08:43:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678492#M33519</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-22T08:43:01Z</dc:date>
    </item>
    <item>
      <title>Re: Ok Experts-Advice requested</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678493#M33520</link>
      <description>Awesome, Thank you Fatty. I have learned a great deal, and I am working on &lt;BR /&gt;
it now.&lt;BR /&gt;
&lt;BR /&gt;
&lt;FATTY&gt; wrote in message news:5214904@discussion.autodesk.com...&lt;BR /&gt;
Try it on your table on top of your drawing&lt;BR /&gt;
I could't to write BubbleSort for whole text but&lt;BR /&gt;
with separate text columns this will work I hope&lt;BR /&gt;
See prompts inside the code&lt;BR /&gt;
&lt;BR /&gt;
[code]&lt;BR /&gt;
Option Explicit&lt;BR /&gt;
&lt;BR /&gt;
Sub FieldsToTable()&lt;BR /&gt;
Dim oSsets As AcadSelectionSets&lt;BR /&gt;
Dim oSset As AcadSelectionSet&lt;BR /&gt;
Dim oTable As AcadTable&lt;BR /&gt;
Dim i, j, k, l, m, n As Long&lt;BR /&gt;
Dim ftype(0) As Integer&lt;BR /&gt;
Dim fData(0) As Variant&lt;BR /&gt;
Dim insPt As Variant&lt;BR /&gt;
Dim tmpStr As String&lt;BR /&gt;
ftype(0) = 0: fData(0) = "TEXT"&lt;BR /&gt;
&lt;BR /&gt;
      MsgBox "NOTE:" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "Select by window every text column" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "separatelly: from top to bottom" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "and from left to right", vbExclamation&lt;BR /&gt;
&lt;BR /&gt;
Set oSsets = ThisDrawing.SelectionSets&lt;BR /&gt;
For Each oSset In oSsets&lt;BR /&gt;
If oSset.Name = "$axss$" Then&lt;BR /&gt;
oSset.Delete&lt;BR /&gt;
End If&lt;BR /&gt;
Next&lt;BR /&gt;
Set oSset = oSsets.Add("$axss$")&lt;BR /&gt;
&lt;BR /&gt;
      Dim wPoint1 As Variant&lt;BR /&gt;
      Dim wPoint2 As Variant&lt;BR /&gt;
      Dim unitText As Object&lt;BR /&gt;
&lt;BR /&gt;
k = CLng(InputBox("Enter the number of columns", "Table parameters", 5))&lt;BR /&gt;
insPt = ThisDrawing.Utility.GetPoint(, "Table insertion point")&lt;BR /&gt;
&lt;BR /&gt;
n = 1&lt;BR /&gt;
l = 0&lt;BR /&gt;
&lt;BR /&gt;
While n &amp;lt; k + 1&lt;BR /&gt;
&lt;BR /&gt;
      m = 3&lt;BR /&gt;
      wPoint1 = ThisDrawing.Utility.GetPoint(, "Specify first corner point &lt;BR /&gt;
of " &amp;amp; CStr(n) &amp;amp; " column")&lt;BR /&gt;
      wPoint2 = ThisDrawing.Utility.GetCorner(wPoint1, "Specify opposite &lt;BR /&gt;
corner:")&lt;BR /&gt;
      oSset.Select acSelectionSetWindow, wPoint1, wPoint2, ftype, fData&lt;BR /&gt;
&lt;BR /&gt;
If n = 1 Then&lt;BR /&gt;
      i = oSset.Count&lt;BR /&gt;
      Set oTable = ThisDrawing.ModelSpace.AddTable(insPt, i + 3, k, 7.5, &lt;BR /&gt;
15#)&lt;BR /&gt;
      oTable.RecomputeTableBlock False&lt;BR /&gt;
      oTable.SetTextHeight 1, 1.6875&lt;BR /&gt;
      oTable.TitleSuppressed = True&lt;BR /&gt;
      oTable.HeaderSuppressed = True&lt;BR /&gt;
      m = 0&lt;BR /&gt;
      l = 0&lt;BR /&gt;
      tmpStr = "NO"&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      oTable.SetCellAlignment m, l, acMiddleCenter&lt;BR /&gt;
      m = 0&lt;BR /&gt;
      l = 1&lt;BR /&gt;
      tmpStr = "Q1"&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      oTable.SetCellAlignment m, l, acMiddleCenter&lt;BR /&gt;
      m = 1&lt;BR /&gt;
      l = 0&lt;BR /&gt;
      tmpStr = "NO"&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      oTable.SetCellAlignment m, l, acMiddleCenter&lt;BR /&gt;
      m = 1&lt;BR /&gt;
      l = 1&lt;BR /&gt;
      tmpStr = "Q"&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      oTable.SetCellAlignment m, l, acMiddleCenter&lt;BR /&gt;
      Dim hdrArr As Variant&lt;BR /&gt;
      hdrArr = Array("Q2", "A", "B", "C", "D")&lt;BR /&gt;
      m = 2&lt;BR /&gt;
      For l = 0 To UBound(hdrArr)&lt;BR /&gt;
      tmpStr = hdrArr(l)&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      oTable.SetCellAlignment m, l, acMiddleCenter&lt;BR /&gt;
      Next l&lt;BR /&gt;
      l = 0&lt;BR /&gt;
      m = 3&lt;BR /&gt;
End If&lt;BR /&gt;
&lt;BR /&gt;
Dim txtArr() As Variant&lt;BR /&gt;
ReDim Preserve txtArr(oSset.Count - 1, 1)&lt;BR /&gt;
      For i = 0 To oSset.Count - 1&lt;BR /&gt;
      Set unitText = oSset.Item(i)&lt;BR /&gt;
&lt;BR /&gt;
      txtArr(i, 0) = unitText.InsertionPoint&lt;BR /&gt;
      txtArr(i, 1) = unitText.ObjectID&lt;BR /&gt;
&lt;BR /&gt;
      Next&lt;BR /&gt;
&lt;BR /&gt;
txtArr = SortObjectsByRow(txtArr)&lt;BR /&gt;
&lt;BR /&gt;
      For i = 0 To UBound(txtArr, 1)&lt;BR /&gt;
      tmpStr = CStr(txtArr(i, 1))&lt;BR /&gt;
      tmpStr = "%&amp;lt;\AcObjProp Object(%&amp;lt;\_ObjId " &amp;amp; tmpStr &amp;amp; _&lt;BR /&gt;
      "&amp;gt;%).TextString \f" &amp;amp; " " &amp;amp; "" &amp;amp; "%bl2" &amp;amp; "" &amp;amp; "&amp;gt;%"&lt;BR /&gt;
      oTable.SetText m, l, tmpStr&lt;BR /&gt;
      oTable.SetCellAlignment m, l, acMiddleCenter&lt;BR /&gt;
      m = m + 1&lt;BR /&gt;
&lt;BR /&gt;
      Next i&lt;BR /&gt;
&lt;BR /&gt;
l = l + 1&lt;BR /&gt;
n = n + 1&lt;BR /&gt;
&lt;BR /&gt;
oSset.Clear&lt;BR /&gt;
Erase txtArr&lt;BR /&gt;
&lt;BR /&gt;
Wend&lt;BR /&gt;
&lt;BR /&gt;
oTable.RecomputeTableBlock True&lt;BR /&gt;
&lt;BR /&gt;
      MsgBox "Mattew 4:14" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "The people who set in darkness" &amp;amp; vbCrLf &amp;amp; _&lt;BR /&gt;
      "have seen a light...", vbExclamation&lt;BR /&gt;
End Sub&lt;BR /&gt;
'@'~~~~~~~~~~~written by Fatty T.O.H~~~~~~~~~~~~~~~~'@'&lt;BR /&gt;
Public Function SortObjectsByRow(ByVal sourceArr As Variant)&lt;BR /&gt;
&lt;BR /&gt;
Dim OnCondition As Boolean&lt;BR /&gt;
Dim Depot(0, 1) As Variant&lt;BR /&gt;
Dim Enumer As Long&lt;BR /&gt;
OnCondition = False&lt;BR /&gt;
      Do Until OnCondition&lt;BR /&gt;
      OnCondition = True&lt;BR /&gt;
      For Enumer = LBound(sourceArr) To UBound(sourceArr) - 1&lt;BR /&gt;
      If sourceArr(Enumer, 0)(1) &amp;lt; sourceArr(Enumer + 1, 0)(1) Then&lt;BR /&gt;
      Depot(0, 0) = sourceArr(Enumer, 0)&lt;BR /&gt;
      Depot(0, 1) = sourceArr(Enumer, 1)&lt;BR /&gt;
      sourceArr(Enumer, 0) = sourceArr(Enumer + 1, 0)&lt;BR /&gt;
      sourceArr(Enumer, 1) = sourceArr(Enumer + 1, 1)&lt;BR /&gt;
      sourceArr(Enumer + 1, 0) = Depot(0, 0)&lt;BR /&gt;
      sourceArr(Enumer + 1, 1) = Depot(0, 1)&lt;BR /&gt;
      OnCondition = False&lt;BR /&gt;
      End If&lt;BR /&gt;
      Next&lt;BR /&gt;
      Loop&lt;BR /&gt;
SortObjectsByRow = sourceArr&lt;BR /&gt;
End Function&lt;BR /&gt;
[/code]&lt;BR /&gt;
&lt;BR /&gt;
Fatty&lt;BR /&gt;
&lt;BR /&gt;
~'J'~&lt;/FATTY&gt;</description>
      <pubDate>Thu, 22 Jun 2006 15:20:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678493#M33520</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-22T15:20:24Z</dc:date>
    </item>
    <item>
      <title>Re: Ok Experts-Advice requested</title>
      <link>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678494#M33521</link>
      <description>Happy computing, Dan&lt;BR /&gt;
Cheers:)&lt;BR /&gt;
&lt;BR /&gt;
~'J'~</description>
      <pubDate>Thu, 22 Jun 2006 15:30:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/ok-experts-advice-requested/m-p/1678494#M33521</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-06-22T15:30:03Z</dc:date>
    </item>
  </channel>
</rss>

