![]() |
Telelogic System Architect (steve huntington) | ![]() |
Topic Title: ISAImf (VBA) Documentation? Topic Summary: Is there any documentation / gotcha's / best practice / examples for the ISAImf VBA interface to SA? Created On: 20-Nov-2006 11:07 Status: Read Only |
Linear : Threading : Single : Branch |
![]() |
![]()
|
![]() |
|
Is there any documentation / gotcha's / best practice / examples for the ISAImf VBA interface to SA?
I have used the standard documented SA extensibility interface to date, but have now have to use ISAImf to achieve what I need to do.
One can of course browse the type library and infer what the functions might do and then test them out, but it would certainly be quicker and less error prone to have some examples / documentation.
Does anyone know anything about this?
|
|
![]() |
|
![]() |
|
Not that I know of.
I'm currently trying to use the interface to create GUIDs. I think it is a variant buffer but not sure how large it is (I'll do a len on the guids). Let everyone know how I go. If anyone already knows how to use the interface to create a GUID please let me know. Ta. ![]() |
|
![]() |
|
![]() |
|
Don't worry, worked it out.
Public Sub creating_a_GUID() Dim imfSA As Object Dim guid As String Set imfSA = Application.Interface("ISAImf") 'create a GUID Call imfSA.SAGetStringGUID(guid, 288) Stop End Sub So, each GUID is 36 chars long. 36 * 8 bits = 288. This gives me a SAGuid value. For example: 5e776a80-78cd-46de-b667-5d108a8eb372 or 83c4fc30-018b-48f7-9237-326627190649 I guessed it may work on a random function or something that is seeded by the timer in the computer and each pass through the SAGetStringGUID method produces a different unique number. I question the concept of uniqueness in these kinds of situations and wonder what I have to do to produce the same number. Eg, resetting the clock back to the exact same time in the routine a number of times until I reach a uniqueness failure ![]() |
|
![]() |
|
![]() |
|
SAGetStringGUID uses Window's API :-
CoCreateGuid Which creates GUIDS based on Physical Machine parameters, as well as date and time. It is pretty much guaranteed to be unique. Hope this helps. BTW there is not much public documentation on the IMF interface. The object model is the recommended route to programming against SA - although I do accept that some functions are not yet available from the object model. Thanks Ian ------------------------- Senior Software Developer Telelogic UK Ltd. |
|
![]() |
|
![]() |
|
Your comment that there is not *much* public documentation, suggests that their is *some* public documentation. It also suggests that there is some *non-public* documentation.
What is the reason for not releasing whatever documentation there is to those who are trying to drive forward the usage of the product?
If it is a worry about quality, I can only say that *anything* is better than nothing and having to deduce what functions do and then test your assumptions prior to development is a very slow and frustrating experience.
How do your consultants learn - surely it is not just by trial and error?
Thanks for your help,
Tim
Enterprise Architect NHS
|
|
![]() |
|
![]() |
|
quote: Excellent, thanks for that. In future I will be able to create the script I need without having to load a System Architect Application object to create the GUID. ![]() ![]() |
|
![]() |
|
![]() |
|
Tim> I have passed your comments on to the documentation team (as this is not my area). I will let you know what I find.
As I say IMF is the old way to interact with SA, and is gradually being replaced by the Object model. But I do appreciate that there are still quite a few things which can only be done via IMF, and do understand your requirement for information. If you have any specific questions relating to IMF functions (or just - how can I do this...) we will try to answer them in the forums. I hope this helps Ian ------------------------- Senior Software Developer Telelogic UK Ltd. |
|
![]() |
|
![]() |
|
Ian,
Thanks very much for your response.
A current example is that we wish to create an extended explorer, which can help us navigate our larger collections of definitions (e.g. our 7,000 conceptual services).
We would either wish to either filter the explorer tree based on attribute values or extend the tree to include levels defined by attribute.
I can see functions which seem to relate to building trees, but was wanting guidance on how to work with the interface functionality as opposed to against it.
Any light you can shed on this would be much appreciated, regards,
Tim
|
|
![]() |
|
![]() |
|
Tim - I think this may help you. Create a new VBA Project (READ WRITE). If you debug the macro and press STOP, you will have to run AutoExec.Main again to restart the event handler.
------------------------- Senior Software Developer Telelogic UK Ltd. Edited: 5-Dec-2006 at 11:25 by SA Team |
|
![]() |
|
![]() |
|
Thanks very much for your reply.
I have taken the code, modified and tested it.
Unfortunately, as you suggested, this is a very slow process and filtering our 7,000 conceptual service definitions takes about 3 minutes, which will not acceptable to modellers.
Is there a way of intercepting the process earlier (in returning the data to build the explorer tree items) rather than intercepting the ShowNode event to set their visibility?
Regards,
Tim
Edited: 5-Dec-2006 at 14:32 by Tim Jones |
|
![]() |
|
![]() |
|
Sorry there is not another way to intercept the browser display.
It depends how complex you require your browser to be. If you want a simple search system you could try something like the attached VBA listbox code. Create a new VBA project and add a form called frmFilter Add a ListBox control to the form called ListBox1 Paste the code in and save it Add a reference to the project to 'Microsoft XML 3.0' or similar Open the form and press run. (It will do the same filter as the previous example I posted) To modify it : The strReport is copied out of the Reporting System (mock up the report and then choose 'text edit report' and copy it out, minus the report format and output details). Paste it into VBA and format the text (remembering to double quote all single double quotes) Hope this helps Ian ------------------------- Senior Software Developer Telelogic UK Ltd. Edited: 5-Dec-2006 at 17:11 by SA Team |
|
![]() |
|
![]() |
|
Hi all,
I've the same problem (lack of documentation) about two following ISAIMF's functions: - SAPlaceDiagramNodes(lphDiagramHandle As Long, wAlgorithm As Long) As IMFERRORCODE - SARouteDiagramLines(lphDiagramHandle As Long) As IMFERRORCODE Could you help me? Thanks rN |
|
![]() |
|
![]() |
|
Hi
I have not used these functions before, but I believe their use is as follows :- SAPlaceDiagramNodes :- lphDiagramHandle = is the handle to the diagram wAlgorithm can be :- -1 = collapse dgm 3 = draw hierarchies 0 = simply route nodes SARouteDiagramLines Simply takes a diagram handle and performs a route lines with assign connections Diagram handles can be obtained by doing an IMF OpenDiagram, or using the object model by using Diagram.Handle Hope this helps Ian ------------------------- Senior Software Developer Telelogic UK Ltd. Edited: 14-Feb-2007 at 11:40 by SA Team |
|
![]() |
FuseTalk Standard Edition v3.2 - © 1999-2009 FuseTalk Inc. All rights reserved.