05-10-2012 03:08 PM - edited 05-10-2012 03:09 PM
I need to set a condition to colorize links between application and interaction ( on Application Env Diagram) depending on link direction (Trigerred, Triggering)
To do that I set a macro on DiagramTypeLinkStyle condition and I would like to get the name of Current Diagram to compare with applications located on diagram and determine which one is "master"
Thanks in advance!
Jacques
Macro draft in following
-------------------------------------------------------------------------------------------------------------------------
'MegaContext(Fields,Types)
Option Explicit
Function MetaViewCheck(oObject As MegaObject,Ctx As Object) As Boolean
  '
   Dim SearchString
   Dim SearchChar, S1, S2, S3
   Dim P0, P1, P2, P3
   Dim Obj, CurrentDiagramName
   
  '   
     ' ---------------------------------------------------------------------------------------------- 
     ' get Current Diagram name   
     ' ----------------------------------------------------------------------------------------------
     Set CurrentDiagramName =  .........................................................
 
   P0 = 1
  SearchString = oObject.getprop("name")
  'Zone = oObject.getprop("local name")
  'Msgbox("Zone: " & Zone)
  SearchChar = "::"
  P1 = InStr(P0, SearchString, SearchChar)
  S1 = Mid(SearchString, P0, P1-1)
  SearchChar = "_"
  P2 = InStr(P0, SearchString, SearchChar)
  P3 = InStr(P2+1, SearchString, SearchChar) - P2
  S2 = Mid(SearchString, P2+1, P3 -1)
  Msgbox("trace / " & SearchString & Chr(13) & "P1: " & P1 & " P2: " & P2 & " P3: " & P3 & " S1: " & S1 & " S2: " & S2)
  If S1 = S2 then 
    MetaViewCheck = True
  Else 
    MetaViewCheck = False 
  End If
End Function