<?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 Re: Inventor is over rotating imported blocks from C# add-in in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-is-over-rotating-imported-blocks-from-c-add-in/m-p/8466728#M80879</link>
    <description>&lt;P&gt;I imagine the rotation angle is in radians.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So just multiply&amp;nbsp;your input in degrees by&amp;nbsp;&lt;SPAN&gt;π/180 and you'll be speaking Inventor's language.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Luke&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 13 Dec 2018 19:05:19 GMT</pubDate>
    <dc:creator>LukeDavenport</dc:creator>
    <dc:date>2018-12-13T19:05:19Z</dc:date>
    <item>
      <title>Inventor is over rotating imported blocks from C# add-in</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-is-over-rotating-imported-blocks-from-c-add-in/m-p/8466626#M80878</link>
      <description>&lt;P&gt;I don't know where else to put this, but, I'm writing an add-on for inventor, and I have a button that imports a block with an arrow.&amp;nbsp; The block can be at 0, 90, 180, or 270 degrees.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When I insert the block like this, however....&lt;BR /&gt;&lt;BR /&gt; TransientGeometry tg = app.TransientGeometry;&lt;BR /&gt; dwg.ActiveSheet.AutoCADBlocks.Add(acbd, tg.CreatePoint2d(xLoc, yLoc), (double)md.Orientation, scaleX);&lt;BR /&gt;&lt;BR /&gt;it's behaving...interestingly.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;rotation of 0 degrees works.&amp;nbsp; 90 degrees sets it to 116.6, 180 degrees sets it to 233.2, and 270 degrees sets it to 349.9.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Why is inventor adding those extra degrees of rotation??? and why does it seem like the number&amp;nbsp;of degrees added is (degrees / 90 * 26.6 &amp;lt;--- why this number????) ??&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;here's the full section:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;PRE&gt;Document blockDefDoc = app.Documents.Open(materialPath, false);

                        if (blockDefDoc.DocumentType == DocumentTypeEnum.kDrawingDocumentObject)
                        {
                            DrawingDocument tedsbomDWG = blockDefDoc as DrawingDocument;
                            AutoCADBlockDefinitions acbds = tedsbomDWG.AutoCADBlockDefinitions;

                            foreach (AutoCADBlockDefinition acbd in acbds)
                            {
                                if (acbd.Name == "material")
                                {
                                    acbd.CopyTo(dwg as _DrawingDocument);
                                }
                            }
                        }
                        blockDefDoc.Close(true);
                        foreach (AutoCADBlockDefinition acbd in dwg.AutoCADBlockDefinitions)
                        {
                            if (acbd.Name == "material")
                            {
                                double scaleY = (dwg.ActiveSheet.Height / 8) / 13;
                                double scaleX = (dwg.ActiveSheet.Width / 8) / 30;

                                if (scaleY &amp;lt; scaleX)
                                {
                                    scaleX = scaleY;
                                }

                                double xLoc = (dwg.ActiveSheet.Width / 2) - (30 / 2 * scaleX);
                                double yLoc = (dwg.ActiveSheet.Height / 2) - (13 / 2 * scaleX);
                                TransientGeometry tg = app.TransientGeometry;
                                dwg.ActiveSheet.AutoCADBlocks.Add(acbd, tg.CreatePoint2d(xLoc, yLoc), (double)md.Orientation, scaleX);
                            }
                        }&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 18:34:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-is-over-rotating-imported-blocks-from-c-add-in/m-p/8466626#M80878</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-13T18:34:01Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor is over rotating imported blocks from C# add-in</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-is-over-rotating-imported-blocks-from-c-add-in/m-p/8466728#M80879</link>
      <description>&lt;P&gt;I imagine the rotation angle is in radians.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;So just multiply&amp;nbsp;your input in degrees by&amp;nbsp;&lt;SPAN&gt;π/180 and you'll be speaking Inventor's language.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Luke&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 19:05:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-is-over-rotating-imported-blocks-from-c-add-in/m-p/8466728#M80879</guid>
      <dc:creator>LukeDavenport</dc:creator>
      <dc:date>2018-12-13T19:05:19Z</dc:date>
    </item>
    <item>
      <title>Re: Inventor is over rotating imported blocks from C# add-in</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-is-over-rotating-imported-blocks-from-c-add-in/m-p/8466739#M80880</link>
      <description>&lt;P&gt;hell yeah dude, that fixed it.&amp;nbsp; thanks man.&lt;BR /&gt;the input is a double, so i was kind of wondering if that wasn't the case.&lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 19:08:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/inventor-is-over-rotating-imported-blocks-from-c-add-in/m-p/8466739#M80880</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-12-13T19:08:32Z</dc:date>
    </item>
  </channel>
</rss>

