Shortcut.

Shortcut.

Anonymous
Not applicable
695 Views
10 Replies
Message 1 of 11

Shortcut.

Anonymous
Not applicable
Maybe wrong group but anyway...........

I have done a add-in with a couple of buttons in the Panel Bar. (I'm
running
Win XP Pro + Inv.10 SP1)
I would like to have a "shortcut" to some of the buttons in the Panel Bar
so
I added a shortcut to one of the buttons by adding the shortcut in
Tools/Customize/Commands. I selected "add-ins" and added ALT+CTRL+P to one
of the buttons and it's working fine.
The problem is that after restarting Inventor the shortcut is gone, is it
a
bug or do I something wrong?
I did the same thing to a macro and then Inventor remember it's shortcut,
no
problem at all.
Is it possible to add the shortcut in the add-in?

Lars
0 Likes
696 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable
There isn't currently an API to assign shortcuts, so you will need to do
that manually. The shortcuts should be persisted across sessions. I'm not
sure why yours doesn't. Perhaps Inventor is not shutting down fully due to
outstanding references? (The persistence to registry happens during shut
down, so if there are problems during shut down, the shortcuts won't be
remembered).

Sanjay-

"Lars Andersson" wrote in message
news:4927078@discussion.autodesk.com...
Maybe wrong group but anyway...........

I have done a add-in with a couple of buttons in the Panel Bar. (I'm
running
Win XP Pro + Inv.10 SP1)
I would like to have a "shortcut" to some of the buttons in the Panel Bar
so
I added a shortcut to one of the buttons by adding the shortcut in
Tools/Customize/Commands. I selected "add-ins" and added ALT+CTRL+P to one
of the buttons and it's working fine.
The problem is that after restarting Inventor the shortcut is gone, is it
a
bug or do I something wrong?
I did the same thing to a macro and then Inventor remember it's shortcut,
no
problem at all.
Is it possible to add the shortcut in the add-in?

Lars
0 Likes
Message 3 of 11

Anonymous
Not applicable
Thanks Sanjay, that could be the problem.
I have two processes called AdskCleanup.0001 (176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb) running after closing Inventor.
Strange thing is that it worked on a macro.
I will look into this tomorrow.

Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4927691@discussion.autodesk.com...
There isn't currently an API to assign shortcuts, so you will need to do
that manually. The shortcuts should be persisted across sessions. I'm not
sure why yours doesn't. Perhaps Inventor is not shutting down fully due to
outstanding references? (The persistence to registry happens during shut
down, so if there are problems during shut down, the shortcuts won't be
remembered).

Sanjay-

"Lars Andersson" wrote in message
news:4927078@discussion.autodesk.com...
Maybe wrong group but anyway...........

I have done a add-in with a couple of buttons in the Panel Bar. (I'm
running
Win XP Pro + Inv.10 SP1)
I would like to have a "shortcut" to some of the buttons in the Panel Bar
so
I added a shortcut to one of the buttons by adding the shortcut in
Tools/Customize/Commands. I selected "add-ins" and added ALT+CTRL+P to one
of the buttons and it's working fine.
The problem is that after restarting Inventor the shortcut is gone, is it
a
bug or do I something wrong?
I did the same thing to a macro and then Inventor remember it's shortcut,
no
problem at all.
Is it possible to add the shortcut in the add-in?

Lars
0 Likes
Message 4 of 11

Anonymous
Not applicable
Sanjay,

I have gone through all code in my add-in and found a couple objects not set
to "Nothing".
All Inventor processes seams now to be closed but my problem is still there,
no shortcuts remembered!

I know this is maybe a bad idea but, is it possible to "set" the shortcuts
manually with a ".reg" or by VB-code?

Lars


"Lars Andersson" skrev i meddelandet
news:4927853@discussion.autodesk.com...
Thanks Sanjay, that could be the problem.
I have two processes called AdskCleanup.0001 (176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb) running after closing Inventor.
Strange thing is that it worked on a macro.
I will look into this tomorrow.

Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4927691@discussion.autodesk.com...
There isn't currently an API to assign shortcuts, so you will need to do
that manually. The shortcuts should be persisted across sessions. I'm not
sure why yours doesn't. Perhaps Inventor is not shutting down fully due to
outstanding references? (The persistence to registry happens during shut
down, so if there are problems during shut down, the shortcuts won't be
remembered).

Sanjay-

"Lars Andersson" wrote in message
news:4927078@discussion.autodesk.com...
Maybe wrong group but anyway...........

I have done a add-in with a couple of buttons in the Panel Bar. (I'm
running
Win XP Pro + Inv.10 SP1)
I would like to have a "shortcut" to some of the buttons in the Panel Bar
so
I added a shortcut to one of the buttons by adding the shortcut in
Tools/Customize/Commands. I selected "add-ins" and added ALT+CTRL+P to one
of the buttons and it's working fine.
The problem is that after restarting Inventor the shortcut is gone, is it
a
bug or do I something wrong?
I did the same thing to a macro and then Inventor remember it's shortcut,
no
problem at all.
Is it possible to add the shortcut in the add-in?

Lars
0 Likes
Message 5 of 11

Anonymous
Not applicable
One thing to try is to assign a shortcut to one of the commands of a sample
AddIn supplied in the SDK. Say,

...Autodesk\Inventor 10\SDK\Samples\VB\AddIns\SimpleAddIn

This should work fine. And then see what you are doing different.

Sanjay-


"Lars Andersson" wrote in message
news:4928282@discussion.autodesk.com...
Sanjay,

I have gone through all code in my add-in and found a couple objects not set
to "Nothing".
All Inventor processes seams now to be closed but my problem is still there,
no shortcuts remembered!

I know this is maybe a bad idea but, is it possible to "set" the shortcuts
manually with a ".reg" or by VB-code?

Lars


"Lars Andersson" skrev i meddelandet
news:4927853@discussion.autodesk.com...
Thanks Sanjay, that could be the problem.
I have two processes called AdskCleanup.0001 (176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb) running after closing Inventor.
Strange thing is that it worked on a macro.
I will look into this tomorrow.

Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4927691@discussion.autodesk.com...
There isn't currently an API to assign shortcuts, so you will need to do
that manually. The shortcuts should be persisted across sessions. I'm not
sure why yours doesn't. Perhaps Inventor is not shutting down fully due to
outstanding references? (The persistence to registry happens during shut
down, so if there are problems during shut down, the shortcuts won't be
remembered).

Sanjay-

"Lars Andersson" wrote in message
news:4927078@discussion.autodesk.com...
Maybe wrong group but anyway...........

I have done a add-in with a couple of buttons in the Panel Bar. (I'm
running
Win XP Pro + Inv.10 SP1)
I would like to have a "shortcut" to some of the buttons in the Panel Bar
so
I added a shortcut to one of the buttons by adding the shortcut in
Tools/Customize/Commands. I selected "add-ins" and added ALT+CTRL+P to one
of the buttons and it's working fine.
The problem is that after restarting Inventor the shortcut is gone, is it
a
bug or do I something wrong?
I did the same thing to a macro and then Inventor remember it's shortcut,
no
problem at all.
Is it possible to add the shortcut in the add-in?

Lars
0 Likes
Message 6 of 11

Anonymous
Not applicable
Sanjay,

Hmmm, I found something that I have missed, the "delete the button
definitions". (I had only set them to "Nothing")
But that didn't help........... I will make more tries tomorrow to run the
sample.

Just a comment in the sample you mentioned, the "oButtonDefToggleSlotState"
is not set to Nothing in "ApplicationAddInServer_Deactivate()"

Regards
Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4928863@discussion.autodesk.com...
One thing to try is to assign a shortcut to one of the commands of a sample
AddIn supplied in the SDK. Say,

...Autodesk\Inventor 10\SDK\Samples\VB\AddIns\SimpleAddIn

This should work fine. And then see what you are doing different.

Sanjay-


"Lars Andersson" wrote in message
news:4928282@discussion.autodesk.com...
Sanjay,

I have gone through all code in my add-in and found a couple objects not set
to "Nothing".
All Inventor processes seams now to be closed but my problem is still there,
no shortcuts remembered!

I know this is maybe a bad idea but, is it possible to "set" the shortcuts
manually with a ".reg" or by VB-code?

Lars


"Lars Andersson" skrev i meddelandet
news:4927853@discussion.autodesk.com...
Thanks Sanjay, that could be the problem.
I have two processes called AdskCleanup.0001 (176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb) running after closing Inventor.
Strange thing is that it worked on a macro.
I will look into this tomorrow.

Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4927691@discussion.autodesk.com...
There isn't currently an API to assign shortcuts, so you will need to do
that manually. The shortcuts should be persisted across sessions. I'm not
sure why yours doesn't. Perhaps Inventor is not shutting down fully due to
outstanding references? (The persistence to registry happens during shut
down, so if there are problems during shut down, the shortcuts won't be
remembered).

Sanjay-

"Lars Andersson" wrote in message
news:4927078@discussion.autodesk.com...
Maybe wrong group but anyway...........

I have done a add-in with a couple of buttons in the Panel Bar. (I'm
running
Win XP Pro + Inv.10 SP1)
I would like to have a "shortcut" to some of the buttons in the Panel Bar
so
I added a shortcut to one of the buttons by adding the shortcut in
Tools/Customize/Commands. I selected "add-ins" and added ALT+CTRL+P to one
of the buttons and it's working fine.
The problem is that after restarting Inventor the shortcut is gone, is it
a
bug or do I something wrong?
I did the same thing to a macro and then Inventor remember it's shortcut,
no
problem at all.
Is it possible to add the shortcut in the add-in?

Lars
0 Likes
Message 7 of 11

Anonymous
Not applicable
Isn't the purpose of the garbage collector to take care of freeing up the
memory for objects when it determines that they are no longer being used? I
am under the impression that we don't have to worry about explicitly freeing
up managed objects. Did you notice a problem (e.g. a memory leak) if you
don't set it to Nothing?

Thanks,
Venkatesh.


"Lars Andersson" wrote in message
news:4929051@discussion.autodesk.com...
Sanjay,

Hmmm, I found something that I have missed, the "delete the button
definitions". (I had only set them to "Nothing")
But that didn't help........... I will make more tries tomorrow to run the
sample.

Just a comment in the sample you mentioned, the "oButtonDefToggleSlotState"
is not set to Nothing in "ApplicationAddInServer_Deactivate()"

Regards
Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4928863@discussion.autodesk.com...
One thing to try is to assign a shortcut to one of the commands of a sample
AddIn supplied in the SDK. Say,

...Autodesk\Inventor 10\SDK\Samples\VB\AddIns\SimpleAddIn

This should work fine. And then see what you are doing different.

Sanjay-


"Lars Andersson" wrote in message
news:4928282@discussion.autodesk.com...
Sanjay,

I have gone through all code in my add-in and found a couple objects not set
to "Nothing".
All Inventor processes seams now to be closed but my problem is still there,
no shortcuts remembered!

I know this is maybe a bad idea but, is it possible to "set" the shortcuts
manually with a ".reg" or by VB-code?

Lars


"Lars Andersson" skrev i meddelandet
news:4927853@discussion.autodesk.com...
Thanks Sanjay, that could be the problem.
I have two processes called AdskCleanup.0001 (176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb) running after closing Inventor.
Strange thing is that it worked on a macro.
I will look into this tomorrow.

Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4927691@discussion.autodesk.com...
There isn't currently an API to assign shortcuts, so you will need to do
that manually. The shortcuts should be persisted across sessions. I'm not
sure why yours doesn't. Perhaps Inventor is not shutting down fully due to
outstanding references? (The persistence to registry happens during shut
down, so if there are problems during shut down, the shortcuts won't be
remembered).

Sanjay-

"Lars Andersson" wrote in message
news:4927078@discussion.autodesk.com...
Maybe wrong group but anyway...........

I have done a add-in with a couple of buttons in the Panel Bar. (I'm
running
Win XP Pro + Inv.10 SP1)
I would like to have a "shortcut" to some of the buttons in the Panel Bar
so
I added a shortcut to one of the buttons by adding the shortcut in
Tools/Customize/Commands. I selected "add-ins" and added ALT+CTRL+P to one
of the buttons and it's working fine.
The problem is that after restarting Inventor the shortcut is gone, is it
a
bug or do I something wrong?
I did the same thing to a macro and then Inventor remember it's shortcut,
no
problem at all.
Is it possible to add the shortcut in the add-in?

Lars
0 Likes
Message 8 of 11

Anonymous
Not applicable
I noticed that a couple of Inventor related processes (two AdskCleanup.0001
(176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb)) wasn't closed when I missed to set
some objects to nothing.

Also, I the sample "...Autodesk\Inventor
10\SDK\Samples\VB\AddIns\SimpleAddIn" ,
"ApplicationAddInServer_Deactivate()" the button definitions are first
"deleted" and after that set to nothing.
For me that sounds a bit strange to first delete the button definition and
after that set it to Nothing. (I don't have any programming education, so
this comment could be stupid......)

Regards
Lars


"Venkatesh Thiyagarajan (Autodesk)"
skrev i meddelandet news:4929153@discussion.autodesk.com...
Isn't the purpose of the garbage collector to take care of freeing up the
memory for objects when it determines that they are no longer being used? I
am under the impression that we don't have to worry about explicitly freeing
up managed objects. Did you notice a problem (e.g. a memory leak) if you
don't set it to Nothing?

Thanks,
Venkatesh.


"Lars Andersson" wrote in message
news:4929051@discussion.autodesk.com...
Sanjay,

Hmmm, I found something that I have missed, the "delete the button
definitions". (I had only set them to "Nothing")
But that didn't help........... I will make more tries tomorrow to run the
sample.

Just a comment in the sample you mentioned, the "oButtonDefToggleSlotState"
is not set to Nothing in "ApplicationAddInServer_Deactivate()"

Regards
Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4928863@discussion.autodesk.com...
One thing to try is to assign a shortcut to one of the commands of a sample
AddIn supplied in the SDK. Say,

...Autodesk\Inventor 10\SDK\Samples\VB\AddIns\SimpleAddIn

This should work fine. And then see what you are doing different.

Sanjay-


"Lars Andersson" wrote in message
news:4928282@discussion.autodesk.com...
Sanjay,

I have gone through all code in my add-in and found a couple objects not set
to "Nothing".
All Inventor processes seams now to be closed but my problem is still there,
no shortcuts remembered!

I know this is maybe a bad idea but, is it possible to "set" the shortcuts
manually with a ".reg" or by VB-code?

Lars


"Lars Andersson" skrev i meddelandet
news:4927853@discussion.autodesk.com...
Thanks Sanjay, that could be the problem.
I have two processes called AdskCleanup.0001 (176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb) running after closing Inventor.
Strange thing is that it worked on a macro.
I will look into this tomorrow.

Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4927691@discussion.autodesk.com...
There isn't currently an API to assign shortcuts, so you will need to do
that manually. The shortcuts should be persisted across sessions. I'm not
sure why yours doesn't. Perhaps Inventor is not shutting down fully due to
outstanding references? (The persistence to registry happens during shut
down, so if there are problems during shut down, the shortcuts won't be
remembered).

Sanjay-

"Lars Andersson" wrote in message
news:4927078@discussion.autodesk.com...
Maybe wrong group but anyway...........

I have done a add-in with a couple of buttons in the Panel Bar. (I'm
running
Win XP Pro + Inv.10 SP1)
I would like to have a "shortcut" to some of the buttons in the Panel Bar
so
I added a shortcut to one of the buttons by adding the shortcut in
Tools/Customize/Commands. I selected "add-ins" and added ALT+CTRL+P to one
of the buttons and it's working fine.
The problem is that after restarting Inventor the shortcut is gone, is it
a
bug or do I something wrong?
I did the same thing to a macro and then Inventor remember it's shortcut,
no
problem at all.
Is it possible to add the shortcut in the add-in?

Lars
0 Likes
Message 9 of 11

Anonymous
Not applicable
I'm sorry, for some reason, I was thinking you were using one of the .NET
languages.

Actually, that VB sample needs to be updated. You don't have to delete the
button definitions in the Deactivate method. Also, VB 6.0 has some kind of
garbage collection, so, I don't really think you need to set the
ButtonDefinition object to Nothing in the Deactivate method.

In your case, I'm not sure about the cause of the reference leak and why the
Inventor process is not terminating. If it is possible for you to post your
sample in the "autodesk.inventor.customer-files" newsgroup, then we could
probably take a look and try to identify the problem.

-Venkatesh.

"Lars Andersson" wrote in message
news:4929532@discussion.autodesk.com...
I noticed that a couple of Inventor related processes (two AdskCleanup.0001
(176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb)) wasn't closed when I missed to set
some objects to nothing.

Also, I the sample "...Autodesk\Inventor
10\SDK\Samples\VB\AddIns\SimpleAddIn" ,
"ApplicationAddInServer_Deactivate()" the button definitions are first
"deleted" and after that set to nothing.
For me that sounds a bit strange to first delete the button definition and
after that set it to Nothing. (I don't have any programming education, so
this comment could be stupid......)

Regards
Lars


"Venkatesh Thiyagarajan (Autodesk)"
skrev i meddelandet news:4929153@discussion.autodesk.com...
Isn't the purpose of the garbage collector to take care of freeing up the
memory for objects when it determines that they are no longer being used? I
am under the impression that we don't have to worry about explicitly freeing
up managed objects. Did you notice a problem (e.g. a memory leak) if you
don't set it to Nothing?

Thanks,
Venkatesh.


"Lars Andersson" wrote in message
news:4929051@discussion.autodesk.com...
Sanjay,

Hmmm, I found something that I have missed, the "delete the button
definitions". (I had only set them to "Nothing")
But that didn't help........... I will make more tries tomorrow to run the
sample.

Just a comment in the sample you mentioned, the "oButtonDefToggleSlotState"
is not set to Nothing in "ApplicationAddInServer_Deactivate()"

Regards
Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4928863@discussion.autodesk.com...
One thing to try is to assign a shortcut to one of the commands of a sample
AddIn supplied in the SDK. Say,

...Autodesk\Inventor 10\SDK\Samples\VB\AddIns\SimpleAddIn

This should work fine. And then see what you are doing different.

Sanjay-


"Lars Andersson" wrote in message
news:4928282@discussion.autodesk.com...
Sanjay,

I have gone through all code in my add-in and found a couple objects not set
to "Nothing".
All Inventor processes seams now to be closed but my problem is still there,
no shortcuts remembered!

I know this is maybe a bad idea but, is it possible to "set" the shortcuts
manually with a ".reg" or by VB-code?

Lars


"Lars Andersson" skrev i meddelandet
news:4927853@discussion.autodesk.com...
Thanks Sanjay, that could be the problem.
I have two processes called AdskCleanup.0001 (176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb) running after closing Inventor.
Strange thing is that it worked on a macro.
I will look into this tomorrow.

Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4927691@discussion.autodesk.com...
There isn't currently an API to assign shortcuts, so you will need to do
that manually. The shortcuts should be persisted across sessions. I'm not
sure why yours doesn't. Perhaps Inventor is not shutting down fully due to
outstanding references? (The persistence to registry happens during shut
down, so if there are problems during shut down, the shortcuts won't be
remembered).

Sanjay-

"Lars Andersson" wrote in message
news:4927078@discussion.autodesk.com...
Maybe wrong group but anyway...........

I have done a add-in with a couple of buttons in the Panel Bar. (I'm
running
Win XP Pro + Inv.10 SP1)
I would like to have a "shortcut" to some of the buttons in the Panel Bar
so
I added a shortcut to one of the buttons by adding the shortcut in
Tools/Customize/Commands. I selected "add-ins" and added ALT+CTRL+P to one
of the buttons and it's working fine.
The problem is that after restarting Inventor the shortcut is gone, is it
a
bug or do I something wrong?
I did the same thing to a macro and then Inventor remember it's shortcut,
no
problem at all.
Is it possible to add the shortcut in the add-in?

Lars
0 Likes
Message 10 of 11

Anonymous
Not applicable
for sure if there is a memory leak, or if my add-in or Inventor
doesn't shut down completely.
What I now know, is that I don't see any Inventor related processes running
what I'm aware of after closing Inventor and still my shortcut's aren't
persistent.

I have found a solution by creating a macro that "calls" the buttons, but I
don't like that solution.
Macro shortcut's are persistent so I guess there is something wrong with my
add-in.
Next step I will try is to remove some "On Error Resume Next" and use a
better error handling.

Regards
Lars

"Venkatesh Thiyagarajan (Autodesk)"
skrev i meddelandet news:4930259@discussion.autodesk.com...
I'm sorry, for some reason, I was thinking you were using one of the .NET
languages.

Actually, that VB sample needs to be updated. You don't have to delete the
button definitions in the Deactivate method. Also, VB 6.0 has some kind of
garbage collection, so, I don't really think you need to set the
ButtonDefinition object to Nothing in the Deactivate method.

In your case, I'm not sure about the cause of the reference leak and why the
Inventor process is not terminating. If it is possible for you to post your
sample in the "autodesk.inventor.customer-files" newsgroup, then we could
probably take a look and try to identify the problem.

-Venkatesh.

"Lars Andersson" wrote in message
news:4929532@discussion.autodesk.com...
I noticed that a couple of Inventor related processes (two AdskCleanup.0001
(176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb)) wasn't closed when I missed to set
some objects to nothing.

Also, I the sample "...Autodesk\Inventor
10\SDK\Samples\VB\AddIns\SimpleAddIn" ,
"ApplicationAddInServer_Deactivate()" the button definitions are first
"deleted" and after that set to nothing.
For me that sounds a bit strange to first delete the button definition and
after that set it to Nothing. (I don't have any programming education, so
this comment could be stupid......)

Regards
Lars


"Venkatesh Thiyagarajan (Autodesk)"
skrev i meddelandet news:4929153@discussion.autodesk.com...
Isn't the purpose of the garbage collector to take care of freeing up the
memory for objects when it determines that they are no longer being used? I
am under the impression that we don't have to worry about explicitly freeing
up managed objects. Did you notice a problem (e.g. a memory leak) if you
don't set it to Nothing?

Thanks,
Venkatesh.


"Lars Andersson" wrote in message
news:4929051@discussion.autodesk.com...
Sanjay,

Hmmm, I found something that I have missed, the "delete the button
definitions". (I had only set them to "Nothing")
But that didn't help........... I will make more tries tomorrow to run the
sample.

Just a comment in the sample you mentioned, the "oButtonDefToggleSlotState"
is not set to Nothing in "ApplicationAddInServer_Deactivate()"

Regards
Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4928863@discussion.autodesk.com...
One thing to try is to assign a shortcut to one of the commands of a sample
AddIn supplied in the SDK. Say,

...Autodesk\Inventor 10\SDK\Samples\VB\AddIns\SimpleAddIn

This should work fine. And then see what you are doing different.

Sanjay-


"Lars Andersson" wrote in message
news:4928282@discussion.autodesk.com...
Sanjay,

I have gone through all code in my add-in and found a couple objects not set
to "Nothing".
All Inventor processes seams now to be closed but my problem is still there,
no shortcuts remembered!

I know this is maybe a bad idea but, is it possible to "set" the shortcuts
manually with a ".reg" or by VB-code?

Lars


"Lars Andersson" skrev i meddelandet
news:4927853@discussion.autodesk.com...
Thanks Sanjay, that could be the problem.
I have two processes called AdskCleanup.0001 (176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb) running after closing Inventor.
Strange thing is that it worked on a macro.
I will look into this tomorrow.

Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4927691@discussion.autodesk.com...
There isn't currently an API to assign shortcuts, so you will need to do
that manually. The shortcuts should be persisted across sessions. I'm not
sure why yours doesn't. Perhaps Inventor is not shutting down fully due to
outstanding references? (The persistence to registry happens during shut
down, so if there are problems during shut down, the shortcuts won't be
remembered).

Sanjay-

"Lars Andersson" wrote in message
news:4927078@discussion.autodesk.com...
Maybe wrong group but anyway...........

I have done a add-in with a couple of buttons in the Panel Bar. (I'm
running
Win XP Pro + Inv.10 SP1)
I would like to have a "shortcut" to some of the buttons in the Panel Bar
so
I added a shortcut to one of the buttons by adding the shortcut in
Tools/Customize/Commands. I selected "add-ins" and added ALT+CTRL+P to one
of the buttons and it's working fine.
The problem is that after restarting Inventor the shortcut is gone, is it
a
bug or do I something wrong?
I did the same thing to a macro and then Inventor remember it's shortcut,
no
problem at all.
Is it possible to add the shortcut in the add-in?

Lars
0 Likes
Message 11 of 11

Anonymous
Not applicable
Sorry but some words was missing in my previous answer/question so once
again............

I don't know for sure if there is a memory leak, or if my add-in or
Inventor doesn't shut down completely.
What I now know, is that I don't see any Inventor related processes
running what I'm aware of after closing Inventor and still my shortcut's
aren't persistent.

I have found a solution by creating a macro that "calls" the buttons, but
I don't like that solution.
Macro shortcut's are persistent so I guess there is something wrong with
my add-in.
Next step I will try is to remove some "On Error Resume Next" and use a
better error handling.

Regards
Lars

"Venkatesh Thiyagarajan (Autodesk)"
skrev i meddelandet news:4930259@discussion.autodesk.com...
I'm sorry, for some reason, I was thinking you were using one of the .NET
languages.

Actually, that VB sample needs to be updated. You don't have to delete the
button definitions in the Deactivate method. Also, VB 6.0 has some kind of
garbage collection, so, I don't really think you need to set the
ButtonDefinition object to Nothing in the Deactivate method.

In your case, I'm not sure about the cause of the reference leak and why the
Inventor process is not terminating. If it is possible for you to post your
sample in the "autodesk.inventor.customer-files" newsgroup, then we could
probably take a look and try to identify the problem.

-Venkatesh.

"Lars Andersson" wrote in message
news:4929532@discussion.autodesk.com...
I noticed that a couple of Inventor related processes (two AdskCleanup.0001
(176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb)) wasn't closed when I missed to set
some objects to nothing.

Also, I the sample "...Autodesk\Inventor
10\SDK\Samples\VB\AddIns\SimpleAddIn" ,
"ApplicationAddInServer_Deactivate()" the button definitions are first
"deleted" and after that set to nothing.
For me that sounds a bit strange to first delete the button definition and
after that set it to Nothing. (I don't have any programming education, so
this comment could be stupid......)

Regards
Lars


"Venkatesh Thiyagarajan (Autodesk)"
skrev i meddelandet news:4929153@discussion.autodesk.com...
Isn't the purpose of the garbage collector to take care of freeing up the
memory for objects when it determines that they are no longer being used? I
am under the impression that we don't have to worry about explicitly freeing
up managed objects. Did you notice a problem (e.g. a memory leak) if you
don't set it to Nothing?

Thanks,
Venkatesh.


"Lars Andersson" wrote in message
news:4929051@discussion.autodesk.com...
Sanjay,

Hmmm, I found something that I have missed, the "delete the button
definitions". (I had only set them to "Nothing")
But that didn't help........... I will make more tries tomorrow to run the
sample.

Just a comment in the sample you mentioned, the "oButtonDefToggleSlotState"
is not set to Nothing in "ApplicationAddInServer_Deactivate()"

Regards
Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4928863@discussion.autodesk.com...
One thing to try is to assign a shortcut to one of the commands of a sample
AddIn supplied in the SDK. Say,

...Autodesk\Inventor 10\SDK\Samples\VB\AddIns\SimpleAddIn

This should work fine. And then see what you are doing different.

Sanjay-


"Lars Andersson" wrote in message
news:4928282@discussion.autodesk.com...
Sanjay,

I have gone through all code in my add-in and found a couple objects not set
to "Nothing".
All Inventor processes seams now to be closed but my problem is still there,
no shortcuts remembered!

I know this is maybe a bad idea but, is it possible to "set" the shortcuts
manually with a ".reg" or by VB-code?

Lars


"Lars Andersson" skrev i meddelandet
news:4927853@discussion.autodesk.com...
Thanks Sanjay, that could be the problem.
I have two processes called AdskCleanup.0001 (176kb), one AdskScSrv.exe
(256kb) and one Inventor.exe (204kb) running after closing Inventor.
Strange thing is that it worked on a macro.
I will look into this tomorrow.

Lars


"Sanjay Ramaswamy (Autodesk)" skrev i
meddelandet news:4927691@discussion.autodesk.com...
There isn't currently an API to assign shortcuts, so you will need to do
that manually. The shortcuts should be persisted across sessions. I'm not
sure why yours doesn't. Perhaps Inventor is not shutting down fully due to
outstanding references? (The persistence to registry happens during shut
down, so if there are problems during shut down, the shortcuts won't be
remembered).

Sanjay-

"Lars Andersson" wrote in message
news:4927078@discussion.autodesk.com...
Maybe wrong group but anyway...........

I have done a add-in with a couple of buttons in the Panel Bar. (I'm
running
Win XP Pro + Inv.10 SP1)
I would like to have a "shortcut" to some of the buttons in the Panel Bar
so
I added a shortcut to one of the buttons by adding the shortcut in
Tools/Customize/Commands. I selected "add-ins" and added ALT+CTRL+P to one
of the buttons and it's working fine.
The problem is that after restarting Inventor the shortcut is gone, is it
a
bug or do I something wrong?
I did the same thing to a macro and then Inventor remember it's shortcut,
no
problem at all.
Is it possible to add the shortcut in the add-in?

Lars
0 Likes