<?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 with offset using Inventor API in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/7938712#M89745</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I debugged the code behind the API and found that the current&amp;nbsp; AddByPlaneAndOffset&amp;nbsp;works&amp;nbsp;for&amp;nbsp;part documents only. I am logging a defect to get this working for assemblies as well - sorry for the inconvenience!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Gerald&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 17 Apr 2018 16:22:13 GMT</pubDate>
    <dc:creator>Hochenauer</dc:creator>
    <dc:date>2018-04-17T16:22:13Z</dc:date>
    <item>
      <title>Create a plane with offset using Inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/7938036#M89744</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd like to create a new plane parallel to the XY plane with an offset of 35 mm in an assembly using Inventor API. I'm not yet familiar with VBA but I'm learning step by step.&lt;/P&gt;&lt;P&gt;I have searched on internet and I have found some code but none of them works. From what I've seen I guess it's something like that:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub&amp;nbsp;createWP()&lt;BR /&gt;
    Dim oAssDoc As AssemblyDocument
    Set oAssDoc = ThisApplication.ActiveDocument

    Dim oAssCD As AssemblyComponentDefinition
    Set oAssCD = oAssDoc.ComponentDefinition

    Dim oWPlane as WorkPlane
    Set oWPlane = oAssCD.WorkPlanes.AddByPlaneAndOffset(oAssCD.WorkPlanes.Item("XY Plane"), 35)

End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance for you help !&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 13:10:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/7938036#M89744</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-17T13:10:33Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane with offset using Inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/7938712#M89745</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I debugged the code behind the API and found that the current&amp;nbsp; AddByPlaneAndOffset&amp;nbsp;works&amp;nbsp;for&amp;nbsp;part documents only. I am logging a defect to get this working for assemblies as well - sorry for the inconvenience!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Kind regards,&lt;/P&gt;
&lt;P&gt;Gerald&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Apr 2018 16:22:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/7938712#M89745</guid>
      <dc:creator>Hochenauer</dc:creator>
      <dc:date>2018-04-17T16:22:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane with offset using Inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/7940380#M89746</link>
      <description>&lt;P&gt;Thank you for your answer I hope it will be fixed soon !&lt;/P&gt;</description>
      <pubDate>Wed, 18 Apr 2018 07:33:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/7940380#M89746</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2018-04-18T07:33:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane with offset using Inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/7975923#M89747</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;When you create an offset workplane in an assembly from the UI, what really happens is a workplane is created and an offset constraint is applied.&amp;nbsp; You can do the same thing through the API, but you have to do the steps yourself.&amp;nbsp; Here is a sample that does what you want:&lt;/P&gt;
&lt;P&gt;Public Sub AddWorkPlaneInAssembly() &lt;BR /&gt;&amp;nbsp; &amp;nbsp; Dim oAsmDoc As AssemblyDocument&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Set oAsmDoc = ThisApplication.ActiveDocument&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Dim oAssCD As AssemblyComponentDefinition&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Set oAssCD = oAsmDoc.ComponentDefinition&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; Dim oWrkPlane1 As WorkPlane&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Set oWrkPlane1 = oAssCD.WorkPlanes.Item("XY Plane")&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; Dim oOriginPnt As Point&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Dim oXaxis As UnitVector&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Dim oYaxis As UnitVector&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Set oOriginPnt = ThisApplication.TransientGeometry.CreatePoint(0#, 0#, 0#)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Set oXaxis = ThisApplication.TransientGeometry.CreateUnitVector(1#, 0#, 0#)&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Set oYaxis = ThisApplication.TransientGeometry.CreateUnitVector(0#, 1#, 0#)&lt;BR /&gt; &lt;BR /&gt;&amp;nbsp; &amp;nbsp; Dim oWrkPlane As WorkPlane&lt;BR /&gt;&amp;nbsp; &amp;nbsp; Set oWrkPlane = oAssCD.WorkPlanes.AddFixed(oOriginPnt, oXaxis, oYaxis)&amp;nbsp; ' create the workplane&lt;BR /&gt;&amp;nbsp; &amp;nbsp; oWrkPlane.AutoResize = True ' To make it easier to see&lt;BR /&gt;&amp;nbsp; &amp;nbsp; oAssCD.Constraints.AddFlushConstraint oWrkPlane, oWrkPlane1, 35 ' constrain it to the XY plane&lt;BR /&gt;End Sub&lt;/P&gt;
&lt;P&gt;Hope this helps.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;
&lt;P&gt;Ruth&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2018 23:34:00 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/7975923#M89747</guid>
      <dc:creator>ruthsteed</dc:creator>
      <dc:date>2018-05-02T23:34:00Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane with offset using Inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/10190639#M89748</link>
      <description>This is still not working in assemblies? Any reason why?</description>
      <pubDate>Fri, 26 Mar 2021 22:24:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/10190639#M89748</guid>
      <dc:creator>sam</dc:creator>
      <dc:date>2021-03-26T22:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane with offset using Inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/11479656#M89749</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;I am trying to learn how to create my own VBA-Projects for Inventor.&lt;/P&gt;&lt;P&gt;Is there a source for all these functions , like creating a plane with an offset?&lt;BR /&gt;i have many ideas for macros, but i just have no idea where to look this up.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Greetings,&lt;/P&gt;&lt;P&gt;Markus&lt;/P&gt;</description>
      <pubDate>Thu, 13 Oct 2022 10:02:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/11479656#M89749</guid>
      <dc:creator>markus_gruebel</dc:creator>
      <dc:date>2022-10-13T10:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane with offset using Inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/11638058#M89750</link>
      <description>&lt;P&gt;I am trying to Create Plane using AddByPlaneAndOffset in 2022 version. But I am facing the same !&lt;BR /&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/79287"&gt;@Hochenauer&lt;/a&gt;&amp;nbsp;&amp;nbsp;is the Issue Resolved ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;HARI&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 06:56:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/11638058#M89750</guid>
      <dc:creator>hariharanhZXJ8L</dc:creator>
      <dc:date>2022-12-23T06:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane with offset using Inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/11638101#M89751</link>
      <description>&lt;P&gt;There is still no&amp;nbsp;&lt;SPAN&gt;AddByPlaneAndOffset in assembly see &lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=WorkPlanes_AddByPlaneAndOffset" target="_blank" rel="noopener"&gt;object in API help&lt;/A&gt;. Follow message 5 vba version.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 07:47:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/11638101#M89751</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2022-12-23T07:47:42Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane with offset using Inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/11638109#M89752</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7946284"&gt;@A.Acheson&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;do you have any option to create work plane in assembly with reference to Face object ?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 07:53:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/11638109#M89752</guid>
      <dc:creator>hariharanhZXJ8L</dc:creator>
      <dc:date>2022-12-23T07:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane with offset using Inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/11638147#M89753</link>
      <description>&lt;P&gt;From memory I think you can get a point on the face, use that point to create a fixed workplane about the face then constrain it afterwards.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Dec 2022 08:25:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/11638147#M89753</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2022-12-23T08:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane with offset using Inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/14043040#M179667</link>
      <description>&lt;P&gt;Has this bug been fixed? Because I am having the same issue and I am using Inventor 2024&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2026 01:21:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/14043040#M179667</guid>
      <dc:creator>amalikAHJNB</dc:creator>
      <dc:date>2026-03-05T01:21:36Z</dc:date>
    </item>
    <item>
      <title>Re: Create a plane with offset using Inventor API</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/14043811#M179670</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/18226743"&gt;@amalikAHJNB&lt;/a&gt;.&amp;nbsp; As far as I know, the same restrictions are still in effect.&amp;nbsp; Still in the 2026 Inventor API, most of the &lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=GUID-WorkPlanes" target="_blank" rel="noopener"&gt;WorkPlanes&lt;/A&gt;.Add... type methods will only work in Parts, not in assemblies, except for the &lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=WorkPlanes_AddFixed" target="_blank" rel="noopener"&gt;WorkPlanes.AddFixed&lt;/A&gt; method, same as before.&amp;nbsp; And as mentioned in the online help for that method, when we create a WorkPlane with that method in an assembly, its definition is a&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=GUID-AssemblyWorkPlaneDef" target="_blank" rel="noopener"&gt;AssemblyWorkPlaneDef&lt;/A&gt;&amp;nbsp;type object.&amp;nbsp; And as you can see in the online help page for that object type, it does have properties for all 3 inputs that were required when defining it, but they are all 'ReadOnly' properties.&amp;nbsp; But it does also have the &lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=AssemblyWorkPlaneDef_GetData" target="_blank" rel="noopener"&gt;GetData&lt;/A&gt; &amp;amp; &lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=AssemblyWorkPlaneDef_PutData" target="_blank" rel="noopener"&gt;PutData&lt;/A&gt;&amp;nbsp;methods, where the PutData method actually lets us 'change' those inputs, if necessary.&amp;nbsp; But we can also use its&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2026/ENU/?guid=AssemblyWorkPlaneDef_Constraints" target="_blank" rel="noopener"&gt;Constraints&lt;/A&gt;&amp;nbsp;property to access the collection of assembly constraints associated with that WorkPlane, if any.&amp;nbsp; Then, if we wanted to, we could change something about one or more of those constraints.&amp;nbsp; And yes, the process shown in Message 4 above does still work to create an 'offset' WorkPlane in an assembly.&amp;nbsp; Below is an updated iLogic rule example of the same process which I just tested in Inventor 2024.4.1 and it worked just fine.&amp;nbsp; I made sure to add comments in the code too, to help guide folks about what the next line(s) of code are trying to do.&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main
	'get current assembly
	Dim oADoc As AssemblyDocument = TryCast(ThisDoc.Document, Inventor.AssemblyDocument)
	If oADoc Is Nothing Then Return
	'get its 'definition' (where model geometry gets created)
	Dim oADef As AssemblyComponentDefinition = oADoc.ComponentDefinition
	'get its WorkPlanes collection
	Dim oWPlanes As Inventor.WorkPlanes = oADef.WorkPlanes
	'get the origin 'XY Plane', which is always Item 3
	Dim oXY_WPlane As Inventor.WorkPlane = oWPlanes.Item(3)
	'&amp;lt;&amp;lt;&amp;lt; define a 3D point, and 2 directions for the new WorkPlane we want to create &amp;gt;&amp;gt;&amp;gt;
	Dim oP3D As Inventor.Point = oADef.WorkPoints.Item(1).Point.Copy()
	oP3D.Z = 35 'units not specified, so they will be understood as centimeters
	Dim oX_Dir As Inventor.UnitVector = oADef.WorkAxes.Item(1).Line.Direction
	Dim oY_Dir As Inventor.UnitVector = oADef.WorkAxes.Item(2).Line.Direction
	'create a 'fixed' WorkPlane using those inputs
	Dim oNewWPlane As Inventor.WorkPlane = oWPlanes.AddFixed(oP3D, oX_Dir, oY_Dir)
	'turn on its AutoResize to make it more visible
	oNewWPlane.AutoResize = True
	'create a Flush constraint from the origin XY Plane to the new WorkPlane, which actually constrains the offset
	Dim oFlushConst As Inventor.FlushConstraint = oADef.Constraints.AddFlushConstraint(oXY_WPlane, oNewWPlane, "WorkPlaneOffset1 = 35 cm")
	'this just updates the current view, so you can immediately see the results
	ThisApplication.ActiveView.Fit(True)
End Sub&lt;/LI-CODE&gt;
&lt;P&gt;If this solved your problem, or answered your question, please click &lt;SPAN&gt;&lt;STRONG&gt; ACCEPT SOLUTION &lt;/STRONG&gt;&lt;/SPAN&gt;.&lt;BR /&gt;Or, if this helped you, please click (LIKE or KUDOS) &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 05 Mar 2026 13:14:38 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/create-a-plane-with-offset-using-inventor-api/m-p/14043811#M179670</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2026-03-05T13:14:38Z</dc:date>
    </item>
  </channel>
</rss>

