Jump to content

Block display text is mirrored


mikewong0719

Recommended Posts

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

NEW.JPG

Link to comment
Share on other sites

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 by BIGAL
Link to comment
Share on other sites

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)
      )
    )
  )
)

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

  • CADTutor changed the title to Block display text is mirrored
  • 2 years later...
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?

Link to comment
Share on other sites

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)
)

 

Link to comment
Share on other sites

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.

image.png.20ca146f17207c7b3700e08087e254df.png

 

Link to comment
Share on other sites

Like I said, it might be not the same situation.

Select your mirrored block and set the x scale to 1.

 

image.png.2b9da1ab8c04fa95dc5b8d434341364c.png

 

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...