<?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: Delete projected entity in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13649178#M78</link>
    <description>&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;Dim oProjEnt As SketchEntity = oSketchProxy.AddByProjectingEntity(oEntityProxy)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;instead of&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Call oSketchProxy.AddByProjectingEntity(oEntityProxy)&lt;/LI-CODE&gt;&lt;P&gt;and then just delete it after creating hole centers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;oProjEnt.Delete()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 26 May 2025 07:14:56 GMT</pubDate>
    <dc:creator>marcin_otręba</dc:creator>
    <dc:date>2025-05-26T07:14:56Z</dc:date>
    <item>
      <title>Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13645716#M73</link>
      <description>&lt;P&gt;Hi experts,&lt;/P&gt;&lt;P&gt;I am writing a macro to use in assembly environment, to punch a threaded hole by picking edge of drill hole.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tim11_manhhieu_0-1747970520414.png" style="width: 797px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1536396iA5B75D88C209D409/image-dimensions/797x249?v=v2" width="797" height="249" role="button" title="tim11_manhhieu_0-1747970520414.png" alt="tim11_manhhieu_0-1747970520414.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that after creating the threaded hole, there are projected entities left.&lt;/P&gt;&lt;P&gt;I want to delete the yellow sketch circle and yellow sketch point as shown in the image.&lt;/P&gt;&lt;P&gt;iLogic or VBA are both fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="tim11_manhhieu_1-1747970535141.png" style="width: 400px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1536397i0E0AFE0CCA8F8151/image-size/medium?v=v2&amp;amp;px=400" role="button" title="tim11_manhhieu_1-1747970535141.png" alt="tim11_manhhieu_1-1747970535141.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;Option Explicit

Sub XXX()

Dim oAssemDoc As AssemblyDocument
Dim oAssemDef As AssemblyComponentDefinition
Dim oFace As Object
Dim oOcc As ComponentOccurrence
Dim oPartDoc As PartDocument
Dim oPartDef As PartComponentDefinition
Dim oSketch As PlanarSketch
Dim oEntity As Object
Dim oEntityProxy As Object
Dim oSketchProxy As Object
Dim oEntityOcc As ComponentOccurrence
Dim x As Double
Dim y As Double
Dim oHoleCenters As ObjectCollection
Dim oHoleTapInfo As HoleTapInfo
Dim oTransGeom As TransientGeometry
Dim h As HoleFeature

Set oAssemDoc = ThisApplication.ActiveDocument
Set oAssemDef = oAssemDoc.ComponentDefinition

Set oFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Select face on part for new sketch") 
If oFace Is Nothing Then Exit Sub

Set oOcc = oFace.ContainingOccurrence
oOcc.Edit

Set oPartDoc = ThisApplication.ActiveEditDocument
Set oPartDef = oPartDoc.ComponentDefinition

Set oSketch = oPartDef.Sketches.Add(oFace.NativeObject)
oSketch.Edit

Set oEntity = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kAllEntitiesFilter, "Select entity to project")
If oEntity Is Nothing Then Exit Sub

Set oEntityOcc = oEntity.ContainingOccurrence
Call oEntityOcc.CreateGeometryProxy(oEntity, oEntityProxy)

Call oOcc.CreateGeometryProxy(oSketch, oSketchProxy)
Call oSketchProxy.AddByProjectingEntity(oEntityProxy)

oSketch.Adaptive = False

Set oTransGeom = ThisApplication.TransientGeometry

x = oSketch.SketchCircles.item(1).CenterSketchPoint.Geometry.x
y = oSketch.SketchCircles.item(1).CenterSketchPoint.Geometry.y

Set oHoleCenters = ThisApplication.TransientObjects.CreateObjectCollection
Call oHoleCenters.Add(oSketch.SketchPoints.Add(oTransGeom.CreatePoint2d(x, y)))

Set oHoleTapInfo = oPartDef.Features.HoleFeatures.CreateTapInfo(True, "ISO Metric profile", "M6x1", "6H", True)

Set h = oPartDef.Features.HoleFeatures.AddDrilledByThroughAllExtent(oHoleCenters, oHoleTapInfo, kPositiveExtentDirection)

oSketch.ExitEdit
ThisApplication.CommandManager.ControlDefinitions.item("AppReturnTopCmd").Execute

oOcc.Adaptive = False

End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 03:29:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13645716#M73</guid>
      <dc:creator>tim11_manhhieu</dc:creator>
      <dc:date>2025-05-23T03:29:55Z</dc:date>
    </item>
    <item>
      <title>Re: Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13646298#M74</link>
      <description>&lt;P&gt;How to define and keep that definition for the hole feature than?&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 11:22:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13646298#M74</guid>
      <dc:creator>bradeneuropeArthur</dc:creator>
      <dc:date>2025-05-23T11:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13646335#M75</link>
      <description>&lt;P&gt;What about turning the visibility of that sketch off instead.&amp;nbsp; The sketch needs to be there, because the HoleFeature is dependent on it.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=PlanarSketch_Visible" target="_blank" rel="noopener"&gt;PlanarSketch.Visible&lt;/A&gt;&amp;nbsp;= False ('oSketch.Visible = False' in your code example)&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 11:47:57 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13646335#M75</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-05-23T11:47:57Z</dc:date>
    </item>
    <item>
      <title>Re: Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13646425#M76</link>
      <description>&lt;P&gt;Another idea would be to use a WorkPoint as the location of the HoleFeature, instead of a projected sketch.&amp;nbsp; If doing it that way, you could use the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=HoleFeatures_CreatePointPlacementDefinition" target="_blank" rel="noopener"&gt;HoleFeatures.CreatePointPlacementDefinition&lt;/A&gt;&amp;nbsp;method to create a&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-PointHolePlacementDefinition" target="_blank" rel="noopener"&gt;PointHolePlacementDefinition&lt;/A&gt;&amp;nbsp;(uses a WorkPoint to define hole location).&amp;nbsp; We would usually have used the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=HoleFeatures_CreateSketchPlacementDefinition" target="_blank" rel="noopener"&gt;HoleFeatures.CreateSketchPlacementDefinition&lt;/A&gt;&amp;nbsp;to create a&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-SketchHolePlacementDefinition" target="_blank" rel="noopener"&gt;SketchHolePlacementDefinition&lt;/A&gt;&amp;nbsp;when defining the locations of HoleFeatures by way of SketchPoints, but they continue to support the older way of using an ObjectCollection containing SketchPoints also.&amp;nbsp; I would likely be a good idea to use the newer methods in any important future automation solutions though.&amp;nbsp; Just some additional thoughts.&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 12:35:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13646425#M76</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-05-23T12:35:25Z</dc:date>
    </item>
    <item>
      <title>Re: Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13646511#M77</link>
      <description>&lt;P&gt;Alternatively, you can remove reference of the projected item and it will no longer be a projection. The following code will break the reference to the projection and then ground the entity so you aren't left with unconstrained sketches.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;For&lt;/SPAN&gt; &lt;SPAN&gt;Each&lt;/SPAN&gt; &lt;SPAN&gt;sketchEnt&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;SketchEntity&lt;/SPAN&gt; &lt;SPAN&gt;In&lt;/SPAN&gt; &lt;SPAN&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN&gt;SketchEntities&lt;/SPAN&gt;
	&lt;SPAN&gt;sketchEnt&lt;/SPAN&gt;.&lt;SPAN&gt;Reference&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt;
	&lt;SPAN&gt;Try&lt;/SPAN&gt;
		&lt;SPAN&gt;oSketch&lt;/SPAN&gt;.&lt;SPAN&gt;GeometricConstraints&lt;/SPAN&gt;.&lt;SPAN&gt;AddGround&lt;/SPAN&gt;(&lt;SPAN&gt;sketchEnt&lt;/SPAN&gt;)
	&lt;SPAN&gt;Catch&lt;/SPAN&gt; : &lt;SPAN&gt;End&lt;/SPAN&gt; &lt;SPAN&gt;Try&lt;/SPAN&gt;
&lt;SPAN&gt;Next&lt;/SPAN&gt; &lt;SPAN&gt;sketchEnt&lt;/SPAN&gt; &amp;nbsp;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 May 2025 13:19:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13646511#M77</guid>
      <dc:creator>patrick.schlambHPACQ</dc:creator>
      <dc:date>2025-05-23T13:19:49Z</dc:date>
    </item>
    <item>
      <title>Re: Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13649178#M78</link>
      <description>&lt;P&gt;try:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;Dim oProjEnt As SketchEntity = oSketchProxy.AddByProjectingEntity(oEntityProxy)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;instead of&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;Call oSketchProxy.AddByProjectingEntity(oEntityProxy)&lt;/LI-CODE&gt;&lt;P&gt;and then just delete it after creating hole centers:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;oProjEnt.Delete()&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 26 May 2025 07:14:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13649178#M78</guid>
      <dc:creator>marcin_otręba</dc:creator>
      <dc:date>2025-05-26T07:14:56Z</dc:date>
    </item>
    <item>
      <title>Re: Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13652548#M79</link>
      <description>&lt;P&gt;Thank you for response.&lt;/P&gt;&lt;P&gt;They are not dependent on each other, after creating the hole, the hole will depend on the sketch point.&lt;/P&gt;&lt;P&gt;The projected entity can be deleted if we delete all their constraints.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 02:30:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13652548#M79</guid>
      <dc:creator>tim11_manhhieu</dc:creator>
      <dc:date>2025-05-28T02:30:39Z</dc:date>
    </item>
    <item>
      <title>Re: Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13652551#M80</link>
      <description>&lt;P&gt;I'll look into HoleFeatures.CreatePointPlacementDefinition more.&lt;/P&gt;&lt;P&gt;Since I'm almost there, there's only one small issue left.&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 00:30:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13652551#M80</guid>
      <dc:creator>tim11_manhhieu</dc:creator>
      <dc:date>2025-05-28T00:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13652555#M81</link>
      <description>&lt;P&gt;I tried it and it worked, thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;sketchEnt&lt;/SPAN&gt;.&lt;SPAN&gt;Reference&lt;/SPAN&gt; = &lt;SPAN&gt;False&lt;/SPAN&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 02:30:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13652555#M81</guid>
      <dc:creator>tim11_manhhieu</dc:creator>
      <dc:date>2025-05-28T02:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13652557#M82</link>
      <description>&lt;P&gt;Thank you for response. It still error.&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 02:31:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13652557#M82</guid>
      <dc:creator>tim11_manhhieu</dc:creator>
      <dc:date>2025-05-28T02:31:05Z</dc:date>
    </item>
    <item>
      <title>Re: Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13652558#M83</link>
      <description>&lt;P&gt;VBA for who need.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="ruby"&gt;Option Explicit

Sub zzz()

Dim oAssemDoc As AssemblyDocument
Dim oAssemDef As AssemblyComponentDefinition
Dim oFace As Object
Dim oOcc As ComponentOccurrence
Dim oPartDoc As PartDocument
Dim oPartDef As PartComponentDefinition
Dim oSketch As PlanarSketch
Dim oEntity As Object
Dim oEntityProxy As Object
Dim oSketchProxy As Object
Dim oEntityOcc As ComponentOccurrence
Dim x As Double
Dim y As Double
Dim oHoleCenters As ObjectCollection
Dim oHoleTapInfo As HoleTapInfo
Dim oTransGeom As TransientGeometry
Dim h As HoleFeature
Dim oSketchEntity As SketchEntity

Set oAssemDoc = ThisApplication.ActiveDocument
Set oAssemDef = oAssemDoc.ComponentDefinition

Set oFace = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFacePlanarFilter, "Select plane for tap hole: ") 
If oFace Is Nothing Then Exit Sub

Set oOcc = oFace.ContainingOccurrence
oOcc.Edit

Set oPartDoc = ThisApplication.ActiveEditDocument
Set oPartDef = oPartDoc.ComponentDefinition

Set oSketch = oPartDef.Sketches.Add(oFace.NativeObject)
oSketch.Edit

Set oEntity = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kPartFaceCylindricalFilter, "Select drill hole face: ")
If oEntity Is Nothing Then Exit Sub

Set oEntityOcc = oEntity.ContainingOccurrence
Call oEntityOcc.CreateGeometryProxy(oEntity, oEntityProxy)

Call oOcc.CreateGeometryProxy(oSketch, oSketchProxy)
Call oSketchProxy.AddByProjectingEntity(oEntity.Edges.item(1))

oSketch.Adaptive = False

Set oTransGeom = ThisApplication.TransientGeometry

x = oSketch.SketchCircles.item(1).CenterSketchPoint.Geometry.x
y = oSketch.SketchCircles.item(1).CenterSketchPoint.Geometry.y

Set oHoleCenters = ThisApplication.TransientObjects.CreateObjectCollection
Call oHoleCenters.Add(oSketch.SketchPoints.Add(oTransGeom.CreatePoint2d(x, y)))

Set oHoleTapInfo = oPartDef.Features.HoleFeatures.CreateTapInfo(True, "ISO Metric profile", "M6x1", "6H", True)

Set h = oPartDef.Features.HoleFeatures.AddDrilledByThroughAllExtent(oHoleCenters, oHoleTapInfo, kPositiveExtentDirection)

For Each oSketchEntity In oSketch.SketchEntities
    oSketchEntity.Reference = False
Next

oSketch.SketchCircles.item(1).Delete

oOcc.ExitEdit (kExitToTop)

oOcc.Adaptive = False

End Sub&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 28 May 2025 00:41:31 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13652558#M83</guid>
      <dc:creator>tim11_manhhieu</dc:creator>
      <dc:date>2025-05-28T00:41:31Z</dc:date>
    </item>
    <item>
      <title>Re: Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13653685#M84</link>
      <description>&lt;P&gt;I didn't actually say that the hole feature would be dependent on the projected geometry, but rather to the sketch, and did not think it would be wise to delete the sketch.&amp;nbsp; But now I understand you were just talking about breaking the 'projected Link', then deleting just that projected circle, instead of the sketch.&amp;nbsp; I also apparently did not pay close enough attention to one line in your code.&amp;nbsp; Since you are creating a 'new' SketchPoint within the sketch at the same 'location' of the projected circle's center, instead of finding then using the projected center point of the circle itself, that eliminated any dependency on the projected geometry.&amp;nbsp; If you had used the existing projected SketchPoint object to specify the hole feature's location, then deleting the projected sketch geometry would have likely broken the hole feature.&amp;nbsp; Also note that the new SketchPoint that you created is not 'grounded' or constrained in any way yet, so you may want to add that, if it is important.&lt;/P&gt;
&lt;P&gt;Glad to see that you got it working OK.&lt;/P&gt;</description>
      <pubDate>Wed, 28 May 2025 11:45:47 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13653685#M84</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2025-05-28T11:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: Delete projected entity</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13655048#M85</link>
      <description>&lt;P&gt;I have noted that SketchPoint is not dimensionally constrained.&lt;/P&gt;&lt;P&gt;I will manually constrain and that is also my intention.&lt;/P&gt;&lt;P&gt;During the design process, the hole position often has to be changed, so constraining the hole position is something that cannot be ignored.&lt;/P&gt;&lt;P&gt;The operation of punching the threaded hole below often takes a lot of time, so I found a solution for it.&lt;/P&gt;</description>
      <pubDate>Thu, 29 May 2025 00:11:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/delete-projected-entity/m-p/13655048#M85</guid>
      <dc:creator>tim11_manhhieu</dc:creator>
      <dc:date>2025-05-29T00:11:37Z</dc:date>
    </item>
  </channel>
</rss>

