Welcome to Telelogic Product Support
  Home Downloads Knowledgebase Case Tracking Licensing Help Telelogic Passport
Telelogic System Architect (steve huntington)
Decrease font size
Increase font size
Topic Title: Using VBA to extract leveled process diagrams Gane & Sarson
Topic Summary: Extensibility VBA
Created On: 30-Aug-2006 05:48
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
Subscribe to this topic Subscribe to this topic
E-mail this topic to someone. E-mail this topic
Bookmark this topic Bookmark this topic
View similar topics View similar topics
View topic in raw text format. Print this topic.
 30-Aug-2006 05:48
User is offline View Users Profile Print this message


Ramon Avendano

Posts: 5
Joined: 30-Aug-2006

We have a need to extract every process (in order based in Number, for example 1, 2,3) of a level 0 diagram and open the child diagram attached to every process and extract the all process in it (in order and leveled, for example 1.1, 1.2,1.3).

My basic problem is trying to access the Number Property of the symbol, I can't find a way to get this value.

Thanks

Ramón Avendaño

Report this to a Moderator Report this to a Moderator
 5-Sep-2006 18:24
User is offline View Users Profile Print this message


Matt Sheranko

Posts: 82
Joined: 7-Oct-2005

Ramon,

I have not used that specific diagram, but I did a test below and used getMetric to get the symbol level number.

I created the top level Data Flow diagram, then right clicked a process and selected option to create child.  Once I did this I created a few process symbols on the diagram and saved.
 
I then ran the script below to get the symbol numbering for each symbol on the OPEN diagram.  You would have to do the rest of the fancy footwork to get the top level diagram and iterate through all child (related objects, etc) diagrams and their symbols.  Is this what you were looking for?



-------------------------
Thanks,

MattS
Report this to a Moderator Report this to a Moderator
 6-Sep-2006 19:17
User is offline View Users Profile Print this message


Ramon Avendano

Posts: 5
Joined: 30-Aug-2006

Matt It work but Symbols that came from the parent diagram appears in the child diagram at the same level, including the parent symbol container which is diferentiate because its type is "PARENT". I need diferentiate which symbol are really belonging to the diagram level and ignore the other that came from parent level. Thank you very much Ramón
Report this to a Moderator Report this to a Moderator
 6-Sep-2006 19:45
User is offline View Users Profile Print this message


Matt Sheranko

Posts: 82
Joined: 7-Oct-2005

Ramon,

I guess you only care about the "Process" symbols on a diagram.   It appears that there is only one "Parent" symbol on each child diagram.  You can get its type and choose to use it or ignore it.  See attached code.

If colSymbols.Item(i).GetField(SYMFLD_TYPE) = 15 then
' I am a process symbol, read my meta data

End If

If colSymbols.Item(i).GetField(SYMFLD_TYPE) = 242 then
' I am a Parent symbol and you can ignore me!

End If


I got the integer values of the symbol types from the file "SYMBOLS.BAS"


-------------------------
Thanks,

MattS
Report this to a Moderator Report this to a Moderator
 7-Sep-2006 00:02
User is offline View Users Profile Print this message


Ramon Avendano

Posts: 5
Joined: 30-Aug-2006

Matt The parent is not the problem because the parent is the explode symbol and in any case it is a diferent type which I could ignore. The problem are the process symbols that came from the parent diagram and are in the child diagram to reference the relationship between parent and explode child process by means of data/material flows.
Report this to a Moderator Report this to a Moderator
 7-Sep-2006 12:35
User is offline View Users Profile Print this message


Matt Sheranko

Posts: 82
Joined: 7-Oct-2005

Ramon,
I haven't used this type of diagram in detail, but I do think there are enough properties and relationships between diagrams and symbols to figure out what you are trying to do.

Try using diagram.GetParentSymbol, symbol.GetChildDiagrams and GetRelatedObjects for symbols and diagrams.

Possible steps:
1) I guess you would have to identify the parent diagram and its symbols
2) then iterate through each symbol and see if it has a child diagram
3) then go to that child diagram and iterate through its symbols
4) then identify which symbols are from Parent diagram and which are unique to the child diagram, and then only collect meta data on the child diagram's unique symbols.
5) then figure out to recursively check each symbol/diagram for children until you reach the end leaf of the tree!



-------------------------
Thanks,

MattS
Report this to a Moderator Report this to a Moderator
 7-Sep-2006 19:42
User is offline View Users Profile Print this message


Ramon Avendano

Posts: 5
Joined: 30-Aug-2006

Matt I have all the recursive code to find child diagram but my problem is with the symbols that appears in it. Let my show and example: 1. Diagram leve 0 Study have two process named Analyze (P1) and Diagnostic (P2) and data flow between P1 and P2 named Result. 2. When created a child diagram of Analyze (P1) SA create a Parent Symble named Analyze (P1), a process symbol named Diagnostic (P2) and the data flow named Result 3. I create two process named "Search Component" (P1.1) and "Identify Component" (P1.2). SA assign the level number automatically Here when the problem appears and it is that I can not find a way to diferentiate the process P1.1 and P1.2, which really belong to level 1 from process P2 which really belong to level 0 We are expornint this diagram structure to feed other system and it is a requirement to send only the symbols that really belong to the diagram level Thanks Ramón PS: yor last recomendation is good but we already tried it and we try also using SaveHandle = SAOpenRelatedObject(SymHandle, RELISEMBEDDEDBY) SaveHandle = SAOpenRelatedObject(SymHandle, RELEMBEDS)
Report this to a Moderator Report this to a Moderator
 12-Sep-2006 15:20
User is offline View Users Profile Print this message


Matt Sheranko

Posts: 82
Joined: 7-Oct-2005

Ramón,

I thought DDID might work, but technically all symbols are different on different diagrams.  The symbol's number, symbol comment etc are also different.  The good news is that each symbol that has cascaded from the 0 level or higher diagram should have the same Definition.

So, assuming that every symbol that we care about for your report should have one and only one definition,  then you can get the 0 level diagram, get all symbols and build some type of array etc that stores the symbol's type and symbol's definition.name.  Then as you iterate through all symbols located on child diagrams, you simply check to see if another symbol already exists with the same type and definition by querying the array.  If one already exists, then you do not care about that symbol for this diagram.  You need type because symbols of different types could have the same definition.name.

type = symbol.GetField(SYMFLD_TYPE)

Does that sound like it will work?

Another option is to ignore all symbols that are connected to a Parent type symbol.  The assumption being that if they are connected to the Parent symbol (on a diagram that is a child of a symbol) then they should be ignored for your report.  Not sure how to do this though!



-------------------------
Thanks,

MattS
Report this to a Moderator Report this to a Moderator
 13-Sep-2006 03:22
User is offline View Users Profile Print this message


Ramon Avendano

Posts: 5
Joined: 30-Aug-2006

Matt

I have resolved this problem calculating the position of every symbol respect the parent symbol. If the symbol is inside the parent position then it belong to the current diagram level, if no, it is only a reference from a parent diagram.

Thank you very much

Ramón

Report this to a Moderator Report this to a Moderator
Statistics
20925 users are registered to the Telelogic System Architect forum.
There are currently 1 users logged in.
The most users ever online was 16 on 30-Oct-2008 at 14:46.
There are currently 0 guests browsing this forum, which makes a total of 1 users using this forum.
You have posted 0 messages to this forum. 0 overall.

FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.