<?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: internal validation error when analysing interference multiple times in a sc in Fusion API and Scripts Forum</title>
    <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/internal-validation-error-when-analysing-interference-multiple/m-p/6054788#M20312</link>
    <description>&lt;P&gt;In the mean time is there a work around that would could calculate the interference of these bodies?&lt;/P&gt;</description>
    <pubDate>Wed, 24 Feb 2016 17:05:54 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2016-02-24T17:05:54Z</dc:date>
    <item>
      <title>internal validation error when analysing interference multiple times in a script</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/internal-validation-error-when-analysing-interference-multiple/m-p/6053349#M20310</link>
      <description>&lt;P&gt;I'm experimenting with different uses of the interference calculation in Fusion 360.&lt;/P&gt;&lt;P&gt;One example I'm trying to create is generating the interference of an interfernce body. For example if you create a venn diagram with 3 triangulated circles you get an interior intersection of the 3 circles and 3 outer portions that are the intersection of only two models. I try to create this using this code (below) but I get a InternalValidationError. What is causing this error. I have similar issues in other scripts wheverer I try to calculate and interference multiple times.&lt;IMG src="https://forums.autodesk.com/t5/image/serverpage/image-id/220018iCDEC8CABC0F99ADD/image-size/original?v=mpbl-1&amp;amp;px=-1" alt="Capture.PNG" title="Capture.PNG" border="0" /&gt;&lt;/P&gt;&lt;PRE&gt;def run(context):
    ui = None
    try:
        global app
        app = adsk.core.Application.get()
        global ui
        ui  = app.userInterface


        # Create a document.
        doc = app.documents.add(adsk.core.DocumentTypes.FusionDesignDocumentType)

        product = app.activeProduct
        design = adsk.fusion.Design.cast(product)
        design.designType = adsk.fusion.DesignTypes.DirectDesignType

        # Get the root component of the active design.
        rootComp = design.rootComponent
        features = rootComp.features

        # Create sketch circle on the xz plane.
        sketches = rootComp.sketches
        sketch = sketches.add(rootComp.xZConstructionPlane)
        sketchCircles = sketch.sketchCurves.sketchCircles
        centerPoint = adsk.core.Point3D.create(0, 0, 0)
        sketchCircles.addByCenterRadius(centerPoint, 10)

        # Create a collection of entities for extrude
        entities0 = adsk.core.ObjectCollection.create()
        entities0.add(sketch.profiles.item(0))

        # Create a cylinder with ExtrudeFeature using the profile above.
        extrudeFeats = features.extrudeFeatures
        extrudeFeatureInput = extrudeFeats.createInput(entities0, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
        extrudeFeatureInput.isSolid = True
        extrudeFeatureInput.setDistanceExtent(False, adsk.core.ValueInput.createByReal(2.5))
        extrudeFeature = extrudeFeats.add(extrudeFeatureInput)
        
        # Create second body to do interference
        sketch = sketches.add(rootComp.xZConstructionPlane)
        sketchCircles = sketch.sketchCurves.sketchCircles
        centerPoint = adsk.core.Point3D.create(5, 0, 0)
        sketchCircles.addByCenterRadius(centerPoint, 10)

        entities0.clear()
        entities0.add(sketch.profiles.item(0))

        # Create a cylinder with ExtrudeFeature using the profile above.
        extrudeFeatureInput = extrudeFeats.createInput(entities0, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
        extrudeFeatureInput.isSolid = True
        extrudeFeatureInput.setDistanceExtent(False, adsk.core.ValueInput.createByReal(2.5))
        extrudeFeature = extrudeFeats.add(extrudeFeatureInput)
        sketch = sketches.add(rootComp.xZConstructionPlane)
        sketchCircles = sketch.sketchCurves.sketchCircles
        centerPoint = adsk.core.Point3D.create(0, 5, 0)
        sketchCircles.addByCenterRadius(centerPoint, 10)

        entities0.clear()
        entities0.add(sketch.profiles.item(0))

        # Create a cylinder with ExtrudeFeature using the profile above.
        extrudeFeatureInput = extrudeFeats.createInput(entities0, adsk.fusion.FeatureOperations.NewBodyFeatureOperation)
        extrudeFeatureInput.isSolid = True
        extrudeFeatureInput.setDistanceExtent(False, adsk.core.ValueInput.createByReal(2.5))
        extrudeFeature = extrudeFeats.add(extrudeFeatureInput)
        

        # Create a collection of bodies
        bodies = adsk.core.ObjectCollection.create()
        for body in rootComp.bRepBodies:
            bodies.add(body)

        # Create InterferenceInput
        interferencInput = design.createInterferenceInput(bodies)

        # Analyze interference
        results = design.analyzeInterference(interferencInput)
        results.createBodies(True)
        
        intersection = rootComp.occurrences.item(0)
        newBodies = adsk.core.ObjectCollection.create()
        for body in intersection.component.bRepBodies:
            newBodies.add(body)
        #get next level of interference    
        interferenceInput0 = design.createInterferenceInput(newBodies)
        results1 = design.analyzeInterference(interferenceInput0)
        results.createBodies(True)&lt;/PRE&gt;</description>
      <pubDate>Tue, 23 Feb 2016 21:38:48 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/internal-validation-error-when-analysing-interference-multiple/m-p/6053349#M20310</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-23T21:38:48Z</dc:date>
    </item>
    <item>
      <title>Re: internal validation error when analysing interference multiple times in a sc</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/internal-validation-error-when-analysing-interference-multiple/m-p/6053638#M20311</link>
      <description>Hello, we are sorry you are having issues with this API, we have identified the problem and will provide a fix as soon as we can.</description>
      <pubDate>Wed, 24 Feb 2016 01:47:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/internal-validation-error-when-analysing-interference-multiple/m-p/6053638#M20311</guid>
      <dc:creator>frankzhang</dc:creator>
      <dc:date>2016-02-24T01:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: internal validation error when analysing interference multiple times in a sc</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/internal-validation-error-when-analysing-interference-multiple/m-p/6054788#M20312</link>
      <description>&lt;P&gt;In the mean time is there a work around that would could calculate the interference of these bodies?&lt;/P&gt;</description>
      <pubDate>Wed, 24 Feb 2016 17:05:54 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/internal-validation-error-when-analysing-interference-multiple/m-p/6054788#M20312</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-24T17:05:54Z</dc:date>
    </item>
    <item>
      <title>Re: internal validation error when analysing interference multiple times in a sc</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/internal-validation-error-when-analysing-interference-multiple/m-p/6055570#M20313</link>
      <description>&lt;P&gt;One workaround is to add two lines in your code as shown below in red:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;# Analyze interference&lt;/P&gt;
&lt;P&gt;results = design.analyzeInterference(interferencInput)&lt;/P&gt;
&lt;P&gt;results.createBodies(True)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;del interferencInput&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#FF0000"&gt;del results&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;intersection = rootComp.occurrences.item(0)&lt;/P&gt;
&lt;P&gt;newBodies = adsk.core.ObjectCollection.create()&lt;/P&gt;
&lt;P&gt;for body in intersection.component.bRepBodies:&lt;/P&gt;
&lt;P&gt;newBodies.add(body)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;#get next level of interference&lt;/P&gt;
&lt;P&gt;interferenceInput0 = design.createInterferenceInput(newBodies)&lt;/P&gt;
&lt;P&gt;results1 = design.analyzeInterference(interferenceInput0)&lt;/P&gt;
&lt;P&gt;results1.createBodies(True)&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 03:38:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/internal-validation-error-when-analysing-interference-multiple/m-p/6055570#M20313</guid>
      <dc:creator>frankzhang</dc:creator>
      <dc:date>2016-02-25T03:38:39Z</dc:date>
    </item>
    <item>
      <title>Re: internal validation error when analysing interference multiple times in a sc</title>
      <link>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/internal-validation-error-when-analysing-interference-multiple/m-p/6056207#M20314</link>
      <description>&lt;P&gt;Thank you that seems to work. Unfortunatly it does cost the data in results but I suppose I can save that to other data fields if&amp;nbsp; I need it.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 14:06:02 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/fusion-api-and-scripts-forum/internal-validation-error-when-analysing-interference-multiple/m-p/6056207#M20314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2016-02-25T14:06:02Z</dc:date>
    </item>
  </channel>
</rss>

