<?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: Rule works for editing a part &amp;amp; need it to work when editing a part from the assembly in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361836#M160063</link>
    <description>&lt;P&gt;Thats good.&lt;/P&gt;&lt;P&gt;Its getting stuck on picking up the &amp;lt;G_H&amp;gt; parameter from the selected part.&lt;/P&gt;&lt;P&gt;I thought it'd work with one of occ/partDef/partDoc but I must be using it incorrectly in&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;occ&lt;/SPAN&gt;, &lt;SPAN&gt;"G_H"&lt;/SPAN&gt;) &amp;gt;20 &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;groove_depth&lt;/SPAN&gt; = 1.42&lt;/PRE&gt;&lt;P&gt;if I use the part name like this..&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"963029 - SCH10 65NB - 200:1"&lt;/SPAN&gt;, &lt;SPAN&gt;"G_H"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;it works fine, but it needs to work whatever the part name is.&lt;/P&gt;</description>
    <pubDate>Wed, 08 Nov 2023 04:33:18 GMT</pubDate>
    <dc:creator>Rich-T</dc:creator>
    <dc:date>2023-11-08T04:33:18Z</dc:date>
    <item>
      <title>Rule works for editing a part &amp; need it to work when editing a part from the assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12347786#M159775</link>
      <description>&lt;P&gt;I have some code (below) to add a groove to a selected pipe end.&lt;/P&gt;&lt;P&gt;It works when editing the part but I want to be able to edit the part from within an assembly and have the rule work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;so the work flow is - when doing a pipework assembly you decide to add a groove to a piece of pipe, double click to edit the part and run the rule.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'd be grateful for any help you can offer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;'Check if active document is a Part document&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;partDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveEditDocument&lt;/SPAN&gt;

&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN&gt;DocumentType&lt;/SPAN&gt; = &lt;SPAN&gt;kPartDocumentObject&lt;/SPAN&gt; &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;'checks is active doc is a part doc&lt;/SPAN&gt;
	
	&lt;SPAN&gt;'working code&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oFace&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;CommandManager&lt;/SPAN&gt;.&lt;SPAN&gt;Pick&lt;/SPAN&gt;(&lt;SPAN&gt;Inventor&lt;/SPAN&gt;.&lt;SPAN&gt;SelectionFilterEnum&lt;/SPAN&gt;.&lt;SPAN&gt;kPartFacePlanarFilter&lt;/SPAN&gt;, &lt;SPAN&gt;"Pick Planar Face"&lt;/SPAN&gt;)
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPlane&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;WorkPlane&lt;/SPAN&gt;
	&lt;SPAN&gt;Offset&lt;/SPAN&gt; = (-15.88 / 10) &lt;SPAN&gt;'offset of groove start from end of Pipe, convert units to mm&lt;/SPAN&gt;
	&lt;SPAN&gt;oPlane&lt;/SPAN&gt; = &lt;SPAN&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Workplanes&lt;/SPAN&gt;.&lt;SPAN&gt;AddByPlaneAndOffset&lt;/SPAN&gt;(&lt;SPAN&gt;oFace&lt;/SPAN&gt;, (&lt;SPAN&gt;Offset&lt;/SPAN&gt;)) 'this is where the error is flagged

	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSketch&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PlanarSketch&lt;/SPAN&gt;
	&lt;SPAN&gt;oSketch&lt;/SPAN&gt; = &lt;SPAN&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;Sketches&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;oPlane&lt;/SPAN&gt;, &lt;SPAN&gt;False&lt;/SPAN&gt;)

	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCompdef&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;PartComponentDefinition&lt;/SPAN&gt;
	&lt;SPAN&gt;oCompdef&lt;/SPAN&gt; = &lt;SPAN&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;

	&lt;SPAN&gt;cent&lt;/SPAN&gt; = &lt;SPAN&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN&gt;AddByProjectingEntity&lt;/SPAN&gt;(&lt;SPAN&gt;oCompdef&lt;/SPAN&gt;.&lt;SPAN&gt;WorkPoints&lt;/SPAN&gt;.&lt;SPAN&gt;Item&lt;/SPAN&gt;(&lt;SPAN&gt;"Center Point"&lt;/SPAN&gt;))

	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCircle&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SketchCircle&lt;/SPAN&gt;

	&lt;SPAN&gt;'create inner circle&lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"G_H"&lt;/SPAN&gt;) &amp;gt;20 &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;groove_depth&lt;/SPAN&gt; = 1.42
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"G_H"&lt;/SPAN&gt;) &amp;gt;27 &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;groove_depth&lt;/SPAN&gt; = 1.6
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"G_H"&lt;/SPAN&gt;) &amp;gt;61 &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;groove_depth&lt;/SPAN&gt; = 1.98
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"G_H"&lt;/SPAN&gt;) &amp;gt;101 &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;groove_depth&lt;/SPAN&gt; = 2.11

	&lt;SPAN&gt;'set circle radii&lt;/SPAN&gt;
	&lt;SPAN&gt;OuterCircleRad&lt;/SPAN&gt; = (&lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"G_H"&lt;/SPAN&gt;) / 2)
	&lt;SPAN&gt;InnerCircleRad&lt;/SPAN&gt; = (&lt;SPAN&gt;OuterCircleRad&lt;/SPAN&gt; - &lt;SPAN&gt;groove_depth&lt;/SPAN&gt;)

	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCircle1&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SketchCircle&lt;/SPAN&gt; = &lt;SPAN&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN&gt;SketchCircles&lt;/SPAN&gt;.&lt;SPAN&gt;AddByCenterRadius&lt;/SPAN&gt;(&lt;SPAN&gt;cent&lt;/SPAN&gt;, (&lt;SPAN&gt;OuterCircleRad&lt;/SPAN&gt; / 10)) &lt;SPAN&gt;'Outer circle, convert units to mm&lt;/SPAN&gt;
	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oCircle2&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SketchCircle&lt;/SPAN&gt; = &lt;SPAN&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN&gt;SketchCircles&lt;/SPAN&gt;.&lt;SPAN&gt;AddByCenterRadius&lt;/SPAN&gt;(&lt;SPAN&gt;cent&lt;/SPAN&gt;, (&lt;SPAN&gt;InnerCircleRad&lt;/SPAN&gt; / 10)) &lt;SPAN&gt;'inner circle, convert units to mm&lt;/SPAN&gt;

	&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oProfile&lt;/SPAN&gt; = &lt;SPAN&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN&gt;Profiles&lt;/SPAN&gt;.&lt;SPAN&gt;AddForSolid&lt;/SPAN&gt;

	&lt;SPAN&gt;oExtruderDef&lt;/SPAN&gt; = &lt;SPAN&gt;oCompdef&lt;/SPAN&gt;.&lt;SPAN&gt;Features&lt;/SPAN&gt;.&lt;SPAN&gt;ExtrudeFeatures&lt;/SPAN&gt;.&lt;SPAN&gt;CreateExtrudeDefinition&lt;/SPAN&gt;(&lt;SPAN&gt;oProfile&lt;/SPAN&gt;, &lt;SPAN&gt;kCutOperation&lt;/SPAN&gt;)

	&lt;SPAN&gt;' set groove width to suit pipe dia      &lt;/SPAN&gt;
	&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"G_H"&lt;/SPAN&gt;) &amp;gt; 48.3 &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;GrooveCut&lt;/SPAN&gt; = 8.74 &lt;SPAN&gt;Else&lt;/SPAN&gt; &lt;SPAN&gt;GrooveCut&lt;/SPAN&gt; = 7.14

&lt;SPAN&gt;oExtruderDef&lt;/SPAN&gt;.&lt;SPAN&gt;SetDistanceExtent&lt;/SPAN&gt;((&lt;SPAN&gt;GrooveCut&lt;/SPAN&gt; / 10), &lt;SPAN&gt;kNegativeExtentDirection&lt;/SPAN&gt;) &lt;SPAN&gt;'groove width /10 to convert units to mm&lt;/SPAN&gt;
&lt;SPAN&gt;oExtrude&lt;/SPAN&gt; = &lt;SPAN&gt;oCompdef&lt;/SPAN&gt;.&lt;SPAN&gt;Features&lt;/SPAN&gt;.&lt;SPAN&gt;ExtrudeFeatures&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;oExtruderDef&lt;/SPAN&gt;)

&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;oWorkPlane&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;partDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ComponentDefinition&lt;/SPAN&gt;.&lt;SPAN&gt;WorkPlanes&lt;/SPAN&gt;
	&lt;SPAN&gt;oWorkPlane&lt;/SPAN&gt;.&lt;SPAN&gt;Visible&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt;

&lt;SPAN&gt;Else&lt;/SPAN&gt;
	&lt;SPAN&gt;MessageBox&lt;/SPAN&gt;.&lt;SPAN&gt;Show&lt;/SPAN&gt;(&lt;SPAN&gt;"This iLogic only works on Part Files"&lt;/SPAN&gt;, &lt;SPAN&gt;"VSVQ iLogic"&lt;/SPAN&gt;)
&lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;If&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Nov 2023 22:26:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12347786#M159775</guid>
      <dc:creator>Rich-T</dc:creator>
      <dc:date>2023-11-01T22:26:10Z</dc:date>
    </item>
    <item>
      <title>Re: Rule works for editing a part &amp; need it to work when editing a part from the assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12348300#M159784</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2855153"&gt;@Rich-T&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When working through the assembly all workplanes, sketches,faces etc need to be converted to proxies so in the context of the assembly space and not the part.&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=AssemblyConstraints_AddMateConstraint2_Sample" target="_blank" rel="noopener"&gt;See this constraint example&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=PlanarSketchProxy" target="_blank" rel="noopener"&gt;Sketchproxy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=FaceProxy" target="_blank" rel="noopener"&gt;FaceProxy&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any issues implementing just message back. It takes some trial an error. I have the same thing implemented so can share pieces to help you along. Best to give it a crack yourself first as their is more learning opportunities. Start converting one line at a time and object face.&lt;/P&gt;&lt;P&gt;The pick command will actually give the proxy face as an output so thats easy so next is getting its definition which you can get to from the occurrence&amp;nbsp;&lt;/P&gt;&lt;P&gt;Syntax&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;FaceProxy.&lt;/SPAN&gt;&lt;STRONG&gt;ContainingOccurrence&lt;/STRONG&gt;&lt;SPAN&gt;() As ComponentOccurrence&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Nov 2023 05:49:06 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12348300#M159784</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2023-11-02T05:49:06Z</dc:date>
    </item>
    <item>
      <title>Re: Rule works for editing a part &amp; need it to work when editing a part from the assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12358385#M159999</link>
      <description>&lt;P&gt;Thanks AA, sadly that's not making any sense to me.&lt;/P&gt;&lt;P&gt;I don't understand how to use a faceproxy to create the offset workplane and similar examples I've found are just confusing me.&lt;/P&gt;&lt;P&gt;If you've got any code that might explain it I'd be very grateful.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Nov 2023 21:59:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12358385#M159999</guid>
      <dc:creator>Rich-T</dc:creator>
      <dc:date>2023-11-06T21:59:36Z</dc:date>
    </item>
    <item>
      <title>Re: Rule works for editing a part &amp; need it to work when editing a part from the assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361586#M160058</link>
      <description>&lt;P&gt;Hi &lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2855153"&gt;@Rich-T&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I wasn't able to make my sample I had work mainly because I hadn't created any workplanes for the groove extrusion. In my case I used project geometry and constructed a sketch and use revolve.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Back to your scenario, trying to create a workplane in the part from the assembly environment was coming back with error not supported. The only way through with this method is to open the part itself and create the workplane in the part environment then close the part. This is very doable with the only snag being passing the selected face to the the workplane creation without the user needing to reselect as that would obviously be unproductive. I will give this a shot tomorrow and see what is possible.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 01:02:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361586#M160058</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2023-11-08T01:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Rule works for editing a part &amp; need it to work when editing a part from the assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361594#M160059</link>
      <description>&lt;P&gt;Thanks AA, much appreciated.&lt;/P&gt;&lt;P&gt;Our current workflow is to open the part and apply the grooves directly to the part model.&lt;/P&gt;&lt;P&gt;So its not too big a deal if we can't do it from within the assembly - but it would be awesome if we could.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 01:08:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361594#M160059</guid>
      <dc:creator>Rich-T</dc:creator>
      <dc:date>2023-11-08T01:08:31Z</dc:date>
    </item>
    <item>
      <title>Re: Rule works for editing a part &amp; need it to work when editing a part from the assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361729#M160061</link>
      <description>&lt;P&gt;See below code this was actually easier than I thought. I was missing one crucial piece which was to pass the native face instead of the proxy face to the workplane creation.&amp;nbsp; everything else is as you had it for creation inside the part environment.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How to get the correct face&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim oFaceProxy As FaceProxy = ThisApplication.CommandManager.Pick(Inventor.SelectionFilterEnum.kPartFacePlanarFilter, "Pick Planar Face")

Dim occ As ComponentOccurrence = oFaceProxy.Parent.Parent
Dim partDef As PartComponentDefinition = occ.Definition
Dim partDoc As PartDocument = partDef.Document
Dim oFace As Face = oFaceProxy.NativeObject&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Working Code, I only tested it as far as workplane creation&amp;nbsp; so hopefully every thing else works.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="visual-basic"&gt;Dim oFaceProxy As FaceProxy = ThisApplication.CommandManager.Pick(Inventor.SelectionFilterEnum.kPartFacePlanarFilter, "Pick Planar Face")

Dim occ As ComponentOccurrence = oFaceProxy.Parent.Parent
Dim partDef As PartComponentDefinition = occ.Definition
Dim partDoc As PartDocument = partDef.Document
Dim oFace As Face = oFaceProxy.NativeObject

If partDoc.DocumentType = kPartDocumentObject Then 'checks is active doc is a part doc
	
	Dim oPlane As WorkPlane
	Offset = (-15.88 / 10) 'offset of groove start from end of Pipe, convert units to mm
	oPlane = partDoc.ComponentDefinition.WorkPlanes.AddByPlaneAndOffset(oFace, (Offset)) 'this is where the error is flagged

	Dim oSketch As PlanarSketch
	oSketch = partDoc.ComponentDefinition.Sketches.Add(oPlane, False)

	Dim oCompdef As PartComponentDefinition
	oCompdef = partDoc.ComponentDefinition

	cent = oSketch.AddByProjectingEntity(oCompdef.WorkPoints.Item("Center Point"))

	Dim oCircle As SketchCircle

	'create inner circle
	If Parameter("G_H") &amp;gt;20 Then groove_depth = 1.42
	If Parameter("G_H") &amp;gt;27 Then groove_depth = 1.6
	If Parameter("G_H") &amp;gt;61 Then groove_depth = 1.98
	If Parameter("G_H") &amp;gt;101 Then groove_depth = 2.11

	'set circle radii
	OuterCircleRad = (Parameter("G_H") / 2)
	InnerCircleRad = (OuterCircleRad - groove_depth)

	Dim oCircle1 As SketchCircle = oSketch.SketchCircles.AddByCenterRadius(cent, (OuterCircleRad / 10)) 'Outer circle, convert units to mm
	Dim oCircle2 As SketchCircle = oSketch.SketchCircles.AddByCenterRadius(cent, (InnerCircleRad / 10)) 'inner circle, convert units to mm

	Dim oProfile = oSketch.Profiles.AddForSolid

	oExtruderDef = oCompdef.Features.ExtrudeFeatures.CreateExtrudeDefinition(oProfile, kCutOperation)

	' set groove width to suit pipe dia      
	If Parameter("G_H") &amp;gt; 48.3 Then GrooveCut = 8.74 Else GrooveCut = 7.14

oExtruderDef.SetDistanceExtent((GrooveCut / 10), kNegativeExtentDirection) 'groove width /10 to convert units to mm
oExtrude = oCompdef.Features.ExtrudeFeatures.Add(oExtruderDef)

For Each oWorkPlane In partDoc.ComponentDefinition.WorkPlanes
	oWorkPlane.Visible = False
Next

Else
	MessageBox.Show("This iLogic only works on Part Files", "VSVQ iLogic")
End If&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 03:12:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361729#M160061</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2023-11-08T03:12:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rule works for editing a part &amp; need it to work when editing a part from the assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361836#M160063</link>
      <description>&lt;P&gt;Thats good.&lt;/P&gt;&lt;P&gt;Its getting stuck on picking up the &amp;lt;G_H&amp;gt; parameter from the selected part.&lt;/P&gt;&lt;P&gt;I thought it'd work with one of occ/partDef/partDoc but I must be using it incorrectly in&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;occ&lt;/SPAN&gt;, &lt;SPAN&gt;"G_H"&lt;/SPAN&gt;) &amp;gt;20 &lt;SPAN&gt;Then&lt;/SPAN&gt; &lt;SPAN&gt;groove_depth&lt;/SPAN&gt; = 1.42&lt;/PRE&gt;&lt;P&gt;if I use the part name like this..&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;If&lt;/SPAN&gt; &lt;SPAN&gt;Parameter&lt;/SPAN&gt;(&lt;SPAN&gt;"963029 - SCH10 65NB - 200:1"&lt;/SPAN&gt;, &lt;SPAN&gt;"G_H"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;it works fine, but it needs to work whatever the part name is.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 04:33:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361836#M160063</guid>
      <dc:creator>Rich-T</dc:creator>
      <dc:date>2023-11-08T04:33:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rule works for editing a part &amp; need it to work when editing a part from the assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361866#M160064</link>
      <description>&lt;P&gt;You can use the below to target the logic parameter. This might fail if the level is too deep.&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;occ.Name&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;You can also use the API method directly for parameters&lt;A href="https://help.autodesk.com/view/INVNTOR/2022/ENU/?guid=PartComponentDefinition_Parameters" target="_blank" rel="noopener"&gt; see help page here.&amp;nbsp;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Pay attention to the value returned in case its in cm and not your document units.&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Dim paramValue As Double = partDef.Parameters.Item("G_H").Value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 04:53:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361866#M160064</guid>
      <dc:creator>A.Acheson</dc:creator>
      <dc:date>2023-11-08T04:53:35Z</dc:date>
    </item>
    <item>
      <title>Re: Rule works for editing a part &amp; need it to work when editing a part from the assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361875#M160065</link>
      <description>&lt;P&gt;"occ.Name" did the trick.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its always so clear once you see it.&lt;/P&gt;&lt;P&gt;Thanks AA - much appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 08 Nov 2023 05:01:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/rule-works-for-editing-a-part-amp-need-it-to-work-when-editing-a/m-p/12361875#M160065</guid>
      <dc:creator>Rich-T</dc:creator>
      <dc:date>2023-11-08T05:01:54Z</dc:date>
    </item>
  </channel>
</rss>

