TheSwamp

Code Red => .NET => Topic started by: latour_g on August 08, 2013, 09:35:30 AM

Title: Attribute angle considering UCS
Post by: latour_g 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);
Title: Re: Attribute angle considering UCS
Post by: fixo 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);