![]() |
Telelogic System Architect (steve huntington) | ![]() |
Topic Title: get related diagram of one definition via VBA? Topic Summary: Created On: 28-Jul-2008 09:11 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Hi,all.
In one diagram , there is a symbol of definition named A , I want to know which diagrams contains the definition(A). How should I do via VBA , thanks. |
|
![]() |
|
![]() |
|
I am assuming a reasonable knowledge of VBA here.
'get realated symbols Set collSymbols = defApplication.GetRelatedObjects(RELDEFINES) collSymbols.ReadAll ' work through the list of symbols For Each symApplication In collSymbols 'get all diagrams using that symbol - should be only one Set collDiagrams = symApplication.GetRelatedObjects(RELCONDIAGRAM) collDiagrams.ReadAll 'diagram is always first item in colleciton, collection always has count of 1 Set diagDiagram = collDiagrams(1) 'now do what ever you want with the diagram ................................................................... Next symApplication |
|
![]() |
|
![]() |
|
thanks,above.
'************************************************************** 'get all diagrams using that symbol - should be only one Set collDiagrams = symApplication.GetRelatedObjects(RELCONDIAGRAM) '3 '************************************************************** the result is itself,but I want to konw the definition(A) , which other diagrams contain it except itself. how , thanks. |
|
![]() |
|
![]() |
|
Hi Chunjia,
Please read solution again and you will find that Peter has fully answered your query. You are getting the diagram names one by one in a loop. Starting with your symbol, get its defintion (assumed) RELEDEFINES --> get all symbols that use that defintion in all diagram For each symbol RELCONDIAGRAM - get the diagram (can only be one for this symbol) next symbol |
|
![]() |
|
![]() |
|
thanks, above.
the problem is solved. I am a beginner of SA VBA, can anyone provide some information about the SA VBA or forum. thanks. |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.