<?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: SurfaceSurfaceIntersection with two cylinders returns null in Inventor Programming Forum</title>
    <link>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684177#M11655</link>
    <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7813639"&gt;@eric.mathews7BV6E&lt;/a&gt;.&amp;nbsp; This might possibly just be a case of accuracy.&amp;nbsp; For instance, the Double data type can hold values all the way out to around 15 places to the right of the decimal point.&amp;nbsp; If the values are not an exact match, then it may not be finding the intersection.&amp;nbsp; Also, in your last line of code, where it is using the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=TransientGeometry_SurfaceSurfaceIntersection" target="_blank" rel="noopener"&gt;TransientGeometry.SurfaceSurfaceIntersection&lt;/A&gt;&amp;nbsp;method, try specifying a tolerance as the third input, such as "0.01" (without the quotes).&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 13:59:24 GMT</pubDate>
    <dc:creator>WCrihfield</dc:creator>
    <dc:date>2024-04-03T13:59:24Z</dc:date>
    <item>
      <title>SurfaceSurfaceIntersection with two cylinders returns null</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12682207#M11654</link>
      <description>&lt;P&gt;I'm trying to find the intersection between two cylinders using the "SurfaceSurfaceIntersection" transient geometry tool. The help file is a little lacking. I have to assume the cylinder object starts at the "BasePoint" and extends forever in the specified "Direction". I don't know if this is true or not. However; I've played around with the input objects, changing the direction of the cylinder, and it always returns null, regardless of the inputs. What am I doing wrong?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This png file illustrates the two cylinders. The opening cylinder is the hole on the right side of the rolled or casing cylinder. They intersect in the model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="general"&gt;TransientGeometry _tg = Inventor.Application.TransientGeometry;

// Set a reference to the opening cylinder axis.
// This is a 30° line extending to the right.
LineSegment _openingAxis = _tg.CreateLineSegment(_tg.CreatePoint(0, 0, 0), _tg.CreatePoint(59.392058, 34.29, 0));

// Set a reference to the opening cylinder.
Cylinder _openingCylinder = _tg.CreateCylinder(_openingAxis.StartPoint, _openingAxis.Direction, 2.12 / 2);

// Set a reference to the case cylinder. 
// I've tried 1 and -1 for the Z-Axis value.
 Cylinder _caseCylinder = _tg.CreateCylinder(_tg.CreatePoint(0, 0,0), _tg.CreateUnitVector(0, 0, -1), 37 / 2);

// Set a reference to the intersection object. This always returns null.
ObjectsEnumerator _objects = _tg.SurfaceSurfaceIntersection(_openingCylinder, _caseCylinder);&lt;/LI-CODE&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;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 02 Apr 2024 19:48:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12682207#M11654</guid>
      <dc:creator>eric.mathews7BV6E</dc:creator>
      <dc:date>2024-04-02T19:48:50Z</dc:date>
    </item>
    <item>
      <title>Re: SurfaceSurfaceIntersection with two cylinders returns null</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684177#M11655</link>
      <description>&lt;P&gt;hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7813639"&gt;@eric.mathews7BV6E&lt;/a&gt;.&amp;nbsp; This might possibly just be a case of accuracy.&amp;nbsp; For instance, the Double data type can hold values all the way out to around 15 places to the right of the decimal point.&amp;nbsp; If the values are not an exact match, then it may not be finding the intersection.&amp;nbsp; Also, in your last line of code, where it is using the&amp;nbsp;&lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=TransientGeometry_SurfaceSurfaceIntersection" target="_blank" rel="noopener"&gt;TransientGeometry.SurfaceSurfaceIntersection&lt;/A&gt;&amp;nbsp;method, try specifying a tolerance as the third input, such as "0.01" (without the quotes).&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 13:59:24 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684177#M11655</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-04-03T13:59:24Z</dc:date>
    </item>
    <item>
      <title>Re: SurfaceSurfaceIntersection with two cylinders returns null</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684210#M11656</link>
      <description>&lt;P&gt;I appreciate the response. I've tried all kinds of craziness including a tolerance up to 0.1. Evidently, the surface intersection function is bugged when a cylinder is involved. I've tested it against a plane object and it returns null as well, but two plane objects return an intersection.&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;        static void _geometricObjectsTest()
        {
            TransientGeometry _tg = _inventor.Application.TransientGeometry;

            // Set a reference to the opening cylinder axis.
            // This is a 30° line extending to the right.
            // I've used Z-Axis values ranging from 10000 to -10000 and the CurveSurfaceIntersection function always works.
            LineSegment _openingAxis = _tg.CreateLineSegment(_tg.CreatePoint(0, 0, 0), _tg.CreatePoint(59.392058, 34.29, 0));

            Circle _circle = _tg.CreateCircle(_tg.CreatePoint(0, 0, 0), _tg.CreateUnitVector(0, 0, -1), 37 / 2);

            ObjectsEnumerator _objects = _tg.CurveCurveIntersection(_openingAxis, _circle);

            foreach (object _item in _objects)
            { Point _p = (Point)_item; }

            // Set a reference to the opening cylinder.
            Cylinder _openingCylinder = _tg.CreateCylinder(_openingAxis.StartPoint, _openingAxis.Direction, 2.12 / 2);

            // Set a reference to the case cylinder. 
            // I've tried 1 and -1 for the Z-Axis value.
            Cylinder _caseCylinder = _tg.CreateCylinder(_tg.CreatePoint(0, 0, 0), _tg.CreateUnitVector(0, 0, -1), 37 / 2);

            Plane _p1 = _tg.CreatePlane(_tg.CreatePoint(0, 0, 0), _tg.CreateVector(0, 1, 0));
            Plane _p2 = _tg.CreatePlane(_tg.CreatePoint(0, 0, 0), _tg.CreateVector(1, 0, 0));

            // Returns null.
            //ObjectsEnumerator _surfaceObjects = _tg.SurfaceSurfaceIntersection(_openingCylinder, _caseCylinder);

            // Returns null.
            // ObjectsEnumerator _surfaceObjects = _tg.SurfaceSurfaceIntersection(_openingCylinder, _p2);

            // Works!
            ObjectsEnumerator _surfaceObjects = _tg.SurfaceSurfaceIntersection(_p1, _p2);

            foreach (object _item in _surfaceObjects)
            { Point _p = (Point)_item; }

            ObjectsEnumerator _curveObjects = _tg.CurveSurfaceIntersection(_openingAxis, _caseCylinder);

            foreach (object _item in _curveObjects)
            { Point _p = (Point)_item; }
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 14:09:56 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684210#M11656</guid>
      <dc:creator>eric.mathews7BV6E</dc:creator>
      <dc:date>2024-04-03T14:09:56Z</dc:date>
    </item>
    <item>
      <title>Re: SurfaceSurfaceIntersection with two cylinders returns null</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684288#M11657</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/7813639"&gt;@eric.mathews7BV6E&lt;/a&gt;.&amp;nbsp; Just as a test on my end, I started a new, empty part document.&amp;nbsp; Then created two separate 2D sketches on the same origin WorkPlane, containing just one circle each, with the second circle overlapping the first circle a bit.&amp;nbsp; Then I extruded each circle separately, as a surface (instead of solid), at same height and direction.&amp;nbsp; Then I typed up this iLogic rule to try this method on those two cylinder faces.&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_0-1712154554006.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1345274i6FFA48111D993442/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_0-1712154554006.png" alt="WCrihfield_0-1712154554006.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;LI-CODE lang="general"&gt;Dim oPDoc As PartDocument = ThisDoc.Document
Dim oPDef As PartComponentDefinition = oPDoc.ComponentDefinition
Dim oWSurfaces As WorkSurfaces = oPDef.WorkSurfaces
Dim oWS1 As WorkSurface = oWSurfaces.Item(1)
Dim oWS2 As WorkSurface = oWSurfaces.Item(2)
Dim oCyl1 As Inventor.Cylinder = oWS1.SurfaceBodies.Item(1).Faces.Item(1).Geometry
Dim oCyl2 As Inventor.Cylinder = oWS2.SurfaceBodies.Item(1).Faces.Item(1).Geometry
Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
Dim oObjsEnum As ObjectsEnumerator = Nothing
Try
	oObjsEnum = oTG.SurfaceSurfaceIntersection(oCyl1, oCyl2, 0.01)
Catch e As Exception
	Logger.Error(e.Message &amp;amp; vbCrLf &amp;amp; e.StackTrace)
End Try
If oObjsEnum IsNot Nothing AndAlso oObjsEnum.Count &amp;gt; 0 Then
	For Each oObj In oObjsEnum
		Logger.Info("TypeName(oObj) = " &amp;amp; TypeName(oObj))
	Next 'oObj
End If&lt;/LI-CODE&gt;
&lt;P&gt;...and when I ran it, I got the following results in the iLogic Log window.&amp;nbsp; This just proves that this method will work on two cylinder objects that have parallel axis, and their outer surfaces intersect each other in Inventor 2024.0.1.&amp;nbsp; I have not tested if the two cylinders were perpendicular axis to each other yet.&lt;/P&gt;
&lt;P&gt;INFO| 9: &amp;gt;&amp;gt;---------------------------&lt;BR /&gt;INFO|TypeName(oObj) = Line&lt;BR /&gt;INFO|TypeName(oObj) = Line&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 14:32:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684288#M11657</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-04-03T14:32:34Z</dc:date>
    </item>
    <item>
      <title>Re: SurfaceSurfaceIntersection with two cylinders returns null</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684321#M11658</link>
      <description>&lt;P&gt;Follow-up...&lt;/P&gt;
&lt;P&gt;I just modified those two original WorkSurfaces so that one is perpendicular to the other, and both cylinder surfaces completely intersect with each other (not just partially).&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="WCrihfield_0-1712155480248.png" style="width: 999px;"&gt;&lt;img src="https://forums.autodesk.com/t5/image/serverpage/image-id/1345282i9DF8CD876E729FA6/image-size/large?v=v2&amp;amp;px=999" role="button" title="WCrihfield_0-1712155480248.png" alt="WCrihfield_0-1712155480248.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;Then I ran the same exact iLogic rule on them, and got the following result.&lt;/P&gt;
&lt;P&gt;INFO| 10: &amp;gt;&amp;gt;---------------------------&lt;BR /&gt;INFO|TypeName(oObj) = BSplineCurve&lt;BR /&gt;INFO|TypeName(oObj) = BSplineCurve&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 14:45:05 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684321#M11658</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-04-03T14:45:05Z</dc:date>
    </item>
    <item>
      <title>Re: SurfaceSurfaceIntersection with two cylinders returns null</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684349#M11659</link>
      <description>&lt;P&gt;If I change them so that one cylinder is concentric to the other, but one is smaller than the other, there will not be any intersection.&amp;nbsp; This seems like what may have been going on in your first code here, because it looked like the second cylinder was being defined along the same axis, but with a different radius, as the first cylinder.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 14:52:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684349#M11659</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-04-03T14:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: SurfaceSurfaceIntersection with two cylinders returns null</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684362#M11660</link>
      <description>Okay, apparently, the cylinders must be created from geometry in a model for the SurfaceSurfaceIntersection function to work properly. And pure mathmatical cylinders created by the transient geometry aren't acceptable arguments for that function.</description>
      <pubDate>Wed, 03 Apr 2024 14:55:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684362#M11660</guid>
      <dc:creator>eric.mathews7BV6E</dc:creator>
      <dc:date>2024-04-03T14:55:15Z</dc:date>
    </item>
    <item>
      <title>Re: SurfaceSurfaceIntersection with two cylinders returns null</title>
      <link>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684755#M11661</link>
      <description>&lt;P&gt;Oddly enough, I am getting the same results as you, when both Cylinder objects are created using the &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=TransientGeometry_CreateCylinder" target="_blank" rel="noopener"&gt;TransientGeometry.CreateCylinder&lt;/A&gt; method.&amp;nbsp; I must have tried around 40 or more permutations of point locations, &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-UnitVector" target="_blank" rel="noopener"&gt;UnitVector&lt;/A&gt; variations, and radius variations, and kept getting no intersections.&amp;nbsp; This does not seem right, since it says that Cylinder objects are one of the types allowed as input, and &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=GUID-Cylinder" target="_blank" rel="noopener"&gt;Cylinder&lt;/A&gt; objects themselves are 'transient' mathematical objects, and the Cylinder object does not appear to have any 'length' (along its axis), and only &lt;A href="https://help.autodesk.com/view/INVNTOR/2024/ENU/?guid=Cylinder_AxisVector" target="_blank" rel="noopener"&gt;direction&lt;/A&gt;&amp;nbsp;(always just 1 unit in length).&amp;nbsp; This may be a bug in that method, not sure.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 17:51:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/inventor-programming-forum/surfacesurfaceintersection-with-two-cylinders-returns-null/m-p/12684755#M11661</guid>
      <dc:creator>WCrihfield</dc:creator>
      <dc:date>2024-04-03T17:51:10Z</dc:date>
    </item>
  </channel>
</rss>

