<?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 Use iLogic To Create Assembly in Inventor Programming - iLogic, Macros, AddIns &amp; Apprentice</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/6799122#M69262</link>
    <description>&lt;P&gt;I constantly have to make a large number of very similar parts and then make a drawing that has them all in it. This is generally done by throwing all the files into an assembly and using that as the main base for the drawing, as the title block displays total weight and other properties that would not show up if you put the parts in one at a time. So onto the question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have made a builder to make the parts and save them automatically. What I then want is to create an assembly file from the Part iLogic and place selected files loose into it. Anyone have any ideas on how to do this? I cannot find any other discussions on creating assembly files&lt;/P&gt;</description>
    <pubDate>Wed, 11 Jan 2017 18:57:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2017-01-11T18:57:18Z</dc:date>
    <item>
      <title>Use iLogic To Create Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/6799122#M69262</link>
      <description>&lt;P&gt;I constantly have to make a large number of very similar parts and then make a drawing that has them all in it. This is generally done by throwing all the files into an assembly and using that as the main base for the drawing, as the title block displays total weight and other properties that would not show up if you put the parts in one at a time. So onto the question:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have made a builder to make the parts and save them automatically. What I then want is to create an assembly file from the Part iLogic and place selected files loose into it. Anyone have any ideas on how to do this? I cannot find any other discussions on creating assembly files&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 18:57:18 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/6799122#M69262</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2017-01-11T18:57:18Z</dc:date>
    </item>
    <item>
      <title>Re: Use iLogic To Create Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/6799476#M69267</link>
      <description>&lt;P&gt;hello&amp;nbsp; lukergrt&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Private&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Sub&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; CreateAssy()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp; Dim&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; oApp &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;As&lt;/FONT&gt; &lt;FONT color="#2b91af" face="Consolas" size="2"&gt;Application&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; = ThisApplication&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;&amp;nbsp; Dim&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; oAssyDoc &lt;/FONT&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;As&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; Inventor.&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;AssemblyDocument&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt; = oApp.Documents.Add(&lt;/FONT&gt;&lt;FONT color="#2b91af" face="Consolas" size="2"&gt;DocumentTypeEnum&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;.kAssemblyDocumentObject, &lt;/FONT&gt;&lt;FONT color="#a31515" face="Consolas" size="2"&gt;"C:\...FullPath....\standard.iam"&lt;/FONT&gt;&lt;FONT face="Consolas" size="2"&gt;)&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;　&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;End&lt;/FONT&gt; &lt;FONT color="#0000ff" face="Consolas" size="2"&gt;Sub&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#0000ff" face="Consolas" size="2"&gt;this should work&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Jan 2017 21:04:58 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/6799476#M69267</guid>
      <dc:creator>HermJan.Otterman</dc:creator>
      <dc:date>2017-01-11T21:04:58Z</dc:date>
    </item>
    <item>
      <title>Re: Use iLogic To Create Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/6799615#M69269</link>
      <description>&lt;P&gt;Or try something along these lines (from API samples)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;Public Sub AddOccurrence()
    ' Set a reference to the assembly component definintion.
    ' This assumes an assembly document is open.
    Dim oAsmCompDef As AssemblyComponentDefinition
    Set oAsmCompDef = ThisApplication.ActiveDocument.ComponentDefinition

    ' Set a reference to the transient geometry object.
    Dim oTG As TransientGeometry
    Set oTG = ThisApplication.TransientGeometry

    ' Create a matrix.  A new matrix is initialized with an identity matrix.
    Dim oMatrix As Matrix
    Set oMatrix = oTG.CreateMatrix

    ' Set the rotation of the matrix for a 45 degree rotation about the Z axis.
    Call oMatrix.SetToRotation(3.14159265358979 / 4, _
                            oTG.CreateVector(0, 0, 1), oTG.CreatePoint(0, 0, 0))

    ' Set the translation portion of the matrix so the part will be positioned
    ' at (3,2,1).
    Call oMatrix.SetTranslation(oTG.CreateVector(3, 2, 1))

    ' Add the occurrence.
    Dim oOcc As ComponentOccurrence
    Set oOcc = oAsmCompDef.Occurrences.Add("C:\Temp\Part1.ipt", oMatrix)
End Sub
&lt;/PRE&gt;</description>
      <pubDate>Wed, 11 Jan 2017 21:52:37 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/6799615#M69269</guid>
      <dc:creator>MechMachineMan</dc:creator>
      <dc:date>2017-01-11T21:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: Use iLogic To Create Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/9377091#M106969</link>
      <description>&lt;P&gt;I was reviewing the original post by&amp;nbsp;@Anonymous&lt;/a&gt;&amp;nbsp;in which I interpreted that he wanted to create a new assembly &lt;U&gt;and&lt;/U&gt; then add components to it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/562667"&gt;@HermJan.Otterman&lt;/a&gt;&amp;nbsp;explained how to create a new assembly.&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/2511355"&gt;@MechMachineMan&lt;/a&gt;&amp;nbsp;explained how to add components to an existing assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My question - how do you make the new assembly as the existing (active) assembly in which to add the new components?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code I have so far. You will need to substitute your template path and component as needed:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Sub Main()

	' Create and activate new assembly
	Dim oTemplatePath = "Z:\Inventor_Data\Templates\"
	Dim oAssembly As AssemblyDocument
	oAssembly = ThisApplication.Documents.Add(kAssemblyDocumentObject, oTemplatePath &amp;amp; "MY_ASSEMBLY.iam", True)
	oAssembly.Activate

	' Insert and name Comp_01
	Dim componentA = Components.Add("Comp_01", "ABC123.ipt", position := Nothing, grounded := False, visible := True, appearance := Nothing)

End Sub&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The above code errors if run from a part:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Error in rule: ThisAssembly: This document "Part2" is not an assembly.&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When run from an open assembly, a new assembly is created, but the component is added in the first assembly document, NOT the new assembly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I hope someone can offer a solution. A workaround would be to ask the user to create a new assembly with the required template before running the code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for your time. I look forward to the responses.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 18:19:45 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/9377091#M106969</guid>
      <dc:creator>JBerns</dc:creator>
      <dc:date>2020-03-13T18:19:45Z</dc:date>
    </item>
    <item>
      <title>Re: Use iLogic To Create Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/9377123#M106970</link>
      <description>&lt;P&gt;Hey Jerry,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The way I ended up doing this was by saving a template assembly that was empty, but had the ilogic code programmed to add the parts I wanted on startup.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then from your current assembly (or in my case it was a part file) run code to just open that template&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my case that was this:&lt;/P&gt;&lt;PRE&gt;&lt;SPAN&gt;'Open Assembly File&lt;/SPAN&gt;
	&lt;SPAN&gt;ThisDoc&lt;/SPAN&gt;.&lt;SPAN&gt;Launch&lt;/SPAN&gt;(&lt;SPAN&gt;"S:\Engineering\Inventor\Styles and Standards\Templates\iLogic-Conduit-ASM.iam"&lt;/SPAN&gt;)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As soon as that opens all the ilogic programmed to run on startup kicks in and treats that assembly as active to place everything.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hopefully this helps, can provide some more specific code from my scenario if needed, but I suspect it won't be directly relatable.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Cheers,&lt;/P&gt;&lt;P&gt;Luke&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 18:39:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/9377123#M106970</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-13T18:39:50Z</dc:date>
    </item>
    <item>
      <title>Re: Use iLogic To Create Assembly</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/9377262#M106971</link>
      <description>&lt;P&gt;@Anonymous&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the quick reply and the info. It will be useful.&lt;/P&gt;&lt;P&gt;I remain curious if it is possible to create a new assembly and place components in the assembly.&lt;/P&gt;&lt;P&gt;Perhaps this can't be done from an iLogic rule, but instead using API in an external program.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks again.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Jerry&lt;/P&gt;</description>
      <pubDate>Fri, 13 Mar 2020 20:08:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-ilogic/use-ilogic-to-create-assembly/m-p/9377262#M106971</guid>
      <dc:creator>JBerns</dc:creator>
      <dc:date>2020-03-13T20:08:59Z</dc:date>
    </item>
  </channel>
</rss>

