Ajmal Posted June 17, 2023 Posted June 17, 2023 (edited) I am experiencing an issue with mirrored text in my drawings. the "Mirrortext" system variable set to 0, the text still mirrors when I mirror the drawing. I have observed that there are two types of text in the drawing: one type mirrors along with the drawing, while the other type maintains its normal orientation when the drawing is mirrored. I have attached the drawings for reference. Could anyone provide a solution to this problem? Thank you in advance for your assistance. TEXT ISSUE.dwg TEXT ISSUE 1.dwg Edited June 17, 2023 by Ajmal add more drawings Quote
marko_ribar Posted June 17, 2023 Posted June 17, 2023 (edited) I guess you know this... If text is nailed into block or xref, it will mirror TEXT along with block/xref, if not - normal text in model space (when MIRROR and set MIRRORTXT to 0) text will retain it's unmirrored look... Edited June 17, 2023 by marko_ribar Quote
Steven P Posted June 18, 2023 Posted June 18, 2023 Sunday, CAD Is off so I can't check this - but the Internet reckons set block text to attributes and setting 'constant' and then they won't mirror. I thought there was another setting in there to keep normal text the same too - would have to open CAD to check though; Quote
Ajmal Posted June 19, 2023 Author Posted June 19, 2023 (edited) l Edited June 19, 2023 by Ajmal Quote
Ajmal Posted June 19, 2023 Author Posted June 19, 2023 I found one solution, but it's not an easier way. When I flatten the text, it becomes okay, but the text gets explodes. Quote
Ajmal Posted July 2, 2023 Author Posted July 2, 2023 On 17/06/2023 at 19:59, marko_ribar said: I guess you know this... If text is nailed into block or xref, it will mirror TEXT along with block/xref, if not - normal text in model space (when MIRROR and set MIRRORTXT to 0) text will retain it's unmirrored look... text not in the block. text already independent Quote
Ajmal Posted July 3, 2023 Author Posted July 3, 2023 I have one solution idea. select all text and recreate text with the same value and all other properties with the same location. I don't know if this is a good idea. actually, when I google, it's showing this text from 3rd party text so sometimes it will act like this. so when I ever mirror, the text is also mirrored. if I match the text with the same property also with will not change. can someone do this for me Quote
Ajmal Posted July 3, 2023 Author Posted July 3, 2023 (defun recreate-selected-text () (setq ss (ssget)) (if ss (progn (setq i 0) (repeat (sslength ss) (setq ent (ssname ss i)) (setq text-properties (entget ent)) (setq old-text (cdr (assoc 1 text-properties))) ;; Get text properties (setq layer (cdr (assoc 8 text-properties))) (setq height (cdr (assoc 40 text-properties))) (setq angle (cdr (assoc 50 text-properties))) (setq position (cdr (assoc 10 text-properties))) (setq text-style (cdr (assoc 7 text-properties))) ;; Create new text entity (setq new-text (entmakex (list '(0 . "TEXT") (cons 8 layer) (cons 40 height) (cons 50 angle) (cons 10 position) (cons 7 text-style) (cons 1 old-text) ))) ;; Delete old text entity (entdel ent) (setq i (1+ i)) ) (princ "\nSelected text recreated.") ) (princ "\nNo text objects selected.") ) ) (defun c:textor () (recreate-selected-text) (princ) ) this is working but I need in mtext, this is create a text object Quote
Steven P Posted July 3, 2023 Posted July 3, 2023 (edited) I never had time earlier today, but for your latest question, this will remake an entity exactly the same and delete the old entity - in this case filtered by text or mtext (defun c:recreateentity ( / SS acount ent MyEnt new-text) (if (setq SS (ssget (list '(0 . "TEXT,MTEXT")) )) ; user selects text (progn (setq acount (sslength SS)) (while (> acount 0) (setq ent (ssname SS (- acount 1))) (setq MyEnt (entget ent)) (setq new-text (entmakex MyEnt )) ; end entmakex, end setq (entdel ent) (setq acount (- acount 1)) ) ; end while (princ "\nSelected entity recreated.") ) ; end progn (princ "\nNo objects selected.") ) ; end if ) If all you want is a few items you could do something like this. Slightly shorter code to yours, added in filter for the selection set (defun c:copytext ( / SS acount ent MyEnt new-text) (if (setq SS (ssget (list '(0 . "TEXT,MTEXT")) )) ; user selects text (progn (setq acount (sslength SS)) (while (> acount 0) (setq ent (ssname SS (- acount 1))) (setq MyEnt (entget ent)) (setq new-text (entmakex (list (assoc 0 MyEnt) ; entity type (assoc 100 MyEnt) ; entity type (assoc 100 (reverse MyEnt)) ; entity type (assoc 8 MyEnt) ; layer (assoc 40 MyEnt) ; text height (assoc 50 MyEnt) ; text angle (assoc 10 MyEnt) ; insertion point (assoc 7 MyEnt) ; text style (assoc 1 MyEnt) ; actual text, up to 256 characters ) ;end list )) ; end entmakex, end setq (entdel ent) (setq acount (- acount 1)) ) ; end while (princ "\nSelected text recreated.") ) ; end progn (princ "\nNo text objects selected.") ) ; end if ) EDIT Put the '100' codes in If this was something I would use a lot I would go for the top method but search remove entity codes I don't want from the list using something like this, making the search terms as a list perhaps and a loop to remove the from the entity definition list (defun c:copytext ( / SS acount ent MyEnt ) (if (setq SS (ssget (list '(0 . "TEXT,MTEXT")) )) ; user selects text ; ignores the never used rtext else use "*TEXT" (progn (setq acount (sslength SS)) ; counting backwards through selection set - you can remove last list items (while (> acount 0) ; loop length of selection set (setq ent (ssname SS (- acount 1))) ; get each entity name (setq MyEnt (entget ent)) ; get the entity description list (setq search (list 210 11 41 42 43 )) ; as examples for entity codes to ignore, remove from the list ;;This only works for unique entity description codes, example polylines have several '10' - this won't work (foreach n search ; loop through the entity description (setq MyEnt (append ; create a new list (reverse (cdr (member (assoc n MyEnt) (reverse MyEnt) ))) ; items before the nth search term (cdr (member (assoc n MyEnt) MyEnt )) ; items after the nth search terms )); ; end setq ) ; end foreach (entmakex MyEnt) ; Make new text (entdel Ent) ; delete old text (setq acount (- acount 1)) ; incriment for next text ) ; end while (princ "\nSelected text recreated.") ) ; end progn (princ "\nNo text objects selected.") ) ; end if ) EDIT 1 Changed the last code to exclude dxf codes 41, 42, and 43 as example, X, Y, Z scale factors, if set to negative will mirror text in that axis EDIT 2 Changed last code to exclude codes 210 and 11, mirroring mtext Also slight change to code to make it work Edited July 4, 2023 by Steven P Quote
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.