bono05 Posted April 28, 2015 Author Share Posted April 28, 2015 Only if it's not to much work.... Possible to retain de position and rotation of mtext? Because after lisp i need to move one by one to a confortable position to read it. Quote Link to comment Share on other sites More sharing options...
AIberto Posted April 28, 2015 Share Posted April 28, 2015 All right , this should do the trick in one shot (defun c:Test (/ il ml s i sn en v d lst) ;;------------------------------------;; ;; Tharwat 28.4.2015 ;; ;;------------------------------------;; (princ "\nSelect Attributed Blocks with Mtexts:") (if (setq s (ssget "_:L" '((-4 . "<OR") (-4 . "<AND") (0 . "INSERT") (66 . 1) (-4 . "AND>") (0 . "MTEXT") (-4 . "OR>") ) ) ) (progn (repeat (setq i (sslength s)) (setq sn (ssname s (setq i (1- i))) en (entget sn) ) (if (eq (cdr (assoc 0 en)) "INSERT") (setq il (cons (list (cdr (assoc 10 en)) sn) il)) (setq ml (cons (list (cdr (assoc 10 en)) sn) ml)) ) ) (mapcar '(lambda (u) (mapcar '(lambda (p) (setq lst (cons (list (distance (car u) (car p)) (cadr p)) lst ) ) ) ml ) (setq v (vl-sort lst '(lambda (j k) (< (car j) (car k))))) (mapcar '(lambda (o) (if (eq (strcase (vla-get-tagstring o)) "COOR") (progn (vla-put-textstring o (vl-string-subst "" "\\P" (cdr (assoc 1 (entget (cadar v)))) ) ) (setq d (cons (cadar v) d)) ) ) ) (vlax-invoke (vlax-ename->vla-object (cadr u)) 'getattributes ) ) (setq v nil lst nil ) ) il ) (mapcar 'entdel d) ) ) (princ) )(vl-load-com) Nice . Dear Tharwat. But maybe like this: Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 28, 2015 Share Posted April 28, 2015 Only if it's not to much work.... Possible to retain de position and rotation of mtext? Because after lisp i need to move one by one to a confortable position to read it. The Mtext string would take the place of the attribute that has the tag name COOR but we can change the rotation of the attribute inside the block according to the Mtext object's rotation angle . But for the position of the attribute , I think it should be relocated manually . NOTE: run the program on a few blocks and Mtext object because the closest Mtext string to the insertion point of the Attributed Block is the one that would be considered and it might duplicate the same text string into two blocks . Quote Link to comment Share on other sites More sharing options...
bono05 Posted April 28, 2015 Author Share Posted April 28, 2015 No problem i'm verry glad with this routine!!!! Thank you very much!!!! Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 28, 2015 Share Posted April 28, 2015 Nice . Dear Tharwat.But maybe like this: Thank you Alberto Where did you get that sim sun and hello text strings from ? Quote Link to comment Share on other sites More sharing options...
AIberto Posted April 28, 2015 Share Posted April 28, 2015 Thank you Alberto Where did you get that sim sun and hello text strings from ? I enter a new strings , simsun is a font . Quote Link to comment Share on other sites More sharing options...
BroadbandMaster Posted February 18, 2021 Share Posted February 18, 2021 Is it possible to capture the text rotation value and have the new block match it? I have no idea how to do this but it would prove VERY awesome if so. Thanks guys! Quote Link to comment Share on other sites More sharing options...
BIGAL Posted February 19, 2021 Share Posted February 19, 2021 Given this post is 5 years old perhaps confirm or explain what it is you want to do, get text rotation is easy. It may have been better to start a brand new post. 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.