Allow MTEXT attribute to be both mirrored and flipped

Allow MTEXT attribute to be both mirrored and flipped

Anonymous
Not applicable
2,446 Views
3 Replies
Message 1 of 4

Allow MTEXT attribute to be both mirrored and flipped

Anonymous
Not applicable

I have a dynamic block with two MTEXT attributes attached. MTEXT was used because it autojustifies- when you flip the block or rotate the block, the attribute justifies accordingly. And it was working pretty well- if you either mirrored OR used the flip attribute built into the block, it looked perfectly fine. However, if you ever flipped AND mirrored a block, it would mess up the block pretty severely. Attached below is the drawing with a few different states of the block.

 

This is not the only case I've seen this MTEXT justify weirdly, just the only case I've been able to replicate. Sometimes they will all break after just one flip or mirror. 

 

Do you know of a way to keep the text justification pointing the right direction if the block is both flipped and mirrored? If you mirror/flip the block again it will reset itself, but I want to get a simpler solution if possible.

 

Thanks!

0 Likes
Accepted solutions (1)
2,447 Views
3 Replies
Replies (3)
Message 2 of 4

MetalFingerz
Advocate
Advocate
Accepted solution

@Anonymous wrote:

I have a dynamic block with two MTEXT attributes attached. MTEXT was used because it autojustifies- when you flip the block or rotate the block, the attribute justifies accordingly. And it was working pretty well- if you either mirrored OR used the flip attribute built into the block, it looked perfectly fine. However, if you ever flipped AND mirrored a block, it would mess up the block pretty severely. Attached below is the drawing with a few different states of the block.

 

This is not the only case I've seen this MTEXT justify weirdly, just the only case I've been able to replicate. Sometimes they will all break after just one flip or mirror. 

 

Do you know of a way to keep the text justification pointing the right direction if the block is both flipped and mirrored? If you mirror/flip the block again it will reset itself, but I want to get a simpler solution if possible.

 

Thanks!


Hi Colin,

 

 The issue lies in the way the flip action and the mirror command deals with attributes justifications and their text alignments. What you should do is justify all your attributes with a *-center justification so flip and mirror works the same way.

 

What I mean is that your "DEVICE" attribute is justified as "top-left" with the text aligned to the left (logical). When the flip action is used, the "top-left" becomes "top-right" and the texts is then aligned to the right. Vice versa for the "CON-DETAIL" attribute. The issue here seems that the mirror command fails to properly align your attribute after the mirroring. It does justifies it well but it keeps the same alignment as the beginning, hence the display bugs.

 

When you justifies your attribute with a *-center" justification, the text is aligned to the center and therefore both the flip action and the mirror command works as intended. It seems to be a bug in Autocad about attribute mirroring (it doesn't do so with texts) that the flip action avoids.

Message 3 of 4

Anonymous
Not applicable

Thanks for your response!

 

Unfortunately, I don't know if I can use a -center justification in this case. The DEVICE attribute is supposed to be lined up against a side of a rectangle, as shown below. If I use a -center justification, it wouldn't line up for smaller DEVICE tags and could potentially overspill into the block on longer ones. Do you know if there's anything else? If not, I'll just put a note in to mirror-then-flip-then-copypaste all offending blocks on an error, as that appears to reset them.

 

 

Capture.PNG

0 Likes
Message 4 of 4

MetalFingerz
Advocate
Advocate

@Anonymous wrote:

Thanks for your response!

 

Unfortunately, I don't know if I can use a -center justification in this case. The DEVICE attribute is supposed to be lined up against a side of a rectangle, as shown below. If I use a -center justification, it wouldn't line up for smaller DEVICE tags and could potentially overspill into the block on longer ones. Do you know if there's anything else? If not, I'll just put a note in to mirror-then-flip-then-copypaste all offending blocks on an error, as that appears to reset them.

 

 

Capture.PNG


Well, it's the MIRROR command that makes the block buggy. If you pass a note, just tell your coworkers that only flip actions should be used and it'll be fine. There really is no need to mirror a block if you created flip actions honestly, above all as it's way more handy to flip a block that way ! 😉

 

For your information, on your "weirdattributetest" file, out of the 10 examples, 6 are buggy and they all have in common that they have been mirrored : if you open the block in the editor and save it to force the instances to update, you'll see that all mirrored blocks are buggy. It's true that mirroring them back displays the block normally again but you should save yourself the hassle of checking every blocks to see if they are mirrored.

0 Likes