<?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: Shrinkwrap using iLogic in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/2871122#M141783</link>
    <description>&lt;P&gt;Thanks MjDeck but I'm still&amp;nbsp;having problems.&amp;nbsp;I put those Imports statements at the top of the rule and I'm getting an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Error Message:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Error in rule: MAKE SHRINKWRAP, in document: 1354-8000.iam&lt;/P&gt;&lt;P&gt;Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;More Info:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at Inventor.DerivedAssemblyDefinition.set_IncludeAllTopLevelWorkFeatures(DerivedComponentOptionEnum )&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at LmiRuleScript.CreateShrinkwrap(String ShrinkwrapFolder)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at LmiRuleScript.Main()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at p.b(String A_0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I still don't know what I'm doing wrong. I attached a copy of my full code if that helps any. Thanks again for the help.&lt;/P&gt;</description>
    <pubDate>Wed, 05 Jan 2011 13:48:44 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2011-01-05T13:48:44Z</dc:date>
    <item>
      <title>Shrinkwrap using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/2867306#M141781</link>
      <description>&lt;P&gt;Hi guys, I'm trying to automate making a shrinkwrap of some assemblies that I made that are also configurable using iLogic. I want to be able to&amp;nbsp;make a shrinkwrap of the Assembly without having a substitute representation and also break the link with the Assembly so we can make a 3D block Library.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried using the sample code in the Programming Help but I keep getting an error. I made a simple counting function to see where I'm going wrong and I've narrowed it down to after count #6.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm using a 64bit Windows 7 computer with&amp;nbsp;the Factory Design Suite on it. Factor Design Suite is&amp;nbsp;mostly just an add-on to Inventor 2011 so I'm not sure if that is causing the error.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have some experience with programming but I haven't had any formal VBA classes so I've been mostly just guessing and running it to&amp;nbsp;try to&amp;nbsp;fix the problem but I've run into a wall. Can someone tell me what&amp;nbsp;I'm doing wrong?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is my code and the error that it gives me when I try to run it:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Code:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;Sub CreateShrinkwrap(ShrinkwrapFolder As String)&lt;BR /&gt;    &lt;BR /&gt;Parameter("COUNT") = 0&lt;BR /&gt;    &lt;BR /&gt;    ' Find the part File Path and Name&lt;BR /&gt;    PART_NUMBER = iProperties.Value("Project", "Part Number")&lt;BR /&gt;    &lt;BR /&gt;    ShrinkwrapFilePath = String.Concat("L:\Mechanical\Inventor\COMPONENT DETAILS\", ShrinkwrapFolder, "\")&lt;BR /&gt;    &lt;BR /&gt;    ShrinkwrapFileName = String.Concat(ShrinkwrapFilePath, PART_NUMBER, ".ipt")&lt;BR /&gt;    &lt;BR /&gt;Call SET_COUNT()  'COUNT = 1&lt;BR /&gt;&lt;BR /&gt;    ' Set a reference to the active assembly document&lt;BR /&gt;    Dim oDoc As AssemblyDocument&lt;BR /&gt;    oDoc = ThisApplication.ActiveDocument&lt;BR /&gt;    &lt;BR /&gt;Call SET_COUNT()  'COUNT = 2&lt;BR /&gt;    &lt;BR /&gt;    Dim oDef As AssemblyComponentDefinition&lt;BR /&gt;    oDef = oDoc.ComponentDefinition&lt;BR /&gt;    &lt;BR /&gt;Call SET_COUNT()  'COUNT = 3&lt;BR /&gt;    &lt;BR /&gt;    'Set the Template file name:&lt;BR /&gt;    TemplateFileName = "\\fs3\Depts\Product_Engineering\Inventor_File_Repository\INVENTOR 2011 FILES\Templates\Shrinkwrap.ipt"&lt;BR /&gt;    &lt;BR /&gt;    ' Create a new part document that will be the shrinkwrap substitute&lt;BR /&gt;    Dim oPartDoc As PartDocument&lt;BR /&gt;    oPartDoc = ThisApplication.Documents.Add(kPartDocumentObject, TemplateFileName, False)&lt;BR /&gt;    &lt;BR /&gt;Call SET_COUNT()  'COUNT = 4&lt;BR /&gt;    &lt;BR /&gt;    Dim oPartDef As PartComponentDefinition&lt;BR /&gt;    oPartDef = oPartDoc.ComponentDefinition&lt;BR /&gt;    &lt;BR /&gt;Call SET_COUNT()  'COUNT = 5&lt;BR /&gt;    &lt;BR /&gt;    Dim oDerivedAssemblyDef As DerivedAssemblyDefinition&lt;BR /&gt;    oDerivedAssemblyDef = oPartDef.ReferenceComponents.DerivedAssemblyComponents.CreateDefinition(oDoc.FullDocumentName)&lt;BR /&gt;    &lt;BR /&gt;Call SET_COUNT()  'COUNT = 6&lt;BR /&gt;    &lt;BR /&gt;    ' Set various shrinkwrap related options&lt;BR /&gt;    oDerivedAssemblyDef.DeriveStyle = kDeriveAsSingleBodyNoSeams&lt;BR /&gt;    oDerivedAssemblyDef.IncludeAllTopLevelWorkFeatures = kDerivedIncludeAll&lt;BR /&gt;    oDerivedAssemblyDef.IncludeAllTopLevelSketches = kDerivedIncludeAll&lt;BR /&gt;    oDerivedAssemblyDef.IncludeAllTopLeveliMateDefinitions = kDerivedExcludeAll&lt;BR /&gt;    oDerivedAssemblyDef.IncludeAllTopLevelParameters = kDerivedExcludeAll&lt;BR /&gt;    oDerivedAssemblyDef.ReducedMemoryMode = True&lt;BR /&gt;    &lt;BR /&gt;    Call oDerivedAssemblyDef.SetHolePatchingOptions(kDerivedPatchAll)&lt;BR /&gt;    Call oDerivedAssemblyDef.SetRemoveByVisibilityOptions(kDerivedRemovePartsAndFaces, 25)&lt;BR /&gt;&lt;BR /&gt;Call SET_COUNT()  'COUNT = 7&lt;BR /&gt;    &lt;BR /&gt;    ' Create the shrinkwrap component&lt;BR /&gt;    Dim oDerivedAssembly As DerivedAssemblyComponent&lt;BR /&gt;    oDerivedAssembly = oPartDef.ReferenceComponents.DerivedAssemblyComponents.Add(oDerivedAssemblyDef)&lt;BR /&gt;    oDerivedAssembly.BreakLinkToFile&lt;BR /&gt;    &lt;BR /&gt;Call SET_COUNT()  'COUNT = 8&lt;BR /&gt;&lt;BR /&gt;    ThisApplication.SilentOperation = True&lt;BR /&gt;    oPartDoc.SaveAs(ShrinkwrapFileName, False)&lt;BR /&gt;    ThisApplication.SilentOperation = False&lt;BR /&gt;    &lt;BR /&gt;Call SET_COUNT()  'COUNT = 9&lt;BR /&gt;    &lt;BR /&gt;    ' Release reference of the invisibly opened part document.&lt;BR /&gt;    oPartDoc.ReleaseReference&lt;BR /&gt;    &lt;BR /&gt;Call SET_COUNT()  'COUNT = 10&lt;BR /&gt;&lt;BR /&gt;End Sub&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Error Message:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Error in rule: MAKE SHRINKWRAP, in document: 1354-8000.iam&lt;/P&gt;&lt;P&gt;Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;More Info:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at Inventor.DerivedAssemblyDefinition.set_IncludeAllTopLevelWorkFeatures(DerivedComponentOptionEnum )&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at LmiRuleScript.CreateShrinkwrap(String ShrinkwrapFolder)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at LmiRuleScript.Main()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at p.b(String A_0)&lt;/P&gt;</description>
      <pubDate>Thu, 30 Dec 2010 13:37:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/2867306#M141781</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2010-12-30T13:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Shrinkwrap using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/2870552#M141782</link>
      <description>&lt;P&gt;You can fix this problem by adding these lines at the top of your rule:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;&lt;SPAN&gt;Imports&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;Inventor&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DerivedComponentStyleEnum&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Imports&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;Inventor&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DerivedComponentOptionEnum&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Imports&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;Inventor&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DerivedHolePatchEnum&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;Imports&lt;/SPAN&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;SPAN&gt;Inventor&lt;/SPAN&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;SPAN&gt;DerivedGeometryRemovalEnum&lt;/SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/PRE&gt;
&lt;P&gt;These are required because in VB.NET (and thus in iLogic), Enum's are not automatically imported by the compiler. &amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Alternatively, you can change your code to explicitly use the Enum names wherever needed, e.g.&lt;/P&gt;
&lt;P&gt;oDerivedAssemblyDef.DeriveStyle = DerivedComponentStyleEnum.kDeriveAsSingleBodyNoSeams&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To find the required Enum names: &lt;/P&gt;
&lt;P&gt;Any time you use a predefined Inventor constant (which usually starts with the letter k), search the API help for it. &amp;nbsp;This will give you the Enum type where the constant is found.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;To make sure you have found all the constants in your code, you can add the line:&lt;/P&gt;
&lt;P&gt;Option Explicit On&lt;/P&gt;
&lt;P&gt;at the top of the rule (before the Imports statements).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jan 2011 21:05:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/2870552#M141782</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2011-01-04T21:05:59Z</dc:date>
    </item>
    <item>
      <title>Re: Shrinkwrap using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/2871122#M141783</link>
      <description>&lt;P&gt;Thanks MjDeck but I'm still&amp;nbsp;having problems.&amp;nbsp;I put those Imports statements at the top of the rule and I'm getting an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Error Message:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;Error in rule: MAKE SHRINKWRAP, in document: 1354-8000.iam&lt;/P&gt;&lt;P&gt;Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;More Info:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;System.Runtime.InteropServices.COMException (0x80004005): Unspecified error (Exception from HRESULT: 0x80004005 (E_FAIL))&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at System.RuntimeType.ForwardCallToInvokeMember(String memberName, BindingFlags flags, Object target, Int32[] aWrapperTypes, MessageData&amp;amp; msgData)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at Inventor.DerivedAssemblyDefinition.set_IncludeAllTopLevelWorkFeatures(DerivedComponentOptionEnum )&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at LmiRuleScript.CreateShrinkwrap(String ShrinkwrapFolder)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at LmiRuleScript.Main()&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at Autodesk.iLogic.Exec.AppDomExec.ExecRuleInAssembly(Assembly assem)&lt;BR /&gt;&amp;nbsp;&amp;nbsp; at p.b(String A_0)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So I still don't know what I'm doing wrong. I attached a copy of my full code if that helps any. Thanks again for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2011 13:48:44 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/2871122#M141783</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-01-05T13:48:44Z</dc:date>
    </item>
    <item>
      <title>Re: Shrinkwrap using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/2871210#M141784</link>
      <description>&lt;P&gt;Did you try the your code in VBA? &amp;nbsp; It might be easier to see what's going wrong in VBA.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it works in VBA, can you post your template file Shrinkwrap.ipt and a sample assembly?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jan 2011 14:33:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/2871210#M141784</guid>
      <dc:creator>MjDeck</dc:creator>
      <dc:date>2011-01-05T14:33:51Z</dc:date>
    </item>
    <item>
      <title>Re: Shrinkwrap using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/2873826#M141785</link>
      <description>&lt;P&gt;Using the "Imports" command didn't really work very well but with a little work&amp;nbsp;I did get it to work using the VB editor. Thanks for all the help.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jan 2011 13:36:20 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/2873826#M141785</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2011-01-07T13:36:20Z</dc:date>
    </item>
    <item>
      <title>Re: Shrinkwrap using iLogic</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/6057690#M141786</link>
      <description>&lt;P&gt;Hello Gatordanner,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did you manage to get the I-logic to work.&lt;/P&gt;&lt;P&gt;I am trying to get it to work.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Warren.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 08:17:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/shrinkwrap-using-ilogic/m-p/6057690#M141786</guid>
      <dc:creator>warrentdo</dc:creator>
      <dc:date>2016-02-26T08:17:29Z</dc:date>
    </item>
  </channel>
</rss>

