<?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: Trying to generate workpoints using named geometry in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583721#M62009</link>
    <description>&lt;P&gt;I tried what you suggested and it does not like any combination.&amp;nbsp; Honestly I have about come to the conclusion that named geometry is just not the way to go here.&amp;nbsp; Maybe I should just try a "for each" loop, if I can find where those faces exist.&lt;/P&gt;</description>
    <pubDate>Tue, 16 Jun 2020 21:14:19 GMT</pubDate>
    <dc:creator>jessey9X6M8</dc:creator>
    <dc:date>2020-06-16T21:14:19Z</dc:date>
    <item>
      <title>Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9580814#M61999</link>
      <description>&lt;P&gt;I am trying to use iLogic to generate an array of workpoints on the hull of a tugboat (to export heights to an Excel sheet indexed by x,y coordinates), but I keep getting the following error message:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Error in rule: Generate_WPoints, in document: Hull Shape.ipt

Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.Face'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{5DF8608B-6B16-11D3-B794-0060B0F159EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).&lt;/LI-CODE&gt;&lt;P&gt;and under "More Info":&lt;/P&gt;&lt;LI-CODE lang="general"&gt;System.InvalidCastException: Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.Face'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{5DF8608B-6B16-11D3-B794-0060B0F159EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).
   at ThisRule.Main()
   at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
   at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think it has something to do with the named geometry I am trying to use.&amp;nbsp; I have a surface model of the hull, which includes 15 surfaces that I have named Hull0 - Hull14.&amp;nbsp; I have written one rule to generate a grid of vertical workplanes and another to generate work axes at the intersections of the workplanes, each guided by parameters for overall width and length, along with the desired mesh size.&amp;nbsp; That brings us to the code in question. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;	'Set up variables for the current part document and its components.
Dim oDoc As PartDocument = ThisApplication.ActiveDocument
Dim oDef As PartComponentDefinition = ThisDoc.Document.ComponentDefinition
	'This line is necessary to work with named geometry.
Dim oNames As NamedEntities = iLogicVb.Automation.GetNamedEntities(oDoc)
	'These variables are to intersect axes with surfaces to generate points.
Dim oPoint As WorkPoint
Dim oAxis As WorkAxis
Dim oHull As Face
	'Define and initialize incrementing variables starting at FWD Port corner.
Dim X, Y As Integer
X = 0
Y = -1 * Mesh * Floor(OAW / Mesh / 2) / (1 in)
	'Increment through all existing work axes.  Find which, if any, hull surface
	'each axis intersects with, create a workpoint there, and name it.
While Y &amp;lt;= OAW / (2 in)
	X = 0
	While X &amp;lt;= OAL / (1 in)
		oAxis = oDef.WorkAxes.Item("Axis_" &amp;amp; CStr(X) &amp;amp; "_" &amp;amp; CStr(Y))
		For k = 0 To 14
			oHull = oNames.FindEntity("Hull" &amp;amp; CStr(k))
			oPoint = oDef.WorkPoints.AddByCurveAndEntity(oHull, oAxis)
			oPoint.Name = "Point_" &amp;amp; CStr(X) &amp;amp; "_" &amp;amp; CStr(Y)
		Next
		X = X + Mesh / (1 in)
	End While
	Y = Y + Mesh / (1 in)
End While&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I would greatly appreciate the silver bullet for the error in this code.&amp;nbsp; However, I would just as heartily welcome any constructive suggestions improving my workflow.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 18:04:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9580814#M61999</guid>
      <dc:creator>jessey9X6M8</dc:creator>
      <dc:date>2020-06-15T18:04:33Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9580872#M62000</link>
      <description>&lt;P&gt;I take it this is a local rule (saved within the part file), and not an external rule right?&lt;/P&gt;&lt;P&gt;And that "Mesh" &amp;amp; "OAW" are local Parameters (within this part file)?&lt;/P&gt;&lt;P&gt;I'm not quite understanding some of your math.&amp;nbsp; Why would you divide any number by (1 in)?&lt;/P&gt;&lt;P&gt;Are you aware that all raw numbers within the code environment, that are representing measurements, are understood as centimeters?&amp;nbsp; If you are trying to use Inches, you will have to multiply your numbers by 2.54.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 18:29:16 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9580872#M62000</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-15T18:29:16Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9580885#M62001</link>
      <description>&lt;P&gt;Correct.&amp;nbsp; This is a local rule.&amp;nbsp; OAL and OAW are driven paramaters for overall length and width, and Mesh is a user parameter.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;All parameters are measured in inches, so dividing by 1 inch serves to make the values dimensionless.&amp;nbsp; In the rules that generate workplanes and axes, the centimeter default is taken into account.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The origin of the coordinate system is centered at the forward end of the vessel with a height that can be regarded as arbitrary but below the entire hull.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 18:39:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9580885#M62001</guid>
      <dc:creator>jessey9X6M8</dc:creator>
      <dc:date>2020-06-15T18:39:18Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9580924#M62002</link>
      <description>&lt;P&gt;Maybe try defining oHull as a SurfaceBody instead of a Face, and see if that works.&amp;nbsp; You said the model had 15 surfaces.&amp;nbsp; Do you mean that at the top of the Model browser pane, there is a folder named Surface Bodies with a count of 15 in it?&amp;nbsp; If so, this change might work.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 18:56:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9580924#M62002</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-15T18:56:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9580949#M62003</link>
      <description>&lt;P&gt;Unfortunately, the model has only 1 surface body, comprising 15 surface faces.&lt;/P&gt;</description>
      <pubDate>Mon, 15 Jun 2020 19:06:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9580949#M62003</guid>
      <dc:creator>jessey9X6M8</dc:creator>
      <dc:date>2020-06-15T19:06:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9582950#M62004</link>
      <description>&lt;P&gt;Again, I am fairly certain that the issue lies in referencing the named geometry.&amp;nbsp; I have not been able to find any conclusive documentation on the syntax dealing with this newish feature.&amp;nbsp; If anyone has some special insight into named geometry in iLogic, I am all ears.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 15:54:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9582950#M62004</guid>
      <dc:creator>jessey9X6M8</dc:creator>
      <dc:date>2020-06-16T15:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9582978#M62005</link>
      <description>&lt;P&gt;Instead of oNames.FindEntity(), try oNames.Entities.Item("Hull" &amp;amp; CStr(k)), or oNames.Entities.Value("Hull" &amp;amp; CStr(k)).&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 16:09:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9582978#M62005</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-16T16:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583000#M62006</link>
      <description>&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5963938"&gt;@jessey9X6M8&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And if that doesn't work, try just creating a simple local rule (to test with) and use the same first 3 lines of code to get the NamedEntities, then use one of those last suggestions, but instead of a combined string with the CStr(k), just type the whole name in, the way it should be.&amp;nbsp; Then just use a MsgBox() or something similar to display something about that specific item.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 16:14:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583000#M62006</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2020-06-16T16:14:37Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583529#M62007</link>
      <description>&lt;P&gt;As a pre-note the Inventor API says&amp;nbsp;&lt;STRONG&gt;AddByCurveAndEntity doesn't currently work when creating workpoints in an assembly, not sure if this affects you or not.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Based on your error I think I may have a solution. The NamedEntities.FindEntity function returns a generic object while your oHull is defined as a Face. &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;A href="https://help.autodesk.com/cloudhelp/2019/RUS/Inventor-iLogic/iLogic_API/html/e19ead93-b7b2-5fd2-02f4-0d987167df6e.htm" target="_blank" rel="noopener"&gt;Found here&lt;/A&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Your error basically says it can't make an Object into a Face, So I would suggest defining oHull as Object instead.&lt;/STRONG&gt;&lt;/P&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>Tue, 16 Jun 2020 19:48:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583529#M62007</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-16T19:48:49Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583717#M62008</link>
      <description>&lt;P&gt;Fortunately, I am working in a part.&amp;nbsp; I checked the process manually before coding, and generating points in this way works.&amp;nbsp; I must admit, you gave me a bit of a scare for a moment.&amp;nbsp; That would have dead-ended my code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried as an object, and it still erred.&amp;nbsp; Admittedly, the error is different, but it still won't run.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 21:11:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583717#M62008</guid>
      <dc:creator>jessey9X6M8</dc:creator>
      <dc:date>2020-06-16T21:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583721#M62009</link>
      <description>&lt;P&gt;I tried what you suggested and it does not like any combination.&amp;nbsp; Honestly I have about come to the conclusion that named geometry is just not the way to go here.&amp;nbsp; Maybe I should just try a "for each" loop, if I can find where those faces exist.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 21:14:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583721#M62009</guid>
      <dc:creator>jessey9X6M8</dc:creator>
      <dc:date>2020-06-16T21:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583759#M62010</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5963938"&gt;@jessey9X6M8&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Could you attach your ipt? (or a similar example if the ipt in question is confidential) &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 21:34:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583759#M62010</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-06-16T21:34:19Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583787#M62011</link>
      <description>&lt;P&gt;I think it is sufficiently stripped down that we can work on it here.&amp;nbsp; Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The idea is to get a set of heights indexed by x and y that can be exported to a spreadsheet.&lt;/P&gt;</description>
      <pubDate>Tue, 16 Jun 2020 22:00:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9583787#M62011</guid>
      <dc:creator>jessey9X6M8</dc:creator>
      <dc:date>2020-06-16T22:00:59Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9584269#M62012</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/5963938"&gt;@jessey9X6M8&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunatley I'm still running Inventor 2020 at the time being, so I couldn't open your part properly with all the axes, parameters etc. I should have thought of that. I still think It's good though that the part is attached in the thread so other people can use it to debug your code &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If I understand correctly you want a bunch of points representing your shape. Since I cannot see the axes you intend to use while creating these points I can't see the logic regarding their placement, so this suggestion might not at all be what you're looking for. But anyways, what are your thoughts on something like this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;nrOfPoints&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Integer&lt;/SPAN&gt; = 3 &lt;SPAN style="color: #808080;"&gt;'Nr of points/edge&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSurf&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;WorkSurface&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;WorkSurfaces&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSurfBod&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;SurfaceBody&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSurf&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SurfaceBodies&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oEdge&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Edge&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSurfBod&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Edges&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oEvaluator&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oEdge&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Evaluator&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oMinP&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oMaxP&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt; 
			&lt;SPAN style="color: #800000;"&gt;oEvaluator&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetParamExtents&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oMinP&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oMaxP&lt;/SPAN&gt;)

			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;dLen&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oEvaluator&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetLengthAtParam&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oMinP&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oMaxP&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;dLen&lt;/SPAN&gt;)
			
			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;dInc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;dInc&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;dLen&lt;/SPAN&gt; / &lt;SPAN style="color: #800000;"&gt;nrOfPoints&lt;/SPAN&gt;        
			
			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;dLenInc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;dLenInc&lt;/SPAN&gt; = 0

			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;dparams&lt;/SPAN&gt;(0) &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;dparams&lt;/SPAN&gt;(0) = &lt;SPAN style="color: #800000;"&gt;oMinP&lt;/SPAN&gt;
			
			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCnt&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Integer&lt;/SPAN&gt;

			&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCnt&lt;/SPAN&gt; = 0 &lt;SPAN style="color: #ff0000;"&gt;To&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;nrOfPoints&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;dParam&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oEvaluator&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetParamAtLength&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oMinP&lt;/SPAN&gt;,
				&lt;SPAN style="color: #800000;"&gt;dInc&lt;/SPAN&gt; * &lt;SPAN style="color: #800000;"&gt;iCnt&lt;/SPAN&gt;,
				&lt;SPAN style="color: #800000;"&gt;dParam&lt;/SPAN&gt;)
				
				&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;dPts&lt;/SPAN&gt;(1) &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
				&lt;SPAN style="color: #800000;"&gt;dparams&lt;/SPAN&gt;(0) = &lt;SPAN style="color: #800000;"&gt;dParam&lt;/SPAN&gt;
				
				&lt;SPAN style="color: #800000;"&gt;oEvaluator&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetPointAtParam&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;dparams&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;dPts&lt;/SPAN&gt;)
				
				&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;WorkPoints&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddFixed&lt;/SPAN&gt;(&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;dPts&lt;/SPAN&gt;(0), &lt;SPAN style="color: #800000;"&gt;dPts&lt;/SPAN&gt;(1), &lt;SPAN style="color: #800000;"&gt;dPts&lt;/SPAN&gt;(2)))

			&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;This code uses all the edges of the surfaces and creates a specified number of points evenly divided along each edge.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 06:46:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9584269#M62012</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-06-17T06:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9584322#M62013</link>
      <description>&lt;P&gt;The code I just posted creates a lot of duplicate points. This is better.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;nrOfPoints&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Integer&lt;/SPAN&gt; = 3
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;PartDocument&lt;/SPAN&gt; = &lt;SPAN style="color: #800080;"&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800080;"&gt;Document&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPoints&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;New&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;List&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;Of&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;)
&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSurf&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;WorkSurface&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;WorkSurfaces&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSurfBod&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;SurfaceBody&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSurf&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;SurfaceBodies&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Each&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oEdge&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;Edge&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;In&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oSurfBod&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Edges&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oEvaluator&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;oEdge&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Evaluator&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oMinP&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oMaxP&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;oEvaluator&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetParamExtents&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oMinP&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oMaxP&lt;/SPAN&gt;)

			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;dLen&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oEvaluator&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetLengthAtParam&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oMinP&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;oMaxP&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;dLen&lt;/SPAN&gt;)

			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;dInc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;dInc&lt;/SPAN&gt; = &lt;SPAN style="color: #800000;"&gt;dLen&lt;/SPAN&gt; / &lt;SPAN style="color: #800000;"&gt;nrOfPoints&lt;/SPAN&gt;

			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;dLenInc&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;dLenInc&lt;/SPAN&gt; = 0

			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;dparams&lt;/SPAN&gt;(0) &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
			&lt;SPAN style="color: #800000;"&gt;dparams&lt;/SPAN&gt;(0) = &lt;SPAN style="color: #800000;"&gt;oMinP&lt;/SPAN&gt;

			&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCnt&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Integer&lt;/SPAN&gt;

			&lt;SPAN style="color: #ff0000;"&gt;For&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;iCnt&lt;/SPAN&gt; = 0 &lt;SPAN style="color: #ff0000;"&gt;To&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;nrOfPoints&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;dParam&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
				&lt;SPAN style="color: #ff0000;"&gt;Call&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oEvaluator&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetParamAtLength&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;oMinP&lt;/SPAN&gt;,
				&lt;SPAN style="color: #800000;"&gt;dInc&lt;/SPAN&gt; * &lt;SPAN style="color: #800000;"&gt;iCnt&lt;/SPAN&gt;,
				&lt;SPAN style="color: #800000;"&gt;dParam&lt;/SPAN&gt;)

				&lt;SPAN style="color: #ff0000;"&gt;Dim&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;dPts&lt;/SPAN&gt;(1) &lt;SPAN style="color: #ff0000;"&gt;As&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;Double&lt;/SPAN&gt;
				&lt;SPAN style="color: #800000;"&gt;dparams&lt;/SPAN&gt;(0) = &lt;SPAN style="color: #800000;"&gt;dParam&lt;/SPAN&gt;

				&lt;SPAN style="color: #800000;"&gt;oEvaluator&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;GetPointAtParam&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;dparams&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;dPts&lt;/SPAN&gt;)
				&lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt; &lt;SPAN style="color: #800000;"&gt;oPoints&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Contains&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Format&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"{0};{1};{2}"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;dPts&lt;/SPAN&gt;(0).&lt;SPAN style="color: #800000;"&gt;ToString&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;dpts&lt;/SPAN&gt;(1).&lt;SPAN style="color: #800000;"&gt;ToString&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;dpts&lt;/SPAN&gt;(2).&lt;SPAN style="color: #800000;"&gt;ToString&lt;/SPAN&gt;)) = &lt;SPAN style="color: #ff0000;"&gt;False&lt;/SPAN&gt;
					&lt;SPAN style="color: #800000;"&gt;oDoc&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;WorkPoints&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;AddFixed&lt;/SPAN&gt;(&lt;SPAN style="color: #800080;"&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;CreatePoint&lt;/SPAN&gt;(&lt;SPAN style="color: #800000;"&gt;dPts&lt;/SPAN&gt;(0), &lt;SPAN style="color: #800000;"&gt;dPts&lt;/SPAN&gt;(1), &lt;SPAN style="color: #800000;"&gt;dPts&lt;/SPAN&gt;(2)))
					&lt;SPAN style="color: #800000;"&gt;oPoints&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Add&lt;/SPAN&gt;(&lt;SPAN style="color: #ff0000;"&gt;String&lt;/SPAN&gt;.&lt;SPAN style="color: #800000;"&gt;Format&lt;/SPAN&gt;(&lt;SPAN style="color: #008080;"&gt;"{0};{1};{2}"&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;dPts&lt;/SPAN&gt;(0).&lt;SPAN style="color: #800000;"&gt;ToString&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;dpts&lt;/SPAN&gt;(1).&lt;SPAN style="color: #800000;"&gt;ToString&lt;/SPAN&gt;, &lt;SPAN style="color: #800000;"&gt;dpts&lt;/SPAN&gt;(2).&lt;SPAN style="color: #800000;"&gt;ToString&lt;/SPAN&gt;))
				&lt;SPAN style="color: #ff0000;"&gt;End&lt;/SPAN&gt; &lt;SPAN style="color: #ff0000;"&gt;If&lt;/SPAN&gt;
			&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
		&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
	&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;
&lt;SPAN style="color: #ff0000;"&gt;Next&lt;/SPAN&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 17 Jun 2020 07:29:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9584322#M62013</guid>
      <dc:creator>JhoelForshav</dc:creator>
      <dc:date>2020-06-17T07:29:36Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9585607#M62014</link>
      <description>&lt;P&gt;Thank you for your reply.&amp;nbsp; I tried your code.&amp;nbsp; As advertised, it generates points along the edges.&amp;nbsp; What I need is basically a projection of a rectangular grid of points from the XY Plane onto the hull surface.&amp;nbsp; Then I will measure the distance of each point to the hull, export the array of heights to Excel, and use it in another assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;By the way, I found an old copy of the hull in a 2019 format and rewrote the first couple of rules, if you are still interested.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 16:58:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9585607#M62014</guid>
      <dc:creator>jessey9X6M8</dc:creator>
      <dc:date>2020-06-17T16:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9585867#M62015</link>
      <description>&lt;P&gt;Can you share the error you got when you tried oHull as an object?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also if we can't figure out how to get the faces from the NamedEntities, you should be able to define them from the surface body. Maybe something like this:&lt;/P&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;&lt;LI-CODE lang="general"&gt;Dim oFaceCol as FaceCollection = oApp.TransientObjects.CreateFaceCollection
Dim oSurf as SurfaceBody = oDef.SurfaceBodies.Item(0)

For i = 0 to 14
Dim oFace as Face = oSurf.Faces.Item(i)
oFaceCol.Add(oFace)
Next&lt;/LI-CODE&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;&lt;P&gt;This is assuming the first 15 faces in the surface body are the ones you need. If not, I'm not really sure how to identify the index of the faces without some trial and error. But if this does work for you, you should just be able to plug it into your code. (I don't think using a FaceCollection is actually necessary, you could probably use List(Of...) instead, but it seems a bit simpler.)&lt;/P&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;&lt;LI-CODE lang="general"&gt;For k = 0 To 14
			oHull = oFaceCol.Item(k)
			oPoint = oDef.WorkPoints.AddByCurveAndEntity(oHull, oAxis)
			oPoint.Name = "Point_" &amp;amp; CStr(X) &amp;amp; "_" &amp;amp; CStr(Y)
		Next&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 18:51:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9585867#M62015</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-17T18:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9585892#M62016</link>
      <description>&lt;P&gt;Error Message:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Error in rule: Test, in document: Hull Shape.ipt

The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;/LI-CODE&gt;&lt;P&gt;More Info:&lt;/P&gt;&lt;LI-CODE lang="general"&gt;System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)
   at Inventor.WorkPoints.AddByCurveAndEntity(Object Curve, Object Entity, Object ProximityPoint, Boolean Construction)
   at ThisRule.Main()
   at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
   at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, I had a message box show me the number of surface bodies this model has, and it read 0.&amp;nbsp; The body is actually a non-parametric base feature.&amp;nbsp; If I can figure out how to reference it, I will probably just do a "for each" loop.&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 19:00:04 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9585892#M62016</guid>
      <dc:creator>jessey9X6M8</dc:creator>
      <dc:date>2020-06-17T19:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9585941#M62017</link>
      <description>&lt;P&gt;Based on the error it seems the FindEntity isn't finding an entity with your parameters in the NamedEntities collection.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you try a couple tests in your code?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;MsgBox(oName.Entities.Count)

MsgBox(oName.NameExists("Hull0"))

MsgBox(oName.Entities.Name(0))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 19:32:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9585941#M62017</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-17T19:32:06Z</dc:date>
    </item>
    <item>
      <title>Re: Trying to generate workpoints using named geometry</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9586118#M62018</link>
      <description>&lt;P&gt;917&lt;/P&gt;&lt;P&gt;True&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Error in rule: Test, in document: Hull Shape.ipt

The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;More Info:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;System.ArgumentException: The parameter is incorrect. (Exception from HRESULT: 0x80070057 (E_INVALIDARG))
   at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)
   at Inventor.NameValueMap.get_Name(Int32 Index)
   at ThisRule.Main()
   at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)
   at iLogic.RuleEvalContainer.ExecRuleEval(String execRule)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Although replacing the 0 in your last entry with a 1 returned "Hull0".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 20:52:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/trying-to-generate-workpoints-using-named-geometry/m-p/9586118#M62018</guid>
      <dc:creator>jessey9X6M8</dc:creator>
      <dc:date>2020-06-17T20:52:54Z</dc:date>
    </item>
  </channel>
</rss>

