<?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 iLogic flange in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-flange/m-p/6948213#M70876</link>
    <description>&lt;P&gt;All I want to do i create a flange of a certain height and width from a selected edge and stick a hole in the center of the flange. &amp;nbsp;That's it. &amp;nbsp;Is it possible to hotkey an iTrigger to create the flange and hole in one click?&lt;/P&gt;</description>
    <pubDate>Wed, 15 Mar 2017 17:44:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-03-15T17:44:02Z</dc:date>
    <item>
      <title>iLogic flange</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-flange/m-p/6948213#M70876</link>
      <description>&lt;P&gt;All I want to do i create a flange of a certain height and width from a selected edge and stick a hole in the center of the flange. &amp;nbsp;That's it. &amp;nbsp;Is it possible to hotkey an iTrigger to create the flange and hole in one click?&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2017 17:44:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-flange/m-p/6948213#M70876</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-15T17:44:02Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic flange</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-flange/m-p/6948589#M70881</link>
      <description>&lt;P&gt;I think you need at leas two clicks, one to select the edge, the other to activate the command....&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;When you look in the API help, you can find this code (VBA) on how to create a flange.&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;PRE&gt;Public Sub FlangeWidthsCreation()
    &lt;SPAN style="color: blue;"&gt;' Create a new sheet metal document.&lt;/SPAN&gt;
    Dim sheetMetalDoc As PartDocument
    Set sheetMetalDoc = ThisApplication.Documents.Add(kPartDocumentObject, _
                        ThisApplication.FileManager.GetTemplateFile(kPartDocumentObject, , , "{9C464203-9BAE-11D3-8BAD-0060B0CE6BB4}"))

    &lt;SPAN style="color: blue;"&gt;' Get the sheet metal component definition.&lt;/SPAN&gt;
    Dim smCompDef As SheetMetalComponentDefinition
    Set smCompDef = sheetMetalDoc.ComponentDefinition

    &lt;SPAN style="color: blue;"&gt;' Create a sketch on the x-y plane.&lt;/SPAN&gt;
    Dim sketch As PlanarSketch
    Set sketch = smCompDef.Sketches.Add(smCompDef.WorkPlanes.Item(3))

    Dim tg As TransientGeometry
    Set tg = ThisApplication.TransientGeometry

    &lt;SPAN style="color: blue;"&gt;' Draw a rectangle.&lt;/SPAN&gt;
    Call sketch.SketchLines.AddAsTwoPointRectangle(tg.CreatePoint2d(0, 0), tg.CreatePoint2d(25, 15))

    &lt;SPAN style="color: blue;"&gt;' Create a profile.&lt;/SPAN&gt;
    Dim profile As profile
    Set profile = sketch.Profiles.AddForSolid

    Dim smFeatures As SheetMetalFeatures
    Set smFeatures = smCompDef.Features

    &lt;SPAN style="color: blue;"&gt;' Build up a face feature definition.&lt;/SPAN&gt;
    Dim faceDef As FaceFeatureDefinition
    Set faceDef = smFeatures.FaceFeatures.CreateFaceFeatureDefinition(profile)

    &lt;SPAN style="color: blue;"&gt;' Create a face feature.&lt;/SPAN&gt;
    Dim faceFeature As faceFeature
    Set faceFeature = smFeatures.FaceFeatures.Add(faceDef)

    &lt;SPAN style="color: blue;"&gt;' Get the "top" face.&lt;/SPAN&gt;
    Dim topFace As face
    Set topFace = smCompDef.SurfaceBodies.Item(1).LocateUsingPoint(kFaceObject, tg.CreatePoint(5, 5, smCompDef.Thickness.Value))

    &lt;SPAN style="color: blue;"&gt;' Create a collection containing the four edges.&lt;/SPAN&gt;
    Dim edgeSet As EdgeCollection
    Set edgeSet = ThisApplication.TransientObjects.CreateEdgeCollection
    Dim i As Integer
    For i = 1 To 4
        Call edgeSet.Add(topFace.Edges.Item(i))
    Next

    &lt;SPAN style="color: blue;"&gt;' Create the flange definition.&lt;/SPAN&gt;
    Dim flangeDef As FlangeDefinition
    Set flangeDef = smFeatures.FlangeFeatures.CreateFlangeDefinition(edgeSet, "90", 6)

    &lt;SPAN style="color: blue;"&gt;' Edit the definition to define a different width extent for each edge.&lt;/SPAN&gt;
    For i = 1 To 4
        Dim faceEdge As Edge
        Set faceEdge = edgeSet.Item(i)
        Select Case i
            Case 1
                &lt;SPAN style="color: blue;"&gt;' Do nothing and let it default to the edge extent.&lt;/SPAN&gt;
            Case 2
                &lt;SPAN style="color: blue;"&gt;' Edit the width extent to be centered.&lt;/SPAN&gt;
                Call flangeDef.SetCenteredWidthExtent(faceEdge, 10)
            Case 3
                &lt;SPAN style="color: blue;"&gt;' Edit the width extent to be offset as measured from the vertices of the edge.&lt;/SPAN&gt;
                Call flangeDef.SetOffsetWidthExtent(faceEdge, faceEdge.StartVertex, 2, faceEdge.StopVertex, 5)
            Case 4
                &lt;SPAN style="color: blue;"&gt;' Edit the width extent to be an offset width extent.&lt;/SPAN&gt;
                Call flangeDef.SetWidthOffsetWidthExtent(faceEdge, 6, 2, faceEdge.StartVertex, True)
        End Select
    Next

    &lt;SPAN style="color: blue;"&gt;' Create the flange.&lt;/SPAN&gt;
    Call smFeatures.FlangeFeatures.Add(flangeDef)
End Sub&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Mar 2017 19:35:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-flange/m-p/6948589#M70881</guid>
      <dc:creator>HermJan.Otterman</dc:creator>
      <dc:date>2017-03-15T19:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: iLogic flange</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-flange/m-p/6950380#M70905</link>
      <description>&lt;P&gt;I should be able to fumble through that to get what I need. &amp;nbsp;It looks like the code creates a part and face and then cycles through one side of each edge to create the three different types of flanges? &amp;nbsp;What I don't see is how to store a user selected edge for editing.&lt;/P&gt;&lt;P&gt;As a result of some searching, I found the code:&lt;/P&gt;&lt;PRE&gt;    Dim selEdge As Edge 
    selEdge = ThisApplication.CommandManager.Pick(kPartEdgeFilter, "Select edge.")&lt;/PRE&gt;&lt;P&gt;That should be what I need to pair the two. &amp;nbsp;I'll post the code when I get a minute to write it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there any chance someone&amp;nbsp;could post a help code for creating a sheet metal hole? &amp;nbsp;I don't have any access to the api help. &amp;nbsp;If only I could install a free version of VS on my workstation....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Mar 2017 12:50:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/ilogic-flange/m-p/6950380#M70905</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-03-16T12:50:20Z</dc:date>
    </item>
  </channel>
</rss>

