<?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: Create a plane at an angle with i-Logic in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11957068#M152439</link>
    <description>&lt;P&gt;That worked perfectly!&amp;nbsp; Thank you for the help.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 May 2023 13:23:18 GMT</pubDate>
    <dc:creator>Guthery1</dc:creator>
    <dc:date>2023-05-11T13:23:18Z</dc:date>
    <item>
      <title>Create a plane at an angle with i-Logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11941618#M152214</link>
      <description>&lt;P&gt;I've been trying to get this piece of code to work:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;oDef&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oWPlane&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;WorkPlane&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAxis&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;WorkAxes&lt;/SPAN&gt;
&lt;SPAN&gt;oAxis&lt;/SPAN&gt; = &lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;WorkAxes&lt;/SPAN&gt;
&lt;SPAN&gt;oWPlane&lt;/SPAN&gt; = &lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;WorkPlanes&lt;/SPAN&gt;.&lt;SPAN&gt;AddByLinePlaneAndAngle&lt;/SPAN&gt;(&lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;WorkPlanes&lt;/SPAN&gt;(&lt;SPAN&gt;"XY Plane"&lt;/SPAN&gt;), &lt;SPAN&gt;oAxis&lt;/SPAN&gt;(&lt;SPAN&gt;"Y Axis"&lt;/SPAN&gt;), 45)
&lt;SPAN&gt;oWPlane&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;"Plane_Name"&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;I found it on these forums but it doesn't seem to work in 2023 Inventor.&amp;nbsp; Does anyone know what needs to be adjusted to make it function now?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2023 14:38:09 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11941618#M152214</guid>
      <dc:creator>Guthery1</dc:creator>
      <dc:date>2023-05-04T14:38:09Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane at an angle with i-Logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11941635#M152215</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2292024"&gt;@Guthery1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You've put in the axis and the plane in the wrong order...&lt;/P&gt;
&lt;P&gt;This should work:&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDef&lt;/SPAN&gt; = &lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Document&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oWPlane&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;WorkPlane&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oAxis&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;WorkAxes&lt;/SPAN&gt;
&lt;SPAN&gt;oAxis&lt;/SPAN&gt; = &lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;WorkAxes&lt;/SPAN&gt;
&lt;SPAN&gt;oWPlane&lt;/SPAN&gt; = &lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;WorkPlanes&lt;/SPAN&gt;.&lt;SPAN&gt;AddByLinePlaneAndAngle&lt;/SPAN&gt;(&lt;SPAN&gt;oAxis&lt;/SPAN&gt;(&lt;SPAN&gt;"Y Axis"&lt;/SPAN&gt;), &lt;SPAN&gt;oDef&lt;/SPAN&gt;.&lt;SPAN&gt;WorkPlanes&lt;/SPAN&gt;(&lt;SPAN&gt;"XY Plane"&lt;/SPAN&gt;), 45)
&lt;SPAN&gt;oWPlane&lt;/SPAN&gt;.&lt;SPAN&gt;Name&lt;/SPAN&gt; = &lt;SPAN&gt;"Plane_Name"&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 04 May 2023 14:45:23 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11941635#M152215</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2023-05-04T14:45:23Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane at an angle with i-Logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11954132#M152372</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5330176"&gt;@JhoelForshav&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I had already tried flipping it around but ended up with an "Unspecified error" in line 5 of the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Guthery1_0-1683719175876.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1212701i5B212950C5BB56AC/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Guthery1_0-1683719175876.png" alt="Guthery1_0-1683719175876.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Guthery1_1-1683719199550.png" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1212702i6467794B2782551A/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Guthery1_1-1683719199550.png" alt="Guthery1_1-1683719199550.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;I know it's not much to go on, which is why I came looking for help.&amp;nbsp; I know this should be easily doable but for some reason, it isn't.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 11:47:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11954132#M152372</guid>
      <dc:creator>Guthery1</dc:creator>
      <dc:date>2023-05-10T11:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane at an angle with i-Logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11954222#M152376</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2292024"&gt;@Guthery1&lt;/a&gt;&amp;nbsp;. Unfortunately, this method does not work for assemblies.&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="2023-05-10 153044.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1212717iC47161F1B45B49F6/image-size/large?v=v2&amp;amp;px=999" role="button" title="2023-05-10 153044.png" alt="2023-05-10 153044.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 12:31:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11954222#M152376</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2023-05-10T12:31:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane at an angle with i-Logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11956884#M152428</link>
      <description>&lt;P&gt;Any ideas on how we can make it work?&amp;nbsp; I find it hard to believe that Autodesk made it so you can't create a plane with i-Logic in an assembly but left the ability to make planes other ways with i-Logic.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 12:27:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11956884#M152428</guid>
      <dc:creator>Guthery1</dc:creator>
      <dc:date>2023-05-11T12:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane at an angle with i-Logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11956922#M152430</link>
      <description>&lt;P&gt;You can create a fixed plane, here is an example:&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim oDef As AssemblyComponentDefinition = ThisDoc.Document.ComponentDefinition
Dim oWPlane As WorkPlane
Dim oAxis As WorkAxes
oAxis = oDef.WorkAxes
Dim oOriginPnt As Point
Dim oXaxis As UnitVector
Dim oYaxis As UnitVector
oOriginPnt = ThisApplication.TransientGeometry.CreatePoint(0, 0, 0)
oXaxis = ThisApplication.TransientGeometry.CreateUnitVector(1, 0, 1) '45 deg
oYaxis = ThisApplication.TransientGeometry.CreateUnitVector(0, 1, 0)
oWPlane = oDef.WorkPlanes.AddFixed(oOriginPnt, oXaxis, oYaxis)
oWPlane.Name = "Plane_Name"&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 12:45:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11956922#M152430</guid>
      <dc:creator>Andrii_Humeniuk</dc:creator>
      <dc:date>2023-05-11T12:45:58Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane at an angle with i-Logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11956974#M152433</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2292024"&gt;@Guthery1&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you look at what actually happens when you create a plane by line, plane and angle in an assembly, it adds a plane and then it adds a mate constraint to the line and an angle constraint to the plane. You can write your own function to mimic this behaviour.&lt;/P&gt;
&lt;P&gt;See example below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="visual-basic"&gt;Sub Main
	Dim yAxis As WorkAxis = ThisDoc.Document.ComponentDefinition.WorkAxes("Y Axis")
	Dim YZPlane As WorkPlane = ThisDoc.Document.ComponentDefinition.WorkPlanes("YZ Plane")
	Dim oWPlane As WorkPlane = AddPlaneByLinePlaneAndAngle(yAxis, YZPlane, 45)
	oWPlane.Name = "Plane_Name"
End Sub

Function AddPlaneByLinePlaneAndAngle(_line As Object, _plane As Object, _angle As Double) As WorkPlane
	Dim oAsm As AssemblyDocument = ThisDoc.Document
	Dim oDef As AssemblyComponentDefinition = oAsm.ComponentDefinition
	Dim oOriginPnt As Point
	Dim oXaxis As UnitVector
	Dim oYaxis As UnitVector
	oOriginPnt = ThisApplication.TransientGeometry.CreatePoint(0#, 0#, 0#)
	oXaxis = ThisApplication.TransientGeometry.CreateUnitVector(1#, 0#, 0#)
	oYaxis = ThisApplication.TransientGeometry.CreateUnitVector(0#, 1#, 0#)
	Dim oPlane As WorkPlane = oDef.WorkPlanes.AddFixed(oOriginPnt, oXaxis, oYaxis)
	oPlane.AutoResize = True
	oDef.Constraints.AddMateConstraint(_line, oPlane, 0, InferredTypeEnum.kInferredLine, InferredTypeEnum.kNoInference)
	Dim oAngleConstraint As AngleConstraint = oDef.Constraints.AddAngleConstraint(_plane, oPlane, 0, AngleConstraintSolutionTypeEnum.kDirectedSolution)
	oAngleConstraint.Angle.Expression = _angle.ToString
	oPlane.AutoResize = False
	ThisDoc.Document.Update
	Return oPlane
End Function&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 11 May 2023 13:04:28 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11956974#M152433</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2023-05-11T13:04:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane at an angle with i-Logic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11957068#M152439</link>
      <description>&lt;P&gt;That worked perfectly!&amp;nbsp; Thank you for the help.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 13:23:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/create-a-plane-at-an-angle-with-i-logic/m-p/11957068#M152439</guid>
      <dc:creator>Guthery1</dc:creator>
      <dc:date>2023-05-11T13:23:18Z</dc:date>
    </item>
  </channel>
</rss>

