Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Go from TEXT and LINES to an AutoCAD TABLE (LISP) ?

14 REPLIES 14
Reply
Message 1 of 15
powermixx
6620 Views, 14 Replies

Go from TEXT and LINES to an AutoCAD TABLE (LISP) ?

The PARTS LISTS on our old drawings are simply text entities and lines. Some are MTEXT. But our new drawing template has us creating our parts list using the actual AutoCAD TABLES entity.

I'm looking for the best method to go from lines and text in AutoCAD, to an AutoCAD table. As of now, I have to retype everything since I can't select a column/row or group of text entities, copy/paste into a table.

I've searched the internet and have not found a decent solution.

Does anyone have a LISP function that will allow me to go from TEXT and LINES to a TABLE? I've tried B2E (lisp name) but it's not working - found that on a lisp site somewhere. Man there's gotta be a way to do this without retyping everything.
Please help, we have many dwgs like this!! 😞
14 REPLIES 14
Message 2 of 15
dandssapp
in reply to: powermixx

i am having the same problem. someone please help!
Message 3 of 15
kozmos
in reply to: powermixx

Try AutotableX-Convert from http://www.atablex.com
Message 4 of 15
powermixx
in reply to: powermixx

Thanks for the post and the suggestion. I was hoping to get a LISP, not a paid app. But thanks.
Message 5 of 15
Anonymous
in reply to: powermixx

One way to deal with the issue of, "without retyping everything", is a routine which
can swap text strings between objects.

I'm currently working on such a routine. It's close to done, but not quite. It allows
for instance, pick an text or mtext object and put that string into a table cell or
an attribute.

The routine is fairly complex since it has to handle embedded formatting between the
various types of text objects.

Joe Burke
Message 6 of 15
powermixx
in reply to: powermixx

Coolness. Kudos to KozMos for posting about his application he charges for. The install is busted, you have to install in the Programs Folder. Ugh~ The Help download is also busted - no content. And the toolbar that loads when you open the compiled script creates a toolbar with all "?" I did find the right icon and tried the script.

Although all these things (install, help and icons) were busted, the script does work. I'll give em that! I just grind my teeth at having to shell out $$ for something that should be in the native Acad app. Especially something not so complete, documented. Sorry Koz...

Please keep me posted Joe. I'd like to try your routine if I may...
Message 7 of 15
lpseifert
in reply to: powermixx

http://cadtips.cadalyst.com/content/alspsol0308-convert-old-table-new-table-format
~~~Civil 3D 2008~~~
Message 8 of 15
Anonymous
in reply to: powermixx

If you post some form of valid email address, I'll send the routine to you directly
when I have a well tested beta version. As I said, I'm close.

Otherwise, continue to check this topic. I'll post it here eventually.

BTW, the routine uses regular expressions to strip embedded formatting codes. The
methods used are exposed. It's just a LISP routine.

Joe Burke
Message 9 of 15
Anonymous
in reply to: powermixx


Hi,

 

A LISP could be as well a paid app. Just because
here are a lot of good people willing to help for free, it doesn't mean that
LISP is allways free 🙂


--
Humans are born with a wide horizon.
As time goes by, the
horizon narrows and
narrows, until it becomes a point of view.


style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px">
Thanks
for the post and the suggestion. I was hoping to get a LISP, not a paid app.
But thanks.
Message 10 of 15
powermixx
in reply to: powermixx

Yea! Go team go!

Wouldn't be so bad if the app wasn't AFU.
Message 11 of 15
Anonymous
in reply to: powermixx

powermixx wrote:

> I just grind my teeth at having to shell out $$ for something that
> should be in the native Acad app.

How much ribbon would you give up for something like that? 🙂

http://www.dotsoft.com/demos/tptblcontxt.htm

Terry
--
Never start any job without the right tools!
AutoCAD Add-on Tools at http://www.dotsoft.com
Message 12 of 15
t.willey
in reply to: powermixx

I have a two step process that would work for you. First is a routine that will export the selected text to a csv, then the second routine will import the text file as either a table or text and lines. Here is the export routine

{code}
(defun c:ExportTextTable (/ tempPt XValList PtValList tempList tempStr EndList XValCnt StrCnt MaxCnt StrList Opened *error*)

(defun *error* (msg)

(if Opened (close Opened))
(if msg (prompt (strcat "\n Error-> " msg)))
)
;--------------------------------------------------------------
(if (ssget '((0 . "TEXT")))
(vlax-for obj (vla-get-ActiveSelectionSet (vla-get-ActiveDocument (vlax-get-Acad-Object)))
(setq tempPt
(vlax-get
obj
(if (equal (vla-get-Alignment obj) 0)
'InsertionPoint
'TextAlignmentPoint
)
)
)
(if (not (vl-position T (mapcar '(lambda (x) (equal (car tempPt) x 0.00001)) XValList)))
(setq XValList (cons (car tempPt) XValList))
)
(setq PtValList
(cons
(cons
(vl-string-translate "," ";" (vla-get-TextString obj))
tempPt
)
PtValList
)
)
)
)
(foreach lst PtValList
(if (setq tempList (assoc (setq tempStr (rtos (caddr lst) 2 10)) EndList))
(setq EndList
(subst
(list
tempStr
(cons lst (cadr tempList))
)
tempList
EndList
)
)
(setq EndList (cons (list tempStr (list lst)) EndList))
)
)
(if EndList
(progn
(setq EndList
(vl-sort
EndList
'(lambda (a b)
(> (distof (car a)) (distof (car b)))
)
)
)
(setq XValList (vl-sort XValList '<))
(foreach lst EndList
(setq lst
(vl-sort
(cadr lst)
'(lambda (a b)
(< (cadr a) (cadr b))
)
)
)
(setq XValCnt 0)
(setq StrCnt 0)
(setq MaxCnt (length XValList))
(setq tempStr "")
(repeat (length lst)
(while (not (equal (cadr (nth StrCnt lst)) (nth XValCnt XValList) 0.0000001))
(setq tempStr (strcat tempStr ","))
(setq XValCnt (1+ XValCnt))
)
(setq tempStr (strcat tempStr (car (nth StrCnt lst))))
(if (< StrCnt MaxCnt)
(setq tempStr (strcat tempStr ","))
)
(setq StrCnt (1+ StrCnt))
(setq XValCnt (1+ XValCnt))
)
(setq StrList (cons tempStr StrList))
)
(setq Opened (open "c:/test/ExportedText.csv" "a"))
(foreach str (reverse StrList)
(write-line str Opened)
)
)
)
(*error* nil)
(princ)
)
{code}

Here is a link to the other code.
[ http://www.theswamp.org/index.php?topic=20954.0 ]

You might have to be a member to download the files though.
Message 13 of 15
Caduser_zero
in reply to: powermixx

thank T. Wiley, would you mind posting an argument description so I don't have to reverse engineer your module?
Message 14 of 15
t.willey
in reply to: powermixx

For the code above, there are no arguments. You just select the text that is arranged as a table within the drawing. It will then export it to the file listed in the code.

If you're talking about the code in the link posted, it has a break down of what to do.

Does that work for you?
Message 15 of 15
NaderAzem2534
in reply to: t.willey

It is good idea but what about if i can export the pipe network in the format of excel data and than import the same after changing.

thanks

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost