Cancel
Showing results for 
Search instead for 
Did you mean: 

help with GFXarrows

Phenom
Phenom

Hello,

 

I'm trying to write an API which creates GFXarrows, then displays an HMI in which the user can switch certain arrows on and off with checkboxes.

 

However I can't get that to work. See the little code snipet below.

This code DOES NOT make the 2nd arrow disappear.

If I change line 26 to App.feGFXSelect(2,True,True) then the 1rst arrow disappears correctly. This suggests that a "ghost arrow" of the 2nd arrow still exists in setID 1. The problem is that I can't delete it individually (no methods available for this).

 

I would appreciate help on this.

 

To go further dealing with GFX elements is not very practical. The following things could be improved:

- running a macro then Ctrl+Z (undo) does not delete GFX elements

- automated creation methods like PutAllArray do not deal with the setID

- on a broader level displaying arows is often useful, could the GFXarrow object be dealt with more like a text, where we could select it, delete it ...etc? All other GFX objects have alternatives (plot elements...etc)

 

Thanks for your help!

APavageau 

 

 

Sub Main
    Dim App As femap.model
    Set App = feFemap()

    Dim ar As femap.GFXArrow
    Set ar = App.feGFXArrow

    Dim set1 As femap.Set, set2 As femap.Set
    Set set1 = App.feSet
    Set set2 = App.feSet

    ar.dX = 1
    ar.lengthmode = GAM_SCALED : ar.style = GAS_SOLID
    ar.Put(ar.NextEmptyID)

    ar.dY = 1
    ar.Put(ar.NextEmptyID)

    App.feGFXSelect(1,True,True)
    MsgBox "pause"

    'make 2nd arrow disappear
    ar.setID = 2
    ar.Put(ar.ID)
    App.feGFXReset
    App.feGFXSelect(1,True,True)

    'now make it reappear
    '...?
End Sub