INVENTOR API - WHAT HAPPENED TO APPCMD COPY AND PASTE

INVENTOR API - WHAT HAPPENED TO APPCMD COPY AND PASTE

cburton72
Contributor Contributor
714 Views
8 Replies
Message 1 of 9

INVENTOR API - WHAT HAPPENED TO APPCMD COPY AND PASTE

cburton72
Contributor
Contributor

IN 2018 THE APPCMD FOR COPY AND PASTE FIRE EVENTS AND ARE USABLE THROUGH .NET.

IN 2020 THESE DO NOT FIRE AND ARE NOT USABLE.

 

I CANNOT UPDATE MY SOFTWARE TO 2020 DUE TO THIS ISSUE.  PLEASE PROVIDE A WORK AROUND OR FIX 2020 TO ALLOW APPCMD TO WORK AGAIN PROPERLY.

0 Likes
715 Views
8 Replies
Replies (8)
Message 2 of 9

WCrihfield
Mentor
Mentor

Do you mean "AppCopyCmd" & "AppCutCmd" & "AppPasteCmd", "AppPasteSpecialCmd"?

I have Inventor Pro 2021, and those commands are still in there.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 3 of 9

cburton72
Contributor
Contributor

Dim oCopyCmd As ControlDefinition
oCopyCmd = mInventorApp.CommandManager.ControlDefinitions.Item("AppCopyCmd")

oCopyCmd.Execute()

 

This no longer executes in 2020.

If you check the user events through the event viewer tool they do not fire.

0 Likes
Message 4 of 9

cburton72
Contributor
Contributor

I also tried to manually perform the copy and paste through the  interface and that did not fire also.

Windows 10 64 bit.  All updates were done.

You could do the process....as in right click a view with a section and copy that to a new sheet.   The user event tool provided by Autodesk did not register an event being fired where in 2018 it would.

0 Likes
Message 5 of 9

WCrihfield
Mentor
Mentor

Hmm.. When I open my Event Watcher tool, I don't see an event for Copy or Paste.  I never paid attention to that before.  If it was present in the 2018 version, but not in the 2020 version.  Can you post a screen shot of your Event Watcher's screen from your 2018 install, that shows those events in the list?

Or have you customized the code of your Event Watcher tool, to add those events?

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 6 of 9

sgodonVEAP9
Contributor
Contributor

maybe a bit off topic but anyway to trigger "paste link" and "OK" after:

 

ThisApplication.CommandManager.ControlDefinitions.Item("AppPasteSpecialCmd").Execute

 

sgodonVEAP9_0-1669906420610.png

 

thanks!

 

0 Likes
Message 7 of 9

WCrihfield
Mentor
Mentor

Hi @sgodonVEAP9.  The only way I can think of to manipulate that dialog after executing the command would be to use System.Windows.Forms.SendKeys.SendWait() method, which could act similar to simulating keyboard key presses, which you could use to navigate around the dialog.  First, try to navigate around that dialog by using keyboard keys only.  Once you figure out the exact keyboard key routine that needs to happen, write that down, then use that SendKeys.SendWait method to simulate that routine after executing the command.  It is always risky to use, and should be a last resort though.

Wesley Crihfield

EESignature

(Not an Autodesk Employee)

0 Likes
Message 8 of 9

sgodonVEAP9
Contributor
Contributor
WCrihfield, that would be perfect but the code stops at this line:

ThisApplication.CommandManager.ControlDefinitions.Item("AppPasteSpecialCmd").Execute

so it doesn't continue to do the send keys 😞 do you know how to write that down? thanks!
0 Likes
Message 9 of 9

sgodonVEAP9
Contributor
Contributor

Here's the answer if it can help others:

 

Call ThisApplication.CommandManager.ControlDefinitions.Item("AppPasteSpecialCmd").Execute2(False)
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{TAB}", True
SendKeys "{DOWN}", True
SendKeys "~", True

 

0 Likes