Retrieve the current directory of an open project in Ansys Space Claim with C#

Ansys Staff
Ansys Staff Member, Employee Posts: 27
Ansys Employee Name Dropper First Comment Photogenic
edited June 2023 in 3D Design

How can I retrieve the current directory of an open project in Ansys Space Claim in C#.

This is for a personalized tool embedded in the tool bar.

Answers

  • Valérie Gelbgras
    Valérie Gelbgras Member, Employee Posts: 156
    Photogenic First Anniversary Ansys Employee Solution Developer Community of Practice Member
    Answer ✓

    With .Path from the document. Here is an example:

    var window = Window.ActiveWindow;
    var doc = window?.Document;
    string docPath = doc.Path;