mikewong0719 Posted September 7, 2018 Posted September 7, 2018 HELLO, I HAVE A QUESTION, I HAVE 2 SAME BLOCK , BLOCK NAME AND ROTATION ANGLE IS SAME, BUT I DON'T KNOW WHY SHOW DISPLAY TEXT IS MIRROR, LIKE TO THIS JPEG , ANYONE KNOW HOW CAN SOLVE, THX NEW.dwg Quote
pBe Posted September 7, 2018 Posted September 7, 2018 (edited) Mirrtext -> 0 [ Depending on the current state of the block that is ] Edited September 7, 2018 by pBe Quote
BIGAL Posted September 7, 2018 Posted September 7, 2018 (edited) You have mirrored the block, a close inspection of some of the entitiy details "Normal" reveals it is mirrored. Just do mirror again. Pbe snuck in while I was thinking about it. Edited September 7, 2018 by BIGAL Quote
mikewong0719 Posted September 7, 2018 Author Posted September 7, 2018 mirrtext -> 0 not work, any other method can solve this problem?? Quote
Stefan BMR Posted September 7, 2018 Posted September 7, 2018 The normal vector of the block is -1 on z axis. It is somehow mirrored about XY plan. You can fix it like this (if (setq e (car (entsel))) (progn (setq p (trans (cdr (assoc 10 (entget e))) e 0)) (entmod (mapcar '(lambda (x) (cond ((= (car x) 10) (cons 10 (trans (cdr x) e 0)) ) ((= (car x) 210) '(210 0.0 0.0 1.0) ) (T x) ) ) (entget e) ) ) ) ) Quote
mikewong0719 Posted September 7, 2018 Author Posted September 7, 2018 THIS LISP ONE TIME ONLY CAN SELECT ONE BLOCK, HOW TO SELECT ALL BLOCK? Quote
pBe Posted September 7, 2018 Posted September 7, 2018 32 minutes ago, Stefan BMR said: The normal vector of the block is -1 on z axis. It is somehow mirrored about XY plan. 3 There it is Stefan <--- Way too fast. Quote
mikewong0719 Posted September 7, 2018 Author Posted September 7, 2018 HOW TO ONE TIME SELECT ALL BLOCK TO SOLVE, THX Quote
BIGAL Posted September 7, 2018 Posted September 7, 2018 Nice one stefan played with vla-put-normal worked once then went weird. Quote
eldon Posted September 7, 2018 Posted September 7, 2018 Another way to manually correct the problem is to rotate3D 180° about the Y axis. Quote
brianfengming Posted July 26, 2021 Posted July 26, 2021 On 9/7/2018 at 11:59 AM, Stefan BMR said: The normal vector of the block is -1 on z axis. It is somehow mirrored about XY plan. You can fix it like this (if (setq e (car (entsel))) (progn (setq p (trans (cdr (assoc 10 (entget e))) e 0)) (entmod (mapcar '(lambda (x) (cond ((= (car x) 10) (cons 10 (trans (cdr x) e 0)) ) ((= (car x) 210) '(210 0.0 0.0 1.0) ) (T x) ) ) (entget e) ) ) ) ) is it possible to provide whole lisp code for reference? Quote
Stefan BMR Posted July 26, 2021 Posted July 26, 2021 6 hours ago, brianfengming said: is it possible to provide whole lisp code for reference? Of course. Just be aware that the image sample in OP can be generated by some different settings, like MIRRTEXT = 1. Those errors are not fixed by my lisp. (defun c:test ( / *error* acdoc ss i e p) (setq acdoc (vla-get-activedocument (vlax-get-acad-object) ) ) (if (= 8 (logand (getvar 'undoctl) 8)) (vla-endundomark acdoc) ) (vla-startundomark acdoc) (defun *error* (msg) (and msg (not (wcmatch (strcase msg) "*EXIT*,*CANCEL*,*ABORT*")) (princ (strcat "\nERROR: " msg)) ) (if (= 8 (logand (getvar 'undoctl) 8)) (vla-endundomark acdoc) ) (princ) ) (if (setq ss (ssget "_:L" '((0 . "INSERT") (210 0.0 0.0 -1.0)))) (repeat (setq i (sslength ss)) (setq e (ssname ss (setq i (1- i)))) (setq p (trans (cdr (assoc 10 (entget e))) e 0)) (entmod (mapcar '(lambda (x) (cond ((= (car x) 10) (cons 10 (trans (cdr x) e 0)) ) ((= (car x) 210) '(210 0.0 0.0 1.0) ) (T x) ) ) (entget e) ) ) ) ) (*error* nil) (princ) ) Quote
brianfengming Posted July 26, 2021 Posted July 26, 2021 9 minutes ago, Stefan BMR said: Of course. Just be aware that the image sample in OP can be generated by some different settings, like MIRRTEXT = 1. Those errors are not fixed by my lisp. (defun c:test ( / *error* acdoc ss i e p) (setq acdoc (vla-get-activedocument (vlax-get-acad-object) ) ) (if (= 8 (logand (getvar 'undoctl) 8)) (vla-endundomark acdoc) ) (vla-startundomark acdoc) (defun *error* (msg) (and msg (not (wcmatch (strcase msg) "*EXIT*,*CANCEL*,*ABORT*")) (princ (strcat "\nERROR: " msg)) ) (if (= 8 (logand (getvar 'undoctl) 8)) (vla-endundomark acdoc) ) (princ) ) (if (setq ss (ssget "_:L" '((0 . "INSERT") (210 0.0 0.0 -1.0)))) (repeat (setq i (sslength ss)) (setq e (ssname ss (setq i (1- i)))) (setq p (trans (cdr (assoc 10 (entget e))) e 0)) (entmod (mapcar '(lambda (x) (cond ((= (car x) 10) (cons 10 (trans (cdr x) e 0)) ) ((= (car x) 210) '(210 0.0 0.0 1.0) ) (T x) ) ) (entget e) ) ) ) ) (*error* nil) (princ) ) thx for your swift reply. but, when i execute the command "text", he ask me to select the objects, but I can't select any objects. Quote
brianfengming Posted July 26, 2021 Posted July 26, 2021 2 minutes ago, Stefan BMR said: Post a dwg sample test.dwg Quote
Stefan BMR Posted July 26, 2021 Posted July 26, 2021 Like I said, it might be not the same situation. Select your mirrored block and set the x scale to 1. Quote
tombu Posted July 26, 2021 Posted July 26, 2021 Worth a look https://forums.autodesk.com/t5/visual-lisp-autolisp-and-general/mirrored-block-get-negative-value-in-assoc-10/td-p/6597923 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.