How do I copy some text to the clipboard from Mechanical?

Options
Pierre Thieffry
Pierre Thieffry Member, Moderator, Employee Posts: 98
First Anniversary Ansys Employee Solution Developer Community of Practice Member Photogenic
edited June 2023 in Structures

How can we make some text available to the user from the clipboard?

Tagged:

Answers

  • James Derrick
    James Derrick Administrator, Employee Posts: 248
    First Anniversary Solution Developer Community of Practice Member Ansys Employee 5 Up Votes
    admin
    Options

    Hi @Pierre Thieffry Can you move your answer to an answer and accept it please? At the moment this question looks unanswered so people aren't likely to realise it is a solved problem!

  • Pierre Thieffry
    Pierre Thieffry Member, Moderator, Employee Posts: 98
    First Anniversary Ansys Employee Solution Developer Community of Practice Member Photogenic
    Answer ✓
    Options

    Fairly simple code...

    clr.AddReference('System.Windows.Forms')
    from System.Windows.Forms import Clipboard
    
    Clipboard.SetText('My text to the clipboard)