<?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 Using Named Entities to Automate Dimension using Inventor API. in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-named-entities-to-automate-dimension-using-inventor-api/m-p/13728989#M176148</link>
    <description>&lt;P&gt;Hello Developers,&lt;/P&gt;&lt;P&gt;I’ve recently started working with iLogic and the Inventor API, and I’m currently trying to automate the process of adding drawing dimensions and annotations using named entities—specifically Faces, Edges, and Vertices.&lt;/P&gt;&lt;P&gt;However, I’m facing issues getting the code to work as expected. I suspect I’m missing something fundamental, but I haven’t been able to pinpoint the problem. I’ve attached both the iLogic code and the corresponding Inventor geometry for reference.&lt;/P&gt;&lt;P&gt;I would greatly appreciate it if someone could provide a working example that demonstrates how to use named Faces, Edges, and Vertices to create drawing dimensions using the Inventor API or iLogic.&lt;/P&gt;&lt;LI-CODE lang="visual"&gt;Dim doc = ThisApplication.ActiveDocument
Dim osheet = doc.ActiveSheet
Dim oview = osheet.DrawingViews.Item(1)

' Get the referenced document from the drawing view
Dim refDoc
Try
	refDoc = oview.ReferencedDocumentDescriptor.ReferencedDocument
Catch ex As Exception
	MessageBox.Show("Unable to get referenced document: " &amp;amp; ex.Message)
	Return
End Try

If refDoc Is Nothing Then
	MessageBox.Show("Referenced document not available.")
	Return
End If

' Get named entities from the referenced document
Dim namedEntities
Try
	namedEntities = iLogicVb.Automation.GetNamedEntities(refDoc)
Catch ex As Exception
	MessageBox.Show("Failed to get named entities: " &amp;amp; ex.Message)
	Return
End Try

' Find named entities
Dim ent1 = namedEntities.FindEntity("BottomEdge")
Dim ent2 = namedEntities.FindEntity("TopEdge")

If ent1 Is Nothing Or ent2 Is Nothing Then
	MessageBox.Show("Named entity 'BottomEdge' or 'TopEdge' not found.")
	Return
End If

' Create geometry intents for dimensioning
Dim wp1 = osheet.CreateGeometryIntent(ent1)
Dim wp2 = osheet.CreateGeometryIntent(ent2)

' Set position of dimension
Dim tg = ThisApplication.TransientGeometry
Dim dimpos = tg.CreatePoint2d(oview.Position.X / 2, oview.Position.Y + 1)

' Add linear dimension
osheet.DrawingDimensions.GeneralDimensions.AddLinear(dimpos, wp1, wp2)&lt;/LI-CODE&gt;&lt;P&gt;Thank you in advance for your time and support!&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim doc = ThisApplication.ActiveDocument
Dim osheet = doc.ActiveSheet
Dim oview = osheet.DrawingViews.Item(1)

' Get the referenced document from the drawing view
Dim refDoc
Try
	refDoc = oview.ReferencedDocumentDescriptor.ReferencedDocument
Catch ex As Exception
	MessageBox.Show("Unable to get referenced document: " &amp;amp; ex.Message)
	Return
End Try

If refDoc Is Nothing Then
	MessageBox.Show("Referenced document not available.")
	Return
End If

' Get named entities from the referenced document
Dim namedEntities
Try
	namedEntities = iLogicVb.Automation.GetNamedEntities(refDoc)
Catch ex As Exception
	MessageBox.Show("Failed to get named entities: " &amp;amp; ex.Message)
	Return
End Try

' Find named entities
Dim ent1 = namedEntities.FindEntity("BottomEdge")
Dim ent2 = namedEntities.FindEntity("TopEdge")

If ent1 Is Nothing Or ent2 Is Nothing Then
	MessageBox.Show("Named entity 'BottomEdge' or 'TopEdge' not found.")
	Return
End If

' Create geometry intents for dimensioning
Dim wp1 = osheet.CreateGeometryIntent(ent1)
Dim wp2 = osheet.CreateGeometryIntent(ent2)

' Set position of dimension
Dim tg = ThisApplication.TransientGeometry
Dim dimpos = tg.CreatePoint2d(oview.Position.X / 2, oview.Position.Y + 1)

' Add linear dimension
osheet.DrawingDimensions.GeneralDimensions.AddLinear(dimpos, wp1, wp2)&lt;/LI-CODE&gt;&lt;P&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 17 Jul 2025 12:18:24 GMT</pubDate>
    <dc:creator>basavaraj.bFBQWV</dc:creator>
    <dc:date>2025-07-17T12:18:24Z</dc:date>
    <item>
      <title>Using Named Entities to Automate Dimension using Inventor API.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-named-entities-to-automate-dimension-using-inventor-api/m-p/13728989#M176148</link>
      <description>&lt;P&gt;Hello Developers,&lt;/P&gt;&lt;P&gt;I’ve recently started working with iLogic and the Inventor API, and I’m currently trying to automate the process of adding drawing dimensions and annotations using named entities—specifically Faces, Edges, and Vertices.&lt;/P&gt;&lt;P&gt;However, I’m facing issues getting the code to work as expected. I suspect I’m missing something fundamental, but I haven’t been able to pinpoint the problem. I’ve attached both the iLogic code and the corresponding Inventor geometry for reference.&lt;/P&gt;&lt;P&gt;I would greatly appreciate it if someone could provide a working example that demonstrates how to use named Faces, Edges, and Vertices to create drawing dimensions using the Inventor API or iLogic.&lt;/P&gt;&lt;LI-CODE lang="visual"&gt;Dim doc = ThisApplication.ActiveDocument
Dim osheet = doc.ActiveSheet
Dim oview = osheet.DrawingViews.Item(1)

' Get the referenced document from the drawing view
Dim refDoc
Try
	refDoc = oview.ReferencedDocumentDescriptor.ReferencedDocument
Catch ex As Exception
	MessageBox.Show("Unable to get referenced document: " &amp;amp; ex.Message)
	Return
End Try

If refDoc Is Nothing Then
	MessageBox.Show("Referenced document not available.")
	Return
End If

' Get named entities from the referenced document
Dim namedEntities
Try
	namedEntities = iLogicVb.Automation.GetNamedEntities(refDoc)
Catch ex As Exception
	MessageBox.Show("Failed to get named entities: " &amp;amp; ex.Message)
	Return
End Try

' Find named entities
Dim ent1 = namedEntities.FindEntity("BottomEdge")
Dim ent2 = namedEntities.FindEntity("TopEdge")

If ent1 Is Nothing Or ent2 Is Nothing Then
	MessageBox.Show("Named entity 'BottomEdge' or 'TopEdge' not found.")
	Return
End If

' Create geometry intents for dimensioning
Dim wp1 = osheet.CreateGeometryIntent(ent1)
Dim wp2 = osheet.CreateGeometryIntent(ent2)

' Set position of dimension
Dim tg = ThisApplication.TransientGeometry
Dim dimpos = tg.CreatePoint2d(oview.Position.X / 2, oview.Position.Y + 1)

' Add linear dimension
osheet.DrawingDimensions.GeneralDimensions.AddLinear(dimpos, wp1, wp2)&lt;/LI-CODE&gt;&lt;P&gt;Thank you in advance for your time and support!&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim doc = ThisApplication.ActiveDocument
Dim osheet = doc.ActiveSheet
Dim oview = osheet.DrawingViews.Item(1)

' Get the referenced document from the drawing view
Dim refDoc
Try
	refDoc = oview.ReferencedDocumentDescriptor.ReferencedDocument
Catch ex As Exception
	MessageBox.Show("Unable to get referenced document: " &amp;amp; ex.Message)
	Return
End Try

If refDoc Is Nothing Then
	MessageBox.Show("Referenced document not available.")
	Return
End If

' Get named entities from the referenced document
Dim namedEntities
Try
	namedEntities = iLogicVb.Automation.GetNamedEntities(refDoc)
Catch ex As Exception
	MessageBox.Show("Failed to get named entities: " &amp;amp; ex.Message)
	Return
End Try

' Find named entities
Dim ent1 = namedEntities.FindEntity("BottomEdge")
Dim ent2 = namedEntities.FindEntity("TopEdge")

If ent1 Is Nothing Or ent2 Is Nothing Then
	MessageBox.Show("Named entity 'BottomEdge' or 'TopEdge' not found.")
	Return
End If

' Create geometry intents for dimensioning
Dim wp1 = osheet.CreateGeometryIntent(ent1)
Dim wp2 = osheet.CreateGeometryIntent(ent2)

' Set position of dimension
Dim tg = ThisApplication.TransientGeometry
Dim dimpos = tg.CreatePoint2d(oview.Position.X / 2, oview.Position.Y + 1)

' Add linear dimension
osheet.DrawingDimensions.GeneralDimensions.AddLinear(dimpos, wp1, wp2)&lt;/LI-CODE&gt;&lt;P&gt;.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 17 Jul 2025 12:18:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-named-entities-to-automate-dimension-using-inventor-api/m-p/13728989#M176148</guid>
      <dc:creator>basavaraj.bFBQWV</dc:creator>
      <dc:date>2025-07-17T12:18:24Z</dc:date>
    </item>
    <item>
      <title>Re: Using Named Entities to Automate Dimension using Inventor API.</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/using-named-entities-to-automate-dimension-using-inventor-api/m-p/13746680#M176350</link>
      <description>&lt;P&gt;I created an idw and added a first view with your model. Then I added the following iLogic rule to the idw:&lt;/P&gt;
&lt;LI-CODE lang="visual"&gt;Dim Sheet_1 = ThisDrawing.Sheets.ItemByName("Sheet:1")
Dim VIEW1 = Sheet_1.DrawingViews.ItemByName("VIEW1")

Dim namedGeometry1 = VIEW1.GetIntent("BackFace")
Dim namedGeometry2 = VIEW1.GetIntent("FrontFace")

Dim genDims = Sheet_1.DrawingDimensions.GeneralDimensions

ThisDrawing.BeginManage()
If True Then 
	Dim linDim1 = genDims.AddLinear("Dimension 1", VIEW1.SheetPoint(1.1, 0.5), namedGeometry1)
	Dim linDim2 = genDims.AddLinear("Dimension 2", VIEW1.SheetPoint(-0.1, 0.5), namedGeometry2)
	Dim linDim3 = genDims.AddLinear("Dimension 3", VIEW1.SheetPoint(0.5, 1.2), namedGeometry1, namedGeometry2)
End If
ThisDrawing.EndManage()&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;This is the result:&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="JelteDeJong_0-1753888868793.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1557165iABE34E3B66442EE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="JelteDeJong_0-1753888868793.png" alt="JelteDeJong_0-1753888868793.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Jul 2025 15:21:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/using-named-entities-to-automate-dimension-using-inventor-api/m-p/13746680#M176350</guid>
      <dc:creator>JelteDeJong</dc:creator>
      <dc:date>2025-07-30T15:21:27Z</dc:date>
    </item>
  </channel>
</rss>

