<?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: VBA or VB for sculpting overlapping objects in an Assembly?? in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3674984#M133920</link>
    <description>&lt;P&gt;Sure, full code below:...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff6600"&gt;Sub for_furtherwork()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Dim myPipe As ComponentOccurrence&lt;BR /&gt;&amp;nbsp; Dim myBlock As ComponentOccurrence&lt;BR /&gt;&amp;nbsp; Set myPipe = ThisApplication.ActiveDocument.ComponentDefinition.Occurrences.Item(1)&lt;BR /&gt;&amp;nbsp; Set myBlock = ThisApplication.ActiveDocument.ComponentDefinition.Occurrences.Item(2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#00ccff"&gt;Debug.Print myPipe.Name&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#00ccff"&gt;Debug.Print myBlock.Name&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Dim ofilePipe As PartDocument&lt;BR /&gt;&amp;nbsp; Set ofilePipe = myPipe.Definition.Document&lt;BR /&gt;&amp;nbsp; Dim mySurfaces As ObjectCollection&lt;BR /&gt;&amp;nbsp; Set mySurfaces = ThisApplication.TransientObjects.CreateObjectCollection&lt;BR /&gt;&amp;nbsp; Dim mySculptPipe As SculptSurface&lt;BR /&gt;&amp;nbsp; Dim mySculptBlock As SculptSurface&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;FONT color="#ff0000"&gt;&lt;EM&gt;&lt;STRONG&gt;Set mySculptPipe = ofilePipe.ComponentDefinition.Features.SculptFeatures.CreateSculptSurface(myPipe.SurfaceBodies.Item(1))&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; 'Set mySculptBlock = ofilePipe.ComponentDefinition.Features.SculptFeatures.CreateSculptSurface(myBlock)&lt;BR /&gt;&amp;nbsp; Call mySurfaces.Add(mySculptPipe)&lt;BR /&gt;&amp;nbsp; Call mySurfaces.Add(mySculptBlock)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#00ccff"&gt;Debug.Print "all surfaces added to transient object collection."&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#00ccff"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Call ofilePipe.ComponentDefinition.Features.SculptFeatures.Add(mySurfaces, False) 'False removes material&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#00ccff"&gt;Debug.Print "sculpt operation performed."&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#00ccff"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff6600"&gt;End Sub&lt;/FONT&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 26 Oct 2012 08:16:53 GMT</pubDate>
    <dc:creator>mitcham_boy</dc:creator>
    <dc:date>2012-10-26T08:16:53Z</dc:date>
    <item>
      <title>VBA or VB for sculpting overlapping objects in an Assembly??</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3667062#M133915</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an assembly with various parts in it.&amp;nbsp; I am trying to write a routine that will&lt;/P&gt;&lt;P&gt;1) systematically traverse the assembly and find parts that overlap,&lt;/P&gt;&lt;P&gt;2) where they overlap perform a sculpt operation on the parts&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Whilst i can do this manually by edit&amp;gt;copy object&amp;gt;sculpt&amp;gt;select surface ...&amp;nbsp; i don't know how to mimic this programmatically.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;So far i have coded to do it in a very hamfisted way by making a derived part file&amp;nbsp;from the overlapping parts, opening the derived part file and performing the sculpt, replacing the original part in the assembly with its new derived-sculpted part and then continuing to traverse the assembly tree..&amp;nbsp; - it is super slow and uses lots of file operations.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone have any examples of a slick way to do this??&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;regards&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 16:06:11 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3667062#M133915</guid>
      <dc:creator>mitcham_boy</dc:creator>
      <dc:date>2012-10-19T16:06:11Z</dc:date>
    </item>
    <item>
      <title>Re: VBA or VB for sculpting overlapping objects in an Assembly??</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3667440#M133916</link>
      <description>&lt;P&gt;The&amp;nbsp;&lt;SPAN&gt;derive-sculpt method that you described is the only way I'm aware of. &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;For a better solution I'm afraid we need more exposed to the API.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Oct 2012 19:20:55 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3667440#M133916</guid>
      <dc:creator>jdkriek</dc:creator>
      <dc:date>2012-10-19T19:20:55Z</dc:date>
    </item>
    <item>
      <title>Re: VBA or VB for sculpting overlapping objects in an Assembly??</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3668624#M133917</link>
      <description>&lt;P&gt;Jonathan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you for your very quick reply.&lt;/P&gt;&lt;P&gt;I am gleaning most of what i can from the VBA f1 help, these forums and some very useful presentations by Brian Ekin on the AutoDesk website - is there a recommended book on programming the API that walks through all the geometric/file based/etc operations with examples?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks again&lt;/P&gt;&lt;P&gt;Dan.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2012 09:16:25 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3668624#M133917</guid>
      <dc:creator>mitcham_boy</dc:creator>
      <dc:date>2012-10-22T09:16:25Z</dc:date>
    </item>
    <item>
      <title>Re: VBA or VB for sculpting overlapping objects in an Assembly??</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3668652#M133918</link>
      <description>&lt;P&gt;Hi Jonathan&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp;had been hoping to use the SculptFeatures method on a transient surface collection object instead of the derive-sculpt but i can't quite get the hang of the surface objects, can you see what i am doing wrong?&amp;nbsp;:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example: i have an assembly containing&amp;nbsp;a&amp;nbsp;pipe and&amp;nbsp;a small block that overlaps the pipe.&amp;nbsp;&amp;nbsp;I want to remove the small block from the pipe wall.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;ofilePipe &lt;/FONT&gt;is the part document for the pipe.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#339966"&gt;ofileBlock&lt;/FONT&gt; is the part document for the block&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So i want to use the following 'SculptFeatures' method passing it a surfaces collection which is the surface bodies of both the pipe and block... &lt;FONT color="#ff0000"&gt;Call ofilePipe.ComponentDefinition.Features.SculptFeatures.Add(mySurfaces, False)&lt;/FONT&gt; where &lt;EM&gt;true&lt;/EM&gt; adds material, &lt;EM&gt;false&lt;/EM&gt; removes material.&amp;nbsp; So to use the above i create a transient object collection named &lt;FONT color="#ff0000"&gt;mySurfaces&amp;nbsp;&lt;/FONT&gt;containing the surface bodies from each part...&amp;nbsp; But it falls over at the line which is &lt;EM&gt;&lt;STRONG&gt;bold italic&lt;/STRONG&gt; &lt;/EM&gt;because&amp;nbsp;there's something wrong with my attempt to obtain the surfaces of&amp;nbsp;a part.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Dim mySurfaces As ObjectCollection&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Set mySurfaces = ThisApplication.TransientObjects.CreateObjectCollection&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Dim mySculptPipe As SculptSurface&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Dim mySculptBlock As SculptSurface&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;EM&gt;&lt;STRONG&gt;Set mySculptPipe = ofilePipe.ComponentDefinition.Features.SculptFeatures.CreateSculptSurface(myPipe.SurfaceBodies.Item(1))&amp;nbsp; &lt;/STRONG&gt;&lt;/EM&gt;&lt;FONT color="#339966"&gt;'get the pipe part's surfaces as a surface&amp;nbsp;object&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Set mySculptBlock =&lt;FONT color="#339966"&gt; 'ditto but for the&amp;nbsp;block part&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Call mySurfaces.Add(mySculptPipe) &lt;FONT color="#339966"&gt;' add the pipe surface object to the collection&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Call mySurfaces.Add(mySculptBlock) &lt;FONT color="#339966"&gt;'add the block surface object to the collection&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp; Debug.Print "all surfaces added to transient object collection."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;FONT color="#ff0000"&gt;Call ofilePipe.ComponentDefinition.Features.SculptFeatures.Add(mySurfaces, False) &lt;FONT color="#000000"&gt;'true adds material, false removes material&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; Debug.Print "sculpt operation performed to original part document without requirement for derived part files."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you advise what i'm doing wrong?&lt;/P&gt;&lt;P&gt;thanks and regards&lt;/P&gt;&lt;P&gt;Dan&lt;/P&gt;</description>
      <pubDate>Mon, 22 Oct 2012 10:27:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3668652#M133918</guid>
      <dc:creator>mitcham_boy</dc:creator>
      <dc:date>2012-10-22T10:27:05Z</dc:date>
    </item>
    <item>
      <title>Re: VBA or VB for sculpting overlapping objects in an Assembly??</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3673848#M133919</link>
      <description>&lt;P&gt;Hi Dan,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where is&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;myPipe &lt;/STRONG&gt;&lt;/EM&gt;defined?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you post all of the code?&lt;/P&gt;</description>
      <pubDate>Thu, 25 Oct 2012 14:23:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3673848#M133919</guid>
      <dc:creator>jdkriek</dc:creator>
      <dc:date>2012-10-25T14:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: VBA or VB for sculpting overlapping objects in an Assembly??</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3674984#M133920</link>
      <description>&lt;P&gt;Sure, full code below:...&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff6600"&gt;Sub for_furtherwork()&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Dim myPipe As ComponentOccurrence&lt;BR /&gt;&amp;nbsp; Dim myBlock As ComponentOccurrence&lt;BR /&gt;&amp;nbsp; Set myPipe = ThisApplication.ActiveDocument.ComponentDefinition.Occurrences.Item(1)&lt;BR /&gt;&amp;nbsp; Set myBlock = ThisApplication.ActiveDocument.ComponentDefinition.Occurrences.Item(2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#00ccff"&gt;Debug.Print myPipe.Name&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT color="#00ccff"&gt;Debug.Print myBlock.Name&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Dim ofilePipe As PartDocument&lt;BR /&gt;&amp;nbsp; Set ofilePipe = myPipe.Definition.Document&lt;BR /&gt;&amp;nbsp; Dim mySurfaces As ObjectCollection&lt;BR /&gt;&amp;nbsp; Set mySurfaces = ThisApplication.TransientObjects.CreateObjectCollection&lt;BR /&gt;&amp;nbsp; Dim mySculptPipe As SculptSurface&lt;BR /&gt;&amp;nbsp; Dim mySculptBlock As SculptSurface&lt;/P&gt;&lt;P&gt;&amp;nbsp; &lt;FONT color="#ff0000"&gt;&lt;EM&gt;&lt;STRONG&gt;Set mySculptPipe = ofilePipe.ComponentDefinition.Features.SculptFeatures.CreateSculptSurface(myPipe.SurfaceBodies.Item(1))&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;BR /&gt;&amp;nbsp; 'Set mySculptBlock = ofilePipe.ComponentDefinition.Features.SculptFeatures.CreateSculptSurface(myBlock)&lt;BR /&gt;&amp;nbsp; Call mySurfaces.Add(mySculptPipe)&lt;BR /&gt;&amp;nbsp; Call mySurfaces.Add(mySculptBlock)&lt;/P&gt;&lt;P&gt;&lt;FONT color="#00ccff"&gt;Debug.Print "all surfaces added to transient object collection."&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#00ccff"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp; Call ofilePipe.ComponentDefinition.Features.SculptFeatures.Add(mySurfaces, False) 'False removes material&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#00ccff"&gt;Debug.Print "sculpt operation performed."&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#00ccff"&gt;&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt;&lt;P&gt;&lt;FONT color="#ff6600"&gt;End Sub&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 26 Oct 2012 08:16:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3674984#M133920</guid>
      <dc:creator>mitcham_boy</dc:creator>
      <dc:date>2012-10-26T08:16:53Z</dc:date>
    </item>
    <item>
      <title>Re: VBA or VB for sculpting overlapping objects in an Assembly??</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3716238#M133921</link>
      <description>&lt;P&gt;I have found the following solution courtesy of Brian Eakin's&amp;nbsp;"API 2011 What's New" .ivb example modules&lt;/P&gt;&lt;P&gt;Clearly it is only valid for 2011 onwards.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;' The following sample demonstrates associatively copying bodies across parts&lt;BR /&gt;' in an assembly.&amp;nbsp; Before running this sample open the sample assembly called&lt;BR /&gt;' CutExample.iam.&amp;nbsp; It can be run on any assembly that contains two parts, but&lt;BR /&gt;' the sample demonstrates a common use of the functionality.&amp;nbsp; The use in this&lt;BR /&gt;' case is to use one part to cut another one, where the positions of the parts&lt;BR /&gt;' are the defined in the assembly but the cut is performed within the part and&lt;BR /&gt;' not as an assembly feature.&lt;BR /&gt;Sub AssociativeBodyCopy()&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Open the existing sample assembly.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim assemblyDoc As AssemblyDocument&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set assemblyDoc = ThisApplication.ActiveDocument&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim assemblyDef As AssemblyComponentDefinition&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set assemblyDef = assemblyDoc.ComponentDefinition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get the first occurrence, which will be treated as the base part.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim baseOcc As ComponentOccurrence&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set baseOcc = assemblyDef.Occurrences.Item(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get the second occurrence, which will be used as the cut tool.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim toolOcc As ComponentOccurrence&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set toolOcc = assemblyDef.Occurrences.Item(2)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get the component definition of the base part.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim baseDef As PartComponentDefinition&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set baseDef = baseOcc.Definition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; '** Create an associative surface base feature in the second part.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Create a definition object in the context of the first part.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim baseFeatureDef As NonParametricBaseFeatureDefinition&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set baseFeatureDef = baseDef.Features.NonParametricBaseFeatures.CreateDefinition&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Add the body of the second part to the list of items to be copied.&amp;nbsp; Since this&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' is getting the body from the occurrence it is actually a SurfaceBodyProxy&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' object in the context of the assembly.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim bodyColl As ObjectCollection&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set bodyColl = ThisApplication.TransientObjects.CreateObjectCollection&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; bodyColl.Add toolOcc.SurfaceBodies.Item(1)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Set up the definition object.&amp;nbsp; When setting the IsAssociative flag to True, the&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Output type must be either a Surface or Composite.&amp;nbsp; A solid is not valid in that case.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; baseFeatureDef.BRepEntities = bodyColl&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; baseFeatureDef.OutputType = kSurfaceOutputType&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; baseFeatureDef.TargetOccurrence = baseOcc&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; baseFeatureDef.IsAssociative = True&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Create the associative copy.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim baseFeature As NonParametricBaseFeature&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set baseFeature = baseDef.Features.NonParametricBaseFeatures.AddByDefinition(baseFeatureDef)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; assemblyDoc.Update&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Get the WorkSurface that was created as a result of the import.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim surface As WorkSurface&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Set surface = baseFeature.SurfaceBody.Parent&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Split the base part using the new surface.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Call baseDef.Features.SplitFeatures.TrimSolid(surface, baseDef.SurfaceBodies.Item(1), False)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ' Turn off the visibilty of the work surface.&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; surface.Visible = False&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ThisApplication.ActiveView.Update&lt;BR /&gt;End Sub&lt;/P&gt;</description>
      <pubDate>Thu, 29 Nov 2012 16:40:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/vba-or-vb-for-sculpting-overlapping-objects-in-an-assembly/m-p/3716238#M133921</guid>
      <dc:creator>mitcham_boy</dc:creator>
      <dc:date>2012-11-29T16:40:53Z</dc:date>
    </item>
  </channel>
</rss>

