<?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 Projekt Geometry by creating a Sketch  on a View in .idw file.? in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/projekt-geometry-by-creating-a-sketch-on-a-view-in-idw-file/m-p/12203833#M156984</link>
    <description>&lt;P&gt;I am new in VBA coding, and I would like help from community.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a vba or i logic code, to project selected view onto created Sketch and offset it by 5-10 mm.&amp;nbsp; I wanted to automate it a little bit . Can some one help me pls .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Before_Sketch.PNG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1259396i9BD7CCFFE52D8038/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Before_Sketch.PNG" alt="Before_Sketch.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="After Sketch.PNG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1259397i5DA71D078CAAED80/image-size/medium?v=v2&amp;amp;px=400" role="button" title="After Sketch.PNG" alt="After Sketch.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Aug 2023 11:21:43 GMT</pubDate>
    <dc:creator>b.kushaiynov</dc:creator>
    <dc:date>2023-08-29T11:21:43Z</dc:date>
    <item>
      <title>Projekt Geometry by creating a Sketch  on a View in .idw file.?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/projekt-geometry-by-creating-a-sketch-on-a-view-in-idw-file/m-p/12203833#M156984</link>
      <description>&lt;P&gt;I am new in VBA coding, and I would like help from community.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need a vba or i logic code, to project selected view onto created Sketch and offset it by 5-10 mm.&amp;nbsp; I wanted to automate it a little bit . Can some one help me pls .&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Before_Sketch.PNG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1259396i9BD7CCFFE52D8038/image-size/medium?v=v2&amp;amp;px=400" role="button" title="Before_Sketch.PNG" alt="Before_Sketch.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="After Sketch.PNG" style="width: 600px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1259397i5DA71D078CAAED80/image-size/medium?v=v2&amp;amp;px=400" role="button" title="After Sketch.PNG" alt="After Sketch.PNG" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt; &lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 11:21:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/projekt-geometry-by-creating-a-sketch-on-a-view-in-idw-file/m-p/12203833#M156984</guid>
      <dc:creator>b.kushaiynov</dc:creator>
      <dc:date>2023-08-29T11:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Projekt Geometry by creating a Sketch  on a View in .idw file.?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/projekt-geometry-by-creating-a-sketch-on-a-view-in-idw-file/m-p/12204345#M156998</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/13248510"&gt;@b.kushaiynov&lt;/a&gt;.&amp;nbsp; Even though this task seems simple, it is a bit more complicated to get working than it seems.&amp;nbsp; It is fairly easy to create the sketch, and project the geometry, but creating the offset geometry is the tricky part.&amp;nbsp; Below is some iLogic code to get you started.&amp;nbsp; But it was throwing an error in my brief testing for some reason at the line of code which calls the main method (&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=DrawingSketch_OffsetSketchEntitiesUsingDistance" target="_blank" rel="noopener"&gt;OffsetSketchEntitiesUsingDistance&lt;/A&gt;).&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Sub Main
	If ThisDoc.Document.DocumentType &amp;lt;&amp;gt; DocumentTypeEnum.kDrawingDocumentObject Then Exit Sub
	Dim oView As DrawingView = ThisApplication.CommandManager.Pick(SelectionFilterEnum.kDrawingViewFilter, "Select View")
	If oView Is Nothing Then Exit Sub
	Dim oDDoc As DrawingDocument = oView.Parent.Parent
	Dim oTrans = ThisApplication.TransactionManager.StartTransaction(oDDoc, "View Sketch")
	Dim oDCurves As DrawingCurvesEnumerator = oView.DrawingCurves
	Logger.Info("oDCurves.Count = " &amp;amp; oDCurves.Count)
	If oDCurves Is Nothing OrElse oDCurves.Count = 0 Then Exit Sub
	Dim oDSketch As DrawingSketch = oView.Sketches.Add
	Dim oSEsColl As ObjectCollection = ThisApplication.TransientObjects.CreateObjectCollection
	For Each oDCurve As DrawingCurve In oDCurves
		Dim oPSE As SketchEntity = oDSketch.AddByProjectingEntity(oDCurve)
		'Logger.Info("TypeName(oPSE) = " &amp;amp; TypeName(oPSE))
		oSEsColl.Add(oPSE)
	Next 'oDCurve
	Logger.Info("oSEsColl.Count = " &amp;amp; oSEsColl.Count)
	Dim oSEE As SketchEntitiesEnumerator = Nothing
	Try
		oSEE = oDSketch.OffsetSketchEntitiesUsingDistance(oSEsColl, 5, True)
		oTrans.End
	Catch e As Exception
		Logger.Error(e.Message &amp;amp; vbCrLf &amp;amp; e.StackTrace)
		oTrans.Abort
	End Try
End Sub&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Aug 2023 14:46:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/projekt-geometry-by-creating-a-sketch-on-a-view-in-idw-file/m-p/12204345#M156998</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-08-29T14:46:33Z</dc:date>
    </item>
    <item>
      <title>Re: Projekt Geometry by creating a Sketch  on a View in .idw file.?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/projekt-geometry-by-creating-a-sketch-on-a-view-in-idw-file/m-p/12204375#M157000</link>
      <description>&lt;P&gt;Thanks I will try to work with it. It selected view , but doenst created sketch and offset.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 14:55:41 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/projekt-geometry-by-creating-a-sketch-on-a-view-in-idw-file/m-p/12204375#M157000</guid>
      <dc:creator>b.kushaiynov</dc:creator>
      <dc:date>2023-08-29T14:55:41Z</dc:date>
    </item>
    <item>
      <title>Re: Projekt Geometry by creating a Sketch  on a View in .idw file.?</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/projekt-geometry-by-creating-a-sketch-on-a-view-in-idw-file/m-p/12204438#M157001</link>
      <description>&lt;P&gt;Correct.&amp;nbsp; It does not leave anything behind when it fails.&amp;nbsp; That is due to the Transaction I am using within that rule.&amp;nbsp; The Transaction bundles all of those little actions into one item in the UNDO list.&amp;nbsp; If that were not there, you would see potentially a ton of lines of stuff that happened in your UNDO list due to what the code tried to do, and it would take a lot of clicking the UNDO button to undo all of it.&amp;nbsp; The way it is right now, if it fails to create the offset geometry, it will abort that transaction, which undoes all those little actions it has done so far.&amp;nbsp; If you want it to leave the sketch and projected geometry behind when it fails, just comment out (or remove) the "oTrans.Abort" line of code within the Catch side of the Try...Catch block.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Aug 2023 15:11:49 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/projekt-geometry-by-creating-a-sketch-on-a-view-in-idw-file/m-p/12204438#M157001</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2023-08-29T15:11:49Z</dc:date>
    </item>
  </channel>
</rss>

