hong Posted February 18, 2004 Share Posted February 18, 2004 Is there a script to take a line by line text into one text block? Whenever I convert dwg to VW, all the notes becomes line text not a block text. I am wondering if there is a script to make my day little bit easier! Quote Link to comment
Paolo Posted February 24, 2004 Share Posted February 24, 2004 Hi Hong, One simple script to merge blocks is the following: code: procedure mergetext; const CR = chr(13); var texthandle : handle; list : handle; counter : integer; FUNCTION merge_text(h:HANDLE):BOOLEAN; begin if counter = 1 then texthandle := h else begin SetText(texthandle,concat(GetText(texthandle),CR,GetText(h))); delobject(h); end; counter := counter+1; merge_text := false; end; begin texthandle := NIL; counter := 1; {cycle through selected objects} ForEachObjectInList(merge_text,2,1, list); end; run(mergetext);[/code] In simple words, select the text blocks you want to merge, then launch this script. It should copy the content of each text block into the first of the list deleting the no more needed blocks. Note 1. The order (in the stack of objects) in the DWG you converted may be reversed, so if your final text results upside-downed, simply exchange the two members in the concatenation expression. Note 2. The constant CR (carriage return) is set to chr(13) for the Mac side of the world. If you are a Window user, you should use something like chr(10)+chr(13) to get the carriage return. If you want no carriage return at all, simply set CR to ' ' (one space) or '' (nothing). Hope this helps you, bye Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.