One Button Toggles Commands, Can I do it?

Questions and answers about 3Dconnexion devices on Windows.

Moderator: Moderators

Post Reply
stuartmp
Posts: 7
Joined: Mon Jun 30, 2008 1:11 am

One Button Toggles Commands, Can I do it?

Post by stuartmp »

Hi All,

I have a space explorer and I am using Inventor.

I would like to be able to use one button to toggle a command.

I the a way to do this?

I would like to have one button to toggle a command, for example

1. The parallel / perspective view.
2. Hidden / Shaded
Peter
Moderator
Moderator
Posts: 34
Joined: Tue Dec 05, 2006 5:23 am

Post by Peter »

Stuartamp,
If, when you open the Button Mapping Editor within Inventor, you see the particular commands listed, you can drag them to a button.
Also, if there is a keyboard command for any of the commands that you need, a macro can be created by accessing the 3dxware control panel/button configuration/custom.

Peter
stuartmp
Posts: 7
Joined: Mon Jun 30, 2008 1:11 am

Post by stuartmp »

Thanks Peter, what I was actually trying to was

Put two commands on one button. for example
the first time I press the shift key on the space explorer I get
the parallel view command.
The second time I press the shift key on the space explorer I get
the perspective view command.
The third time I press the shift key on the space explorer I get
the parallel view command again.

This way the button acts as a toggle and I save buttons on the space explorer for somthing else.

I hope this clears up my question.

So can the space explorer do this?
Bryan
Moderator
Moderator
Posts: 443
Joined: Thu Dec 07, 2006 1:37 pm
Location: Rochester NY

A button may only be mapped to one command.

Post by Bryan »

Dear stuartmp,

There's no way to program one button to two separate commands. However there are sometimes commands that toggle themselves. Some commands will switch between settings or views each time they are used.

Sincerely,
Bryan
stuartmp
Posts: 7
Joined: Mon Jun 30, 2008 1:11 am

Post by stuartmp »

I have a solution, I wrote a macro to toggle the commands. The assigned a button to run the macro.

How do I upload the code?
jwick
Moderator
Moderator
Posts: 3336
Joined: Wed Dec 20, 2006 2:25 pm
Location: USA
Contact:

Post by jwick »

"upload the code" ?

To share it with everyone else? That would be wonderful. We don't have a codeshare yet, but you should be able to paste the code here for other users to copy.
stuartmp
Posts: 7
Joined: Mon Jun 30, 2008 1:11 am

Post by stuartmp »

Ok. I will post the code tomorrow. I have it at work.

One thing I noticed that I think needs to be addressed in the next driver release / bug fix is there seams to be a bug in the way the driver loads macros in Inventor.
After I created a macro saved it and then opening the 3dConnexion panel within inventor to try and find my macro.
I click on macros, Nothing none are displayed. I then looked in all commands. Nothing, No macro again, Hmmmm.

I could not see my macro's anywhere. :(
Latter on I worked out how to get them to show up. What you have to do is go into the customize option within inventor click commands, go down to macros and scroll through a few of them.

You don't need to do anything else.

Now close out of the customize window and launch the 3dConnexion control panel. Then go to all commands and Hello your macro commands are there.
Drag it onto a button and you have it, a macro on button.

This is a bug.

It seams that every time you restart inventor you need to go into the customize option with in inventor click commands, go down to macros and scroll threw a few of them.

Before your macros will start working again on the button you selected.

Can some please test this to confirm. Or is it a known issue?
stuartmp
Posts: 7
Joined: Mon Jun 30, 2008 1:11 am

Post by stuartmp »

I am using Inventor 2008 sp3
stuartmp
Posts: 7
Joined: Mon Jun 30, 2008 1:11 am

Post by stuartmp »

This is the code for the two toggles I made.
Please read my previous post. re getting them to work.


Before your macros will start working again on the button you selected.

Public Sub Sp_Ex_Parallel_Perspective_Toggle()

'Parallel
'Perspective

Dim oInvApp As Inventor.Application
Set oInvApp = ThisApplication

Dim oView As View
Set oView = oInvApp.ActiveView

Dim oCamera As Camera
Set oCamera = oView.Camera

If oCamera.Perspective = True Then
oCamera.Perspective = False
oCamera.Apply
Else
oCamera.Perspective = True
oCamera.Apply
End If

End Sub

Public Sub Sp_Ex_Display_Toggle()

'kShadedRendering
'kWireframeRendering
'kHiddenEdgeRendering


Dim oInvApp As Inventor.Application
Set oInvApp = ThisApplication

Dim oView As View
Set oView = oInvApp.ActiveView


If oView.DisplayMode = kShadedRendering Then
oView.DisplayMode = kWireframeRendering
oView.Update
ElseIf oView.DisplayMode = kWireframeRendering Then
oView.DisplayMode = kHiddenEdgeRendering
oView.Update
ElseIf oView.DisplayMode = kHiddenEdgeRendering Then
oView.DisplayMode = kShadedRendering
oView.Update
End If



End Sub
Post Reply