AVEVA Community
AVEVA Community
  • Site
  • User
  • Site
  • Search
  • User
Modules
  • AVEVA World
  • PDMS/E3D Forum
  • Modules
  • Cancel
Modules
Draft Module macro for rotating labels
  • Forums
  • Resources
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Replies 7 replies
  • Subscribers 5 subscribers
  • Views 55 views
  • Users 0 members are here
Options
  • Share
  • More
  • Cancel
Related

macro for rotating labels

Marian Fanaca
Marian Fanaca over 6 years ago
 
  • Sign in to reply
  • Cancel
  • Marian Fanaca
    Marian Fanaca over 6 years ago
     

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Venkata Rao Peta
    Venkata Rao Peta over 6 years ago
    Hi,

    Look this example

    BUTTON .B63 AT XMIN+1 YMAX 'CE' BACKGROUND Beige TOOLTIP 'Current Element' CALL |!this.SmartClicks()| width 2

    define method .SmartClicks()
    endmethod
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Léo SALVADOR
    Léo SALVADOR over 6 years ago
    Hi Marian,

    You have to place the "exit" of your form setup before your method definition.

    Like this:


    setup Form !!sampleForm
       
    exit

    define method .sampleMethod()
       
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Azmatulla Mirza Baig
    Azmatulla Mirza Baig over 6 years ago
    setup form !!IEN dialog dock
     button .buttonx 'ROTATE90' callback '!this.rotate()'
    exit

    define method .rotate()

    DO
    ID GLAB SLAB @
    HANDLE ANY
    GOLABEL /FINISH
    ENDHANDLE
    adegrees 90
    REFRESH

    ENDDO
    LABEL /FINISH

    endmethod

    SHOW !!IEN
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Oliver
    Oliver over 5 years ago
    Is there a way to do this for a gensec that is on the angle ?
    I don't know what attribute contains the angle of the gensec.
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Tejas Desai
    Tejas Desai over 5 years ago
    Please find  below code for aligning GLAB/ SLAB found on this forum somewhere.
    for me, Code works fine after removing portion in blue color.


       DO
           ID GLAB SLAB @
           HANDLE ANY
               GOLABEL /FINISH
           ENDHANDLE
         
           !GLAB = !!CE
           !LAYE = !!CE.OWNER
         
           [COLOR=#0000ff]IF !!CE.DDNAME.BADREF().EQ(TRUE) THEN
               RETURN
           ENDIF
         
           IF !!CE.DDNAME.TYPE.NEQ('SCTN') Then
               RETURN
           ENDIF[/COLOR]
         
           !START = !!CE.DDNAME.POSS.WRT(WORLD)
           !END = !!CE.DDNAME.POSE.WRT(WORLD)
         
           !!CE = !LAYE
           NEW VNOTE FUNC 'ANGLE-MACRO'
           !VNOTE = !!CE
         
           NEW STRA FPT $!START TPT $!END
           !ADEG = !!CE.ADEG
         
           !!CE = !VNOTE
           DELETE VNOTE
         
           !!CE = !GLAB
           IF !ADEG.REAL().LT(-90) THEN
               ADEG ($!ADEG + 180)
           ELSEIF !ADEG.REAL().GT(90) THEN
               ADEG($!ADEG - 180)
           ELSE
               ADEG $!ADEG
           ENDIF
         
           
           REFRESH


       ENDDO
       LABEL /FINISH

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel
  • Oliver
    Oliver over 5 years ago
    Thanks

    When I escape out of the loop it leaves me with a message box on the screen saying "Identify Element". Is there a way to remove that from the screen ?
    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Cancel