Selectable client graphics textbox

Selectable client graphics textbox

Cadkunde.nl
Collaborator Collaborator
203 Views
2 Replies
Message 1 of 3

Selectable client graphics textbox

Cadkunde.nl
Collaborator
Collaborator

Hello,

 

I have a main assembly with some sub components

I want to be able to select a component, then click a button and get some parameters from the component (length width height) in a textfield hovering over the component (from the main assembly)

Cadkundenl_0-1718030369592.png

Much like during an extrude feature, you get a textfield in which you can set the extrude distance.

 

I tried examples of Clientgraphics, interactiongraphics, overlaygraphics, but can't figure this one out.

Do I need to make this with mini toolbar?

 

If possible I would like an example of text box in the screen (I dont want a visual studio form)

 

 

 

0 Likes
204 Views
2 Replies
Replies (2)
Message 2 of 3

JelteDeJong
Mentor
Mentor

Have a look at this code. It will create a mini toolbar allowing the user to insert a dimension.

JelteDeJong_0-1718047984031.png

Public Class ThisRule

    Sub Main()
        Dim miniToolBar As New MiniToolbaerWrapper(ThisApplication)
        miniToolBar.Pick()
    End Sub

End Class

Public Class MiniToolbaerWrapper

    Private _interactEvents As InteractionEvents
    Private _stillSelecting As Boolean
    Private _inventor As Inventor.Application
    Private _toolBar As MiniToolbar
    Private _valueEditor As MiniToolbarValueEditor

    Public Sub New(ThisApplication As Inventor.Application)
        _inventor = ThisApplication
    End Sub

    Public Sub Pick()
        _stillSelecting = True

        _interactEvents = _inventor.CommandManager.CreateInteractionEvents
        _interactEvents.InteractionDisabled = False

        _toolBar = _interactEvents.CreateMiniToolbar()

        AddHandler _toolBar.OnOK, AddressOf OkPressed

        _valueEditor = _toolBar.Controls.AddValueEditor("testValue", "", ValueUnitsTypeEnum.kLengthUnits, "123mm")

        _toolBar.ShowApply = False
        _toolBar.ShowOptionBox = False
        _toolBar.Visible = True

        _interactEvents.Start()
        Do While _stillSelecting
            _inventor.UserInterfaceManager.DoEvents()
        Loop
        _interactEvents.Stop()

        _inventor.CommandManager.StopActiveCommand()

        _toolBar.Delete()
    End Sub

    Private Sub OkPressed()
        MsgBox(String.Format("value={0} - Expresion={1}", _valueEditor.Value, _valueEditor.Expression))
        _stillSelecting = False
    End Sub
End Class

 

 

 

Jelte de Jong
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


Blog: hjalte.nl - github.com

Message 3 of 3

Cadkunde.nl
Collaborator
Collaborator

Thanks, I will focus on the mini toolbar today.
https://modthemachine.typepad.com/my_weblog/2012/03/create-a-mini-toolbar.html

The name of 'interaction graphics' got me on a wrong track i guess. They are graphics that automatically disappear after the interaction. Not graphics to interact with.

 

Though I remember I once saw a movie of someone with clickable graphics in screen.

 

Dim oNode As GraphicsNode = oClientGraphics.AddNode(1)

oNode.Selectable = True

Then use command manager select events?

 

And a box like you see with extrude is not possible for 3th party?

0 Likes