<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic AutoCAD BlockReference with Attribute Reference - Rotate Attribute Reference to TOP View in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/autocad-blockreference-with-attribute-reference-rotate-attribute/m-p/11468082#M11472</link>
    <description>&lt;P&gt;&lt;FONT&gt;Hi,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;I am looking for some help, we have a block reference that has been placed on a UCS. I'd like to rotate the Attribute Reference to the top view for printing purposes.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;The Block Reference looks like this&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;block reference Normal: {(-0.447489037915538,0.774278908692316,-0.447488248448676)}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;block reference Rotation: 3.1415916339744827&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;block reference BlockTransform: {((2.07792693857256,0.537401292332017,-1.07397369099729,139.455483961257),(1.20092449302597,-0.929846906863022,1.85826938086156,127.146580516264),(2.18839580212737E-06,-2.14629554833372,-1.07397179627682,-50),(0,0,0 ,one))}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;block reference Position: {(139.455483961257,127.146580516264,-50)}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;The Attribute Reference looks like this&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Attribute Reference Normal: {(-0.447489037915538,0.774278908692316,-0.447488248448676)}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Attribute Reference Rotation: 3.1415916339744827&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Attribute Reference Position: {(140.xxx-xxxxxxxx,127.319427379831,-51.2288381400736)}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;How do I go about transforming the Attribute reference so viewable from the top&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Oct 2022 11:03:14 GMT</pubDate>
    <dc:creator>rberghLJ4SA</dc:creator>
    <dc:date>2022-10-07T11:03:14Z</dc:date>
    <item>
      <title>AutoCAD BlockReference with Attribute Reference - Rotate Attribute Reference to TOP View</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-blockreference-with-attribute-reference-rotate-attribute/m-p/11468082#M11472</link>
      <description>&lt;P&gt;&lt;FONT&gt;Hi,&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;I am looking for some help, we have a block reference that has been placed on a UCS. I'd like to rotate the Attribute Reference to the top view for printing purposes.&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;The Block Reference looks like this&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;block reference Normal: {(-0.447489037915538,0.774278908692316,-0.447488248448676)}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;block reference Rotation: 3.1415916339744827&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;block reference BlockTransform: {((2.07792693857256,0.537401292332017,-1.07397369099729,139.455483961257),(1.20092449302597,-0.929846906863022,1.85826938086156,127.146580516264),(2.18839580212737E-06,-2.14629554833372,-1.07397179627682,-50),(0,0,0 ,one))}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;block reference Position: {(139.455483961257,127.146580516264,-50)}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;The Attribute Reference looks like this&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Attribute Reference Normal: {(-0.447489037915538,0.774278908692316,-0.447488248448676)}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Attribute Reference Rotation: 3.1415916339744827&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;Attribute Reference Position: {(140.xxx-xxxxxxxx,127.319427379831,-51.2288381400736)}&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT&gt;How do I go about transforming the Attribute reference so viewable from the top&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 11:03:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-blockreference-with-attribute-reference-rotate-attribute/m-p/11468082#M11472</guid>
      <dc:creator>rberghLJ4SA</dc:creator>
      <dc:date>2022-10-07T11:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD BlockReference with Attribute Reference - Rotate Attribute Reference to TOP View</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-blockreference-with-attribute-reference-rotate-attribute/m-p/11468359#M11473</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;if (br.AttributeCollection != null &amp;amp;&amp;amp; br.AttributeCollection.Count != 0)
            {
                foreach (ObjectId id in br.AttributeCollection)
                {
                    DBObject obj = acTrans.GetObject(id, OpenMode.ForRead);

                    AttributeReference ar = obj as AttributeReference;

                    if (ar != null &amp;amp;&amp;amp; ar.Normal == new Vector3d(0, 0, 1))
                    {
                        ar.UpgradeOpen();

                        Matrix3d brMat = br.BlockTransform;

                        //Keep current position
                        Point3d pos = new Point3d(ar.Position.X, ar.Position.Y, ar.Position.Z);
                        Vector3d targetNormal = new Vector3d(0, 0, 1);

                        //Set new normal and put back the position.
                        ar.Normal = targetNormal;
                        ar.Position = pos;

                        //Get projection matrix
                        Plane targetPlane = new Plane(new Point3d(0, 0, 0), targetNormal);
                        Matrix3d mat = Matrix3d.Projection(targetPlane, targetNormal);

                        //Compute the rotation on WCS.
                        //We do this by taking the XAxis of blockTransform and projecting that onto WCS.
                        //Then get the angle on plane of that new projected vector.
                        Vector3d vec = brMat.CoordinateSystem3d.Xaxis;
                        Vector3d vecTrans = vec.TransformBy(mat);
                        Plane worldPlane = new Plane(Point3d.Origin, Vector3d.ZAxis);
                        double angleOnPlane = vecTrans.AngleOnPlane(worldPlane);
                        //double angleOnPlaneDeg = angleOnPlane * 57.2958;
                        ar.Rotation = originalRotsAR[count] + angleOnPlane;

                       

                        count++;
                    }
                }
            }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I 've tried this but then the text moves away from the block but it is on the correct plane facing up&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 13:21:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-blockreference-with-attribute-reference-rotate-attribute/m-p/11468359#M11473</guid>
      <dc:creator>rberghLJ4SA</dc:creator>
      <dc:date>2022-10-07T13:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: AutoCAD BlockReference with Attribute Reference - Rotate Attribute Reference to TOP View</title>
      <link>https://forums.autodesk.com/t5/net-forum/autocad-blockreference-with-attribute-reference-rotate-attribute/m-p/11468416#M11474</link>
      <description>&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="after" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1124733i3264EAB474D62FD3/image-size/large?v=v2&amp;amp;px=999" role="button" title="after.png" alt="after" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;after&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="before" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1124734i02A08474B08FCAA2/image-size/large?v=v2&amp;amp;px=999" role="button" title="before.png" alt="before" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;before&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 13:34:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/autocad-blockreference-with-attribute-reference-rotate-attribute/m-p/11468416#M11474</guid>
      <dc:creator>rberghLJ4SA</dc:creator>
      <dc:date>2022-10-07T13:34:17Z</dc:date>
    </item>
  </channel>
</rss>

