Detection of closed loops in a sketch via iLogic.

Detection of closed loops in a sketch via iLogic.

Diego_CamachoGomez
Community Visitor Community Visitor
242 Views
1 Reply
Message 1 of 2

Detection of closed loops in a sketch via iLogic.

Diego_CamachoGomez
Community Visitor
Community Visitor

Hello,

I am encountering a significant issue when attempting to automate the analysis of cross-sectional sketches generated in Autodesk Inventor 2025 via iLogic scripting.

Context:

  • I use the “Project Cut Edges” feature on a planar offset from a base plane to create sketches representing cross sections of a solid part.

  • These sketches clearly show multiple closed loops (profiles and internal “islands”) which:

    • Can be individually selected via the UI (Region Properties window),

    • Can be extruded separately,

    • Display area and other properties correctly in the user interface.

Issue:

  • When accessing these sketches programmatically through the iLogic API, the Profiles collection of the sketch always returns empty (zero profiles), despite the loops visibly existing and being valid.

  • Attempts to use SketchLoops or other collections to iterate through the internal loop geometry fail because these types are not accessible or defined in iLogic/VB.

  • Forcing geometry to convert from reference to real, running Sketch Doctor, or rebuilding the sketch does not resolve the API’s inability to detect these profiles.

  • This discrepancy between manual UI recognition of profiles and API access severely limits the ability to automate area calculations or cross section reports.

What I have tried:

  • Using Project Cut Edges to generate the projected sketch,

  • Inspecting the loops manually,

  • Running Sketch Doctor to ensure no open or dangling edges,

  • Forcing document updates and sketch edit cycles,

  • Attempting to access SketchLoops and region properties programmatically (not supported),

  • Converting all construction/reference lines to real geometry (no effect).

Outcome:

Still no profiles are reported by the API, making area calculations impossible to automate directly.

Request for assistance:

  • Has anyone successfully accessed “Project Cut Edges” generated loops via Inventor iLogic API?

  • Is there a recommended workaround or best practice to extract the area of all internal/external loops programmatically?

  • Are there plans to expose SketchLoops or Region Properties collections in the API for future Inventor versions?

  • Suggestions to help automate this process fully within Inventor would be appreciated.

Thank you in advance for any insights.

0 Likes
243 Views
1 Reply
Reply (1)
Message 2 of 2

J-Camper
Advisor
Advisor

I believe the Profiles Count will be zero until they get added.  Try using this method [Profiles.AddForSolid] on the sketch before checking the count:


https://help.autodesk.com/view/INVNTOR/2023/ENU/?guid=GUID-5A9FA7CB-1EB9-4849-BB9D-11AD01F3DBF6

You will likely want to choose "false" for the combine input so you only get closed loops.

0 Likes