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: Unlocking Diagrams in VBA Macro
Topic Summary: Unlocking Diagrams in VBA Macro to generate diagram images in MS Word
Created On: 6-Aug-2008 15:00
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.
 6-Aug-2008 15:00
User is offline View Users Profile Print this message


Jose Lima

Posts: 5
Joined: 24-Nov-2005

Hello all,

I have several Word macros that connect to System Architect and read information from the currently open encyclopedia in order to generate detailed reports based on information from the Definitions and Diagrams.

When the objects are locked I can't generate information about them, for example, when I have to generate the image of a Diagram to the Word report if the Diagram is locked (by a certain user) it throws an error. Currently I verify if the diagram is locked and I jump ahead to the next one, generating a log file that writes the list of all locked objects.

What I would like to do is unlock those objects in order to generate the full report without missing any information.

I've tried to use the set field function for the diagrams as follows:

currentDgm.SetField DIAGFLD_SALOCK, "0"

But using this function also throws an error and it seems it's not possible to use it in the macro.

Does anyone have any idea?

Thank you!
José
Report this to a Moderator Report this to a Moderator
 6-Aug-2008 22:16
User is offline View Users Profile Print this message


Peter Crabb-Wyke

Posts: 73
Joined: 3-May-2007

Is there a problem with opening them read only?
Report this to a Moderator Report this to a Moderator
 9-Sep-2008 10:16
User is offline View Users Profile Print this message


Victor Lees

Posts: 5
Joined: 3-Oct-2007

That is what I do on all of my data gathering macros by ensuring that the whole encyclopaedia is open read only at the very beginning by having the following incuded in my class module for the encyclopaedia:

Dim oEncyclopedia As Encyclopedia
Dim SA_Imf As Object

Private Sub Class_Initialize()
Dim oApp As SA2001.Application
On Error GoTo appOpenError
Set oApp = CreateObject("SA2001.Application")
Set oEncyclopedia = oApp.Encyclopedia
Set SA_Imf = oApp.Interface("ISAImf")
oEncyclopedia.OpenObjectsAsReadOnly = True 'need this in case another network user has somthing locked
Exit Sub
appOpenError:
MsgBox "Unable to access the application, have you started System Architect?", vbCritical
End Sub
Report this to a Moderator Report this to a Moderator
 8-Oct-2008 10:12
User is offline View Users Profile Print this message


Arif Hussain

Posts: 53
Joined: 22-Dec-2005

Just tried the
Reports -> Word Reports --> Physical Model Reports --> Diagram Report

and it did not complain that the diagram was open by another user.

Also tried another report invoked from MS Word and that did not complain either.

May be it is the code?
Providing a skeleton version would assist in locating problem.

Have you tried putting your SA session into "Read Only" mode before running the macro?
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.