<?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: Sheet Metal Flat Pattern view insert in IDW code in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/3306889#M137693</link>
    <description>&lt;DIV class="lia-decoration-border-top"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="author-role-icon"&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;A target="_self" href="https://forums.autodesk.com/../user/viewprofilepage/user-id/725444"&gt;&lt;SPAN&gt;MegaJerk&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thank you for your code. However, I was not able to make it work in Inventor 2012 Ilogic. I cleaned it up and removed the "SET" statements that are no longer used but I keep getting an error:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;U&gt;"Error in rule: FLAT PATTERN VIEW CREATE IN IDW, in document: FLAT PATTERN VIEW CREATE IN IDW.iLogicVb&lt;/U&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;U&gt;Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.DrawingDocument'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{29F0D467-C114-11D2-B77F-0060B0F159EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).&lt;/U&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;U&gt;The codes I have currently that work and create the formed views of the sheet metal part is as follows:&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;'------------------------start of iLogic code ---------------------&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Imports Inventor.ViewOrientationTypeEnum&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Imports Inventor.DrawingViewStyleEnum&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oDrawingDoc as DrawingDocument&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oPartDoc as Document&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oSheet As sheet&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oTG As TransientGeometry&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oView1 as DrawingView&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oView2 as DrawingView&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oView3 as DrawingView&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oView4 as DrawingView&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;'GET SHEET METAL FLAT PATTERN EXTENTS LENGTH TO CALCULATE VIEW SCALES&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;'MessageBox.Show(iProperties.Value("Custom","FlatExtentsLength"), "Title")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;'MessageBox.Show(iProperties.Value("Custom","FlatExtentsWidth"), "Title")&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;FLATPATTERNLENGTH = iProperties.Value("Custom","FlatExtentsLength")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;FLATPATTERNWIDTH = iProperties.Value("Custom","FlatExtentsWidth")&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;'Calculate View Scale&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;If FLATPATTERNLENGTH &amp;gt;= FLATPATTERNWIDTH Then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;ViewScale = 5/FLATPATTERNLENGTH&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;ViewScale = 5/FLATPATTERNWIDTH&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;End If&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;'Ask to create drawing?&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dwgQuery=MsgBox("Would you like to Create a drawing for this MODEL?", vbYesNo,"Drawing Selection")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;If dwgQuery = vbYes Then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oPartDoc = ThisDoc.Document&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;'Define IDW Template File Location&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oDrawingDoc = ThisApplication.documents.Add(kDrawingDocumentObject, "pathandfilename.IDW", True)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oSheet = oDrawingDoc.Sheets.Item(1)&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;'Define 2d view bottom left corner points for four views&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(25#, 15#)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oPoint2 = ThisApplication.TransientGeometry.CreatePoint2d(33#, 15#)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oPoint3 = ThisApplication.TransientGeometry.CreatePoint2d(25#, 20#)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oPoint4 = ThisApplication.TransientGeometry.CreatePoint2d(4#, 10#)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oView1 = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint1, ViewScale,kFrontViewOrientation, _&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;kHiddenLineRemovedDrawingViewStyle)', KTANGENTEDGESON)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;oView2 = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint2, _&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;ViewScale,kRightViewOrientation,kHiddenLineRemovedDrawingViewStyle)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;oView3 = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint3, _&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;ViewScale,kTopViewOrientation,kHiddenLineRemovedDrawingViewStyle)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;'-----------------------Flat Pattern View Section-------------------------------------------------------------------------&lt;/FONT&gt;&lt;BR /&gt;'This is the code line which I wish to use to add the sheet metal flat patter default view:&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oView4 = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint4, _&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;ViewScale,kIsoTopRightViewOrientation,kHiddenLineRemovedDrawingViewStyle, kSheetMetalFlatPattern, _&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;Camera1)'"sheetmetalflatpattern")'oBaseViewOptions)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;End If&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;'--------------------end of iLogic code-------------------------&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Perhaps you can try my code. Note that you must launch this rule from within a model sheet metal .IPT file only. It will not work if you to try launching with an IDW or a non sheet metal part IPT open.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Perhaps Autodesk can help out to define the proper access code to the Sheet Metal Flat Pattern View. Further, how to define to show Tangent Edges in a formed view.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thank you for your efforts.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;&lt;FONT color="#000000"&gt;Raj&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;U&gt;&lt;BR /&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 26 Jan 2012 04:59:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-01-26T04:59:44Z</dc:date>
    <item>
      <title>Sheet Metal Flat Pattern view insert in IDW code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/3303873#M137691</link>
      <description>&lt;P&gt;I am working on a new iLogic rule that will create and IDW with automate views of the folded model of the sheet metal part in front view, right view, top view and the flat pattern I have success with all views except the flat pattern view creation codes. Does anyoone have knowledge of what the code terminology is to add a flat pattern view through ilogic to an idw?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, if this is possible, I want to create&amp;nbsp; a bend table and a hole table using ilogic to automate these processes.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So far, I can create any view off the folded model but I do not know the code to create a flat pattern view.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2012 05:48:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/3303873#M137691</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-24T05:48:25Z</dc:date>
    </item>
    <item>
      <title>Re: Sheet Metal Flat Pattern view insert in IDW code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/3306191#M137692</link>
      <description>&lt;P&gt;I don't remember where I found this code, but at one time I had the same question.&lt;BR /&gt;&lt;BR /&gt;I hope that this helps!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Public Sub AddFlatPatternDrawingView()

    ' Set a reference to the drawing document.
    ' This assumes a drawing document is active.
    Dim oDrawDoc As DrawingDocument
    Set oDrawDoc = ThisApplication.ActiveDocument

    'Set a reference to the active sheet.
    Dim oSheet As Sheet
    Set oSheet = oDrawDoc.ActiveSheet

    ' Create a new NameValueMap object
    Dim oBaseViewOptions As NameValueMap
    Set oBaseViewOptions = ThisApplication.TransientObjects.CreateNameValueMap

    ' Set the options to use when creating the base view.
    Call oBaseViewOptions.Add("SheetMetalFoldedModel", False)

    ' Open the sheet metal document invisibly
    Dim oModel As Document
    Set oModel = ThisApplication.Documents.Open("C:\Some\Crazy\Path\To\Your\Part\Here.ipt", False)

    ' Create the placement point object.
    Dim oPoint As Point2d
    Set oPoint = ThisApplication.TransientGeometry.CreatePoint2d(0, 0)

    ' Create a base view.
    Dim oBaseView As DrawingView
    Set oBaseView = oSheet.DrawingViews.AddBaseView(oModel, oPoint, 1, _
    kDefaultViewOrientation, kHiddenLineRemovedDrawingViewStyle, _
    , , oBaseViewOptions)

End Sub
    &lt;/PRE&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, 25 Jan 2012 17:26:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/3306191#M137692</guid>
      <dc:creator>MegaJerk</dc:creator>
      <dc:date>2012-01-25T17:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: Sheet Metal Flat Pattern view insert in IDW code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/3306889#M137693</link>
      <description>&lt;DIV class="lia-decoration-border-top"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="author-role-icon"&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;A target="_self" href="https://forums.autodesk.com/../user/viewprofilepage/user-id/725444"&gt;&lt;SPAN&gt;MegaJerk&lt;/SPAN&gt;&lt;/A&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thank you for your code. However, I was not able to make it work in Inventor 2012 Ilogic. I cleaned it up and removed the "SET" statements that are no longer used but I keep getting an error:&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;U&gt;"Error in rule: FLAT PATTERN VIEW CREATE IN IDW, in document: FLAT PATTERN VIEW CREATE IN IDW.iLogicVb&lt;/U&gt;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#FF0000"&gt;&lt;U&gt;Unable to cast COM object of type 'System.__ComObject' to interface type 'Inventor.DrawingDocument'. This operation failed because the QueryInterface call on the COM component for the interface with IID '{29F0D467-C114-11D2-B77F-0060B0F159EF}' failed due to the following error: No such interface supported (Exception from HRESULT: 0x80004002 (E_NOINTERFACE)).&lt;/U&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;FONT color="#339966"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;U&gt;The codes I have currently that work and create the formed views of the sheet metal part is as follows:&lt;/U&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;'------------------------start of iLogic code ---------------------&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Imports Inventor.ViewOrientationTypeEnum&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Imports Inventor.DrawingViewStyleEnum&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oDrawingDoc as DrawingDocument&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oPartDoc as Document&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oSheet As sheet&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oTG As TransientGeometry&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oView1 as DrawingView&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oView2 as DrawingView&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oView3 as DrawingView&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Dim oView4 as DrawingView&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;'GET SHEET METAL FLAT PATTERN EXTENTS LENGTH TO CALCULATE VIEW SCALES&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;'MessageBox.Show(iProperties.Value("Custom","FlatExtentsLength"), "Title")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;'MessageBox.Show(iProperties.Value("Custom","FlatExtentsWidth"), "Title")&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;FLATPATTERNLENGTH = iProperties.Value("Custom","FlatExtentsLength")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;FLATPATTERNWIDTH = iProperties.Value("Custom","FlatExtentsWidth")&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;'Calculate View Scale&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;If FLATPATTERNLENGTH &amp;gt;= FLATPATTERNWIDTH Then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;ViewScale = 5/FLATPATTERNLENGTH&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;Else&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;ViewScale = 5/FLATPATTERNWIDTH&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;End If&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;'Ask to create drawing?&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;dwgQuery=MsgBox("Would you like to Create a drawing for this MODEL?", vbYesNo,"Drawing Selection")&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;If dwgQuery = vbYes Then&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oPartDoc = ThisDoc.Document&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;'Define IDW Template File Location&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oDrawingDoc = ThisApplication.documents.Add(kDrawingDocumentObject, "pathandfilename.IDW", True)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oSheet = oDrawingDoc.Sheets.Item(1)&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;'Define 2d view bottom left corner points for four views&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(25#, 15#)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oPoint2 = ThisApplication.TransientGeometry.CreatePoint2d(33#, 15#)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oPoint3 = ThisApplication.TransientGeometry.CreatePoint2d(25#, 20#)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;oPoint4 = ThisApplication.TransientGeometry.CreatePoint2d(4#, 10#)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oView1 = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint1, ViewScale,kFrontViewOrientation, _&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;kHiddenLineRemovedDrawingViewStyle)', KTANGENTEDGESON)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;oView2 = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint2, _&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;ViewScale,kRightViewOrientation,kHiddenLineRemovedDrawingViewStyle)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;oView3 = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint3, _&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;ViewScale,kTopViewOrientation,kHiddenLineRemovedDrawingViewStyle)&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;'-----------------------Flat Pattern View Section-------------------------------------------------------------------------&lt;/FONT&gt;&lt;BR /&gt;'This is the code line which I wish to use to add the sheet metal flat patter default view:&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; oView4 = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint4, _&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;ViewScale,kIsoTopRightViewOrientation,kHiddenLineRemovedDrawingViewStyle, kSheetMetalFlatPattern, _&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;Camera1)'"sheetmetalflatpattern")'oBaseViewOptions)&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;End If&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;FONT color="#0000FF"&gt;'--------------------end of iLogic code-------------------------&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Perhaps you can try my code. Note that you must launch this rule from within a model sheet metal .IPT file only. It will not work if you to try launching with an IDW or a non sheet metal part IPT open.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Perhaps Autodesk can help out to define the proper access code to the Sheet Metal Flat Pattern View. Further, how to define to show Tangent Edges in a formed view.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;FONT color="#000000"&gt;&lt;SPAN&gt;&lt;SPAN&gt;Thank you for your efforts.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;FONT color="#0000FF"&gt;&lt;FONT color="#000000"&gt;Raj&lt;/FONT&gt;&lt;BR /&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV class="lia-message-author-username lia-component-user-name"&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;U&gt;&lt;BR /&gt;&lt;/U&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 26 Jan 2012 04:59:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/3306889#M137693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-01-26T04:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: Sheet Metal Flat Pattern view insert in IDW code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/3307193#M137694</link>
      <description>&lt;P&gt;That code was for VBA and not ilogic. I will try to make some ilogic code for you tomorrow (or later today if I have time).&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jan 2012 13:00:14 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/3307193#M137694</guid>
      <dc:creator>MegaJerk</dc:creator>
      <dc:date>2012-01-26T13:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Sheet Metal Flat Pattern view insert in IDW code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/8286329#M137695</link>
      <description>&lt;P&gt;Did you ever get this to work?&amp;nbsp;If so could you please post it as I would also like to get this to work.&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Sat, 22 Sep 2018 23:18:32 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/8286329#M137695</guid>
      <dc:creator>mbranderhorst</dc:creator>
      <dc:date>2018-09-22T23:18:32Z</dc:date>
    </item>
    <item>
      <title>Re: Sheet Metal Flat Pattern view insert in IDW code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/8288476#M137696</link>
      <description>&lt;P&gt;I'm not sure if this will work for 2012, but this is the sample provided by 2019 Inventor:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;SyntaxEditor Code Snippet&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;' Set a reference to the drawing document.&lt;/SPAN&gt;
&lt;SPAN&gt;' This assumes a drawing document is active.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingDocument&lt;/SPAN&gt;
&lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveDocument&lt;/SPAN&gt;

&lt;SPAN&gt;'Set a reference to the active sheet.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oSheet&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Sheet&lt;/SPAN&gt;
&lt;SPAN&gt;oSheet&lt;/SPAN&gt; = &lt;SPAN&gt;oDrawDoc&lt;/SPAN&gt;.&lt;SPAN&gt;ActiveSheet&lt;/SPAN&gt;

&lt;SPAN&gt;' Create a new NameValueMap object&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBaseViewOptions&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;NameValueMap&lt;/SPAN&gt;
&lt;SPAN&gt;oBaseViewOptions&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientObjects&lt;/SPAN&gt;.&lt;SPAN&gt;CreateNameValueMap&lt;/SPAN&gt;

&lt;SPAN&gt;' Set the options to use when creating the base view.&lt;/SPAN&gt;
&lt;SPAN&gt;oBaseViewOptions&lt;/SPAN&gt;.&lt;SPAN&gt;Add&lt;/SPAN&gt;(&lt;SPAN&gt;"SheetMetalFoldedModel"&lt;/SPAN&gt;, &lt;SPAN&gt;False&lt;/SPAN&gt;)

&lt;SPAN&gt;' Open the sheet metal document invisibly&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oModel&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Document&lt;/SPAN&gt;
&lt;SPAN&gt;oModel&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;Documents&lt;/SPAN&gt;.&lt;SPAN&gt;Open&lt;/SPAN&gt;(&lt;SPAN&gt;"C:\temp\SheetMetal.ipt"&lt;/SPAN&gt;, &lt;SPAN&gt;False&lt;/SPAN&gt;)

&lt;SPAN&gt;' Create the placement point object.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oPoint&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;Point2d&lt;/SPAN&gt;
&lt;SPAN&gt;oPoint&lt;/SPAN&gt; = &lt;SPAN&gt;ThisApplication&lt;/SPAN&gt;.&lt;SPAN&gt;TransientGeometry&lt;/SPAN&gt;.&lt;SPAN&gt;CreatePoint2d&lt;/SPAN&gt;(25, 25)

&lt;SPAN&gt;' Create a base view.&lt;/SPAN&gt;
&lt;SPAN&gt;Dim&lt;/SPAN&gt; &lt;SPAN&gt;oBaseView&lt;/SPAN&gt; &lt;SPAN&gt;As&lt;/SPAN&gt; &lt;SPAN&gt;DrawingView&lt;/SPAN&gt;
&lt;SPAN&gt;oBaseView&lt;/SPAN&gt; = &lt;SPAN&gt;oSheet&lt;/SPAN&gt;.&lt;SPAN&gt;DrawingViews&lt;/SPAN&gt;.&lt;SPAN&gt;AddBaseView&lt;/SPAN&gt;(&lt;SPAN&gt;oModel&lt;/SPAN&gt;, &lt;SPAN&gt;oPoint&lt;/SPAN&gt;, 1, _
&lt;SPAN&gt;kDefaultViewOrientation&lt;/SPAN&gt;, &lt;SPAN&gt;kHiddenLineRemovedDrawingViewStyle&lt;/SPAN&gt;, , , &lt;SPAN&gt;oBaseViewOptions&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;Basically at the end of the Add Base View command there's a section for adding additional options specific to sheet metal, weldments, iPart/iAssembly, Positional, and Presentation views.&amp;nbsp; As you see in the middle of the sample it creates a Name Value Map and adds the option of SheetMetalFolded=False, then that argument is used in the drawing view creation where False means Flat.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2018 15:28:35 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/8288476#M137696</guid>
      <dc:creator>philip1009</dc:creator>
      <dc:date>2018-09-24T15:28:35Z</dc:date>
    </item>
    <item>
      <title>Re: Sheet Metal Flat Pattern view insert in IDW code</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/8289257#M137697</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;You just needed to create the NameValueMap and assign the correct variable.&amp;nbsp; You were very close. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: Per the 2017 API guide, this will only place the flat view, if it already exists in the part.&amp;nbsp; If it does not exist, then it will place a folded view. &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Imports Inventor.ViewOrientationTypeEnum
Imports Inventor.DrawingViewStyleEnum

Dim oDrawingDoc as DrawingDocument    
Dim oPartDoc as Document
Dim oSheet As sheet
Dim oTG As TransientGeometry
Dim oView1 as DrawingView
Dim oView2 as DrawingView
Dim oView3 as DrawingView
Dim oView4 as DrawingView

'GET SHEET METAL FLAT PATTERN EXTENTS LENGTH TO CALCULATE VIEW SCALES

                            'MessageBox.Show(iProperties.Value("Custom","FlatExtentsLength"), "Title")
                            'MessageBox.Show(iProperties.Value("Custom","FlatExtentsWidth"), "Title")

FLATPATTERNLENGTH = iProperties.Value("Custom","FlatExtentsLength")
FLATPATTERNWIDTH = iProperties.Value("Custom","FlatExtentsWidth")

'Calculate View Scale
If FLATPATTERNLENGTH &amp;gt;= FLATPATTERNWIDTH Then
ViewScale = 5/FLATPATTERNLENGTH
Else
ViewScale = 5/FLATPATTERNWIDTH
End If    


'Ask to create drawing?
dwgQuery=MsgBox("Would you like to Create a drawing for this MODEL?", vbYesNo,"Drawing Selection")
If dwgQuery = vbYes Then
    oPartDoc = ThisDoc.Document
    
    'Define IDW Template File Location
    oDrawingDoc = ThisApplication.documents.Add(kDrawingDocumentObject, "pathandfilename.IDW", True)
    oSheet = oDrawingDoc.Sheets.Item(1)
    
    'Define 2d view bottom left corner points for four views
    oPoint1 = ThisApplication.TransientGeometry.CreatePoint2d(25#, 15#)
    oPoint2 = ThisApplication.TransientGeometry.CreatePoint2d(33#, 15#)
    oPoint3 = ThisApplication.TransientGeometry.CreatePoint2d(25#, 20#)
    oPoint4 = ThisApplication.TransientGeometry.CreatePoint2d(4#, 10#)
                oView1 = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint1, ViewScale,kFrontViewOrientation, _
                kHiddenLineRemovedDrawingViewStyle)', KTANGENTEDGESON)
                oView2 = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint2, _
ViewScale,kRightViewOrientation,kHiddenLineRemovedDrawingViewStyle)
                oView3 = oSheet.DrawingViews.AddBaseView(oPartDoc,oPoint3, _
ViewScale,kTopViewOrientation,kHiddenLineRemovedDrawingViewStyle)


' Create a new NameValueMap object
Dim oBaseViewOptions As NameValueMap
oBaseViewOptions = ThisApplication.TransientObjects.CreateNameValueMap

' Set the options to use when creating the base view.
oBaseViewOptions.Add("SheetMetalFoldedModel", False)

'-----------------------Flat Pattern View Section-------------------------------------------------------------------------
'This is the code line which I wish to use to add the sheet metal flat patter default view:
      oView4 = oSheet.DrawingViews.AddBaseView(oPartDoc, oPoint4, _
ViewScale,kIsoTopRightViewOrientation,kHiddenLineRemovedDrawingViewStyle, , ,oBaseViewOptions)

End If&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 24 Sep 2018 20:14:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/sheet-metal-flat-pattern-view-insert-in-idw-code/m-p/8289257#M137697</guid>
      <dc:creator>Cody.Redding</dc:creator>
      <dc:date>2018-09-24T20:14:58Z</dc:date>
    </item>
  </channel>
</rss>

