<?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 Automate general dimension between 2 planes of a sub-assembly in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/automate-general-dimension-between-2-planes-of-a-sub-assembly/m-p/9691223#M59480</link>
    <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to make a code that automates a general dimension between the XY- planes of a subassembly in the idw enviroment&lt;/P&gt;&lt;P&gt;The main assembly has been named: assembly1 and the subassemblies as Test:1 and Test:2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After some googling i found this code, unfortunaly i’m unable to get it to work&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/creating-a-dimension-between-two-workplanes-in-a-drawing/td-p/6840183" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/creating-a-dimension-between-two-workplanes-in-a-drawing/td-p/6840183&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See in the attachments for a visual explanation.&lt;/P&gt;&lt;P&gt;First : No Dimension&lt;/P&gt;&lt;P&gt;Second: The XY Planes of the sub-assemblies&lt;/P&gt;&lt;P&gt;Third: a generated general dimension between the two subassemblies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the code so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim oDrawingDocument As DrawingDocument&lt;BR /&gt;oDrawingDocument = ThisApplication.ActiveDocument&lt;BR /&gt;oSheet = ThisApplication.ActiveDocument.ActiveSheet&lt;BR /&gt;oDrawingView = ActiveSheet.View("VIEW11").View&lt;/P&gt;&lt;P&gt;oAssemblyDocument = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument&lt;BR /&gt;oTG = ThisApplication.TransientGeometry&lt;/P&gt;&lt;P&gt;Dim oOcc As ComponentOccurrence = ThisApplication.ActiveDocument.ReferencedDocuments(1).ComponentDefinition.Occurrences.ItemByName("Test:1")&lt;BR /&gt;Dim oOcc1 As ComponentOccurrence = ThisApplication.ActiveDocument.ReferencedDocuments(1).ComponentDefinition.Occurrences.ItemByName("Test2:2")&lt;/P&gt;&lt;P&gt;Dim wp1 As WorkPlane = oOcc.Definition.WorkPlanes.Item("XY Plane")&lt;BR /&gt;Dim wp2 As WorkPlane = oOcc1.Definition.WorkPlanes.Item("XY Plane")&lt;/P&gt;&lt;P&gt;Dim centerLine1 As Centerline = Nothing&lt;BR /&gt;Dim centerline2 As Centerline = Nothing&lt;BR /&gt;centerLine1 = oSheet.Centerlines.AddByWorkFeature(wp1, oDrawingView)&lt;BR /&gt;centerline2 = oSheet.Centerlines.AddByWorkFeature(wp2, oDrawingView)&lt;/P&gt;&lt;P&gt;Dim wInt1 As GeometryIntent = oSheet.CreateGeometryIntent(centerLine1, PointIntentEnum.kStartPointIntent)&lt;BR /&gt;Dim wInt2 As GeometryIntent = oSheet.CreateGeometryIntent(centerline2, PointIntentEnum.kStartPointIntent)&lt;/P&gt;&lt;P&gt;Dim oDimPos As Point2d = oTG.CreatePoint2d(centerLine1.StartPoint.X - 2, centerline2.StartPoint.Y)&lt;/P&gt;&lt;P&gt;Dim oDim As GeneralDimension '= Nothing&lt;BR /&gt;oDim = oSheet.DrawingDimensions.GeneralDimensions.AddLinear(oDimPos, wInt1, wInt2, DimensionTypeEnum.kHorizontalDimensionType)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help is really appreciated.&lt;/P&gt;</description>
    <pubDate>Fri, 14 Aug 2020 09:29:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-08-14T09:29:14Z</dc:date>
    <item>
      <title>Automate general dimension between 2 planes of a sub-assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/automate-general-dimension-between-2-planes-of-a-sub-assembly/m-p/9691223#M59480</link>
      <description>&lt;P&gt;Hello guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm trying to make a code that automates a general dimension between the XY- planes of a subassembly in the idw enviroment&lt;/P&gt;&lt;P&gt;The main assembly has been named: assembly1 and the subassemblies as Test:1 and Test:2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After some googling i found this code, unfortunaly i’m unable to get it to work&lt;/P&gt;&lt;P&gt;&lt;A href="https://forums.autodesk.com/t5/inventor-customization/creating-a-dimension-between-two-workplanes-in-a-drawing/td-p/6840183" target="_blank"&gt;https://forums.autodesk.com/t5/inventor-customization/creating-a-dimension-between-two-workplanes-in-a-drawing/td-p/6840183&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See in the attachments for a visual explanation.&lt;/P&gt;&lt;P&gt;First : No Dimension&lt;/P&gt;&lt;P&gt;Second: The XY Planes of the sub-assemblies&lt;/P&gt;&lt;P&gt;Third: a generated general dimension between the two subassemblies.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the code so far:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Dim oDrawingDocument As DrawingDocument&lt;BR /&gt;oDrawingDocument = ThisApplication.ActiveDocument&lt;BR /&gt;oSheet = ThisApplication.ActiveDocument.ActiveSheet&lt;BR /&gt;oDrawingView = ActiveSheet.View("VIEW11").View&lt;/P&gt;&lt;P&gt;oAssemblyDocument = oDrawingView.ReferencedDocumentDescriptor.ReferencedDocument&lt;BR /&gt;oTG = ThisApplication.TransientGeometry&lt;/P&gt;&lt;P&gt;Dim oOcc As ComponentOccurrence = ThisApplication.ActiveDocument.ReferencedDocuments(1).ComponentDefinition.Occurrences.ItemByName("Test:1")&lt;BR /&gt;Dim oOcc1 As ComponentOccurrence = ThisApplication.ActiveDocument.ReferencedDocuments(1).ComponentDefinition.Occurrences.ItemByName("Test2:2")&lt;/P&gt;&lt;P&gt;Dim wp1 As WorkPlane = oOcc.Definition.WorkPlanes.Item("XY Plane")&lt;BR /&gt;Dim wp2 As WorkPlane = oOcc1.Definition.WorkPlanes.Item("XY Plane")&lt;/P&gt;&lt;P&gt;Dim centerLine1 As Centerline = Nothing&lt;BR /&gt;Dim centerline2 As Centerline = Nothing&lt;BR /&gt;centerLine1 = oSheet.Centerlines.AddByWorkFeature(wp1, oDrawingView)&lt;BR /&gt;centerline2 = oSheet.Centerlines.AddByWorkFeature(wp2, oDrawingView)&lt;/P&gt;&lt;P&gt;Dim wInt1 As GeometryIntent = oSheet.CreateGeometryIntent(centerLine1, PointIntentEnum.kStartPointIntent)&lt;BR /&gt;Dim wInt2 As GeometryIntent = oSheet.CreateGeometryIntent(centerline2, PointIntentEnum.kStartPointIntent)&lt;/P&gt;&lt;P&gt;Dim oDimPos As Point2d = oTG.CreatePoint2d(centerLine1.StartPoint.X - 2, centerline2.StartPoint.Y)&lt;/P&gt;&lt;P&gt;Dim oDim As GeneralDimension '= Nothing&lt;BR /&gt;oDim = oSheet.DrawingDimensions.GeneralDimensions.AddLinear(oDimPos, wInt1, wInt2, DimensionTypeEnum.kHorizontalDimensionType)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Help is really appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 09:29:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/automate-general-dimension-between-2-planes-of-a-sub-assembly/m-p/9691223#M59480</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-14T09:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Automate general dimension between 2 planes of a sub-assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/automate-general-dimension-between-2-planes-of-a-sub-assembly/m-p/9691372#M59481</link>
      <description>&lt;P&gt;I know of another approach to getting those lines to dimension between within your drawing view.&lt;/P&gt;&lt;P&gt;The DrawingView object has a couple of methods that you can use called "GetIncludeStatus", "SetIncludeStatus", "GetVisibility", &amp;amp; "SetVisibility".&lt;/P&gt;&lt;P&gt;You can use the SetIncludeStatus, then the SetVisibility to show the line on your drawing view that represents the plane.&amp;nbsp; Then you can dimension between them.&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 11:50:13 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/automate-general-dimension-between-2-planes-of-a-sub-assembly/m-p/9691372#M59481</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-08-14T11:50:13Z</dc:date>
    </item>
    <item>
      <title>Re: Automate general dimension between 2 planes of a sub-assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/automate-general-dimension-between-2-planes-of-a-sub-assembly/m-p/9691549#M59482</link>
      <description>&lt;P&gt;Thank you very much. You pointed me in the right direction :).&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 14 Aug 2020 13:13:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/automate-general-dimension-between-2-planes-of-a-sub-assembly/m-p/9691549#M59482</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-08-14T13:13:59Z</dc:date>
    </item>
  </channel>
</rss>

