Author Topic: Attribute angle considering UCS  (Read 1679 times)

0 Members and 1 Guest are viewing this topic.

latour_g

  • Newt
  • Posts: 184
Attribute angle considering UCS
« on: August 08, 2013, 09:35:30 AM »
Hi,
I have to set the angle for blocks attributes but I don't know how to set it correctly when the UCS is modify.

Like that, the position of the attribute is correct but the angle is incorrect.
Code: [Select]
AttributeReference att = (AttributeReference)tr.GetObject(id, OpenMode.ForWrite);
att.Rotation = rotAngle;

Like that, the angle of the attrbiute is correct but the position is incorrect.
Code: [Select]
AttributeReference att = (AttributeReference)tr.GetObject(id, OpenMode.ForWrite);
att.Rotation = rotAngle;
att.TransformBy(doc.Editor.CurrentUserCoordinateSystem);

fixo

  • Guest
Re: Attribute angle considering UCS
« Reply #1 on: August 09, 2013, 02:25:37 AM »
Try something like this using BlockTransform matrix:
Code: [Select]
    attRef.Position = attDef.Position.TransformBy(bref.BlockTransform);

                        attRef.Tag = attDef.Tag;

                        attRef.TextString = attDef.TextString;

                        attRef.AdjustAlignment(db);