Discussion:
Attributes mirror after using ATTREDEF
(too old to reply)
simon.weel
2005-01-05 09:53:05 UTC
Permalink
Hello,

We experience a nasty problem with ATTREDEF.
Blocks with attributes can be mirrored and the text is still readable. But after changing a block with attributes using the ATTREDEF command, the attributes in mirrored blocks become mirrored as well, making them unreadable.

I've been trying to tackle this for a while, but can't get a grasp on it. Some strange things happen. Although it is possible to edit the attribute values by simply double-clicking the block, the command -ATTEDIT reports 0 attributes found when you pick such a mirrored attribute.

Does anyone has a clue in how to solve this? It seems like the ATTREDEF command does some unexpected things...

Greetings,

Simon Weel
unknown
2005-01-05 23:41:58 UTC
Permalink
Hi Simon,

I don't see that problem now, but think I remember seeing it when we
discussed this before. (
http://discussion.autodesk.com/thread.jspa?messageID=4132889 ) Perhaps
related; I do see other strange happenings on my system involving attributes
in mirrored blocks (non-uniformly scaled blocks in general, actually).

I may not be able to, but I'm interested in helping figure this out. I
would need more info though. What version of AutoCAD? It may be that the
problem or even possible solutions to it are version specific (maybe why I
don't see it now). And as I mentioned before, looking at a small sample
file that demonstrates the problem would help a lot too.

James
Post by simon.weel
Hello,
We experience a nasty problem with ATTREDEF.
Blocks with attributes can be mirrored and the text is still readable. But
after changing a block with attributes using the ATTREDEF command, the
attributes in mirrored blocks become mirrored as well, making them
unreadable.
Post by simon.weel
I've been trying to tackle this for a while, but can't get a grasp on it.
Some strange things happen. Although it is possible to edit the attribute
values by simply double-clicking the block, the command -ATTEDIT reports 0
attributes found when you pick such a mirrored attribute.
Post by simon.weel
Does anyone has a clue in how to solve this? It seems like the ATTREDEF
command does some unexpected things...
Post by simon.weel
Greetings,
Simon Weel
unknown
2005-01-06 14:14:48 UTC
Permalink
Ahhh! Now I see. My current routine to fix this "moves" the attribute if
it is not justified middle center. This will require a bit more work.
Looking into it now and will post back.

James
Hello James,
You're right, I started this discussion before :)
I made a sample drawing, making clear what the problem is (I hope). We use
AutoCAD 2000i.
The drawing contains two blocks (Block1 and Block2). Both are inserted
normal and mirrored. The attribute value in both blocks is readable. Then I
exploded block2 and used ATTREDEF to redefine it. Block2 mirrored shows what
happens then. The attribute value is mirrored, making it hard to read.
You can modify the attribute value of block2 mirrored by simple double
clicking it, but if you try -ATTEDIT, you'll notice you cannot select the
attribute.
It's not a breath-taking problem since we try to use the ATTREDEF command
as little as possible, but we do have a problem in cases it IS used...
Greetings,
Simon Weel
unknown
2005-01-06 16:20:44 UTC
Permalink
Simon, see if this works for you.

James

[code]
;;; Fixes attributes that are facing away
(defun c:FixAtt (/ edt enm jst ins nrm rot vdr wid)
(command "_.undo" "begin")
(setq vdr (trans (getvar "viewdir") 1 0)
enm (car (nentsel "\nPick Attribute to Fix: "))
edt (entget enm)
nrm (assoc 210 edt)
)
(if (equal (cdr nrm) '(0 0 -1) 0.1)
(progn
(setq jst (cdr (assoc 72 edt))
wid (if (vl-position
t
(mapcar '(lambda (a) (= jst a)) '(1 3 4 5))
)
0
(progn
(setq wid (textbox (entget enm))
wid (- (caadr wid) (caar wid))
)
(if (= jst 2)
wid
(- wid)
)
)
)
rot (cdr (assoc 50 edt))
rot (list (cos rot) (sin rot) 0)
rot (trans rot enm vdr)
rot (+ (angle '(0 0 0) rot) pi)
edt (subst (cons 50 rot) (assoc 50 edt) edt)
wid (polar '(0 0 0) rot wid)
ins (trans (cdr (assoc 10 edt)) enm vdr)
ins (mapcar '+ ins wid)
edt (subst (cons 10 ins) (assoc 10 edt) edt)
ins (trans (cdr (assoc 11 edt)) enm vdr)
ins (mapcar '+ ins wid)
edt (subst (cons 11 ins) (assoc 11 edt) edt)
edt (subst (cons 210 vdr) (assoc 210 edt) edt)
)
(entmod edt)
(entupd enm)
)
)
(command "_.undo" "end")
(princ)
)
[/code]
Hello James,
You're right, I started this discussion before :)
I made a sample drawing, making clear what the problem is (I hope). We use
AutoCAD 2000i.
The drawing contains two blocks (Block1 and Block2). Both are inserted
normal and mirrored. The attribute value in both blocks is readable. Then I
exploded block2 and used ATTREDEF to redefine it. Block2 mirrored shows what
happens then. The attribute value is mirrored, making it hard to read.
You can modify the attribute value of block2 mirrored by simple double
clicking it, but if you try -ATTEDIT, you'll notice you cannot select the
attribute.
It's not a breath-taking problem since we try to use the ATTREDEF command
as little as possible, but we do have a problem in cases it IS used...
Greetings,
Simon Weel
simon.weel
2005-01-06 16:38:03 UTC
Permalink
Yes! Great!!

Thanks a lot James, me and my colleagues are very happy with this routine.

Greetings,

Simon Weel
unknown
2005-01-06 19:24:22 UTC
Permalink
Excellent! You're welcome.

James
Post by simon.weel
Yes! Great!!
Thanks a lot James, me and my colleagues are very happy with this routine.
Greetings,
Simon Weel
Jay
2005-01-06 16:10:18 UTC
Permalink
When I mirror your BLOCK2, the text doesn't mirror, unlike what your samle shows.

Anyway, have you considered using the Express Tolls Block Attribute Manager?

Jay
Loading...