caltes75 Posted September 22, 2010 Share Posted September 22, 2010 I hope this is a simple question, but how do I select text using the fence crossing feature within the below code. (setq ss (ssget '((0 . "MTEXT,TEXT")))) Quote Link to comment Share on other sites More sharing options...
lpseifert Posted September 22, 2010 Share Posted September 22, 2010 (setq ss (ssget "_F" pntlst '((0 . "MTEXT,TEXT")))) you need to provide a list of points of the fence vertices for pntlst Quote Link to comment Share on other sites More sharing options...
caltes75 Posted September 22, 2010 Author Share Posted September 22, 2010 what if you don't know what the points are? i am trying to select text in a coordinate that has been placed like this: abc n e el i want to be able to select all of lines and convert them into one mtext object while still keeping them in the order that appear. Quote Link to comment Share on other sites More sharing options...
lpseifert Posted September 22, 2010 Share Posted September 22, 2010 The Express Tools' command Txt2Mtxt should do that Quote Link to comment Share on other sites More sharing options...
caltes75 Posted September 22, 2010 Author Share Posted September 22, 2010 you are so right. it did not work like that when i used it previously. thank you. do you happen to have or know where i can find the actual code for txt2mtxt command? Quote Link to comment Share on other sites More sharing options...
lpseifert Posted September 22, 2010 Share Posted September 22, 2010 I think the code is in Leaderex.arx found in the Express folder. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 22, 2010 Share Posted September 22, 2010 The command called : convert text to mtext And from Express menu -> Text -> convert text to mtext Quote Link to comment Share on other sites More sharing options...
caltes75 Posted September 22, 2010 Author Share Posted September 22, 2010 i want to use the code below, but to be able to select a group of text all at once and still be able to keep their same order from top to bottom. any thoughts? (defun Merge() (if (and (setq ss (ssget '((0 . "MTEXT,TEXT")))) ;Select both MText & DText (> (sslength ss) 1) ;Check if more than one selected ) ;end of and (progn (setq n 1 ;Initialize counter en (ssname ss 0) ;Get 1st selected ed (entget en) ;Get its DXF data txt (cdr (assoc 1 ed)) ;Get its textvalue ) ;_ end of setq (if (= (cdr (assoc 0 ed)) "TEXT") ;If the 1st is a DText (progn (command "txt2mtxt" en "") ;Convert it to a MText (setq obj (vlax-ename->vla-object (entlast))) (vlax-put-property obj 'LineSpacingFactor 1) (vlax-put-property obj 'LineSpacingDistance 0.25) (vlax-put-property obj 'LineSpacingStyle 2) (setq en (entlast)) ;Get the new MText ) ;_ end of progn ) ;_ end of if (setq eo (vlax-ename->vla-object en)) ;Get the ActiveX object of the 1st text (while (< n (sslength ss)) ;Step through the rest of the selected text (setq en (ssname ss n) ;Get the nth text ed (entget en) ;Get its DXF data ) ;_ end of set (setq txt (strcat txt "[url="file://\\P"]\\P[/url]" (cdr (assoc 1 ed)))) ;Append its string to add to the 1st text (entdel en) ;Delete the nth text (setq n (1+ n)) ;Increment the counter ) ;_ end of while (vla-put-TextString eo txt) ;Modify the 1st text to the concatenated string (command "_.justifytext" pause "" "ML") ) ;_ end of progn ) ;_ end of if ) Quote Link to comment Share on other sites More sharing options...
Tharwat Posted September 22, 2010 Share Posted September 22, 2010 Would you please try this,And I hope it would give a sense. (defun c:Merge (/ ss) (if (setq ss (ssget "_:L" '((0 . "TEXT")))) ((lambda (i / ent ) (while (setq ent (ssname ss (setq i (1+ i)))) (command "_.txt2mtxt" ent "") ) ) -1 ) ) (princ) ) Tharwat Quote Link to comment Share on other sites More sharing options...
Lee Mac Posted September 22, 2010 Share Posted September 22, 2010 Express Tools commands are LISP's in themselves and hence cannot be called using command. You will need to call the LISP function directly. Quote Link to comment Share on other sites More sharing options...
alanjt Posted September 22, 2010 Share Posted September 22, 2010 Sort your selection set by Y value of each insertion point. (defun _SortSSbyYcoord (ss) ;; Alan J. Thompson, 09.22.10 (if (eq (type ss) 'PICKSET) (vl-sort ((lambda (i / e l) (while (setq e (ssname ss (setq i (1+ i)))) (setq l (cons e l)))) -1) (function (lambda (a b) (> (caddr (assoc 10 (entget a))) (caddr (assoc 10 (entget b)))))) ) ) ) Quote Link to comment Share on other sites More sharing options...
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.