Topic
IC4NOTICE: developerWorks Community will be offline May 29-30, 2015 while we upgrade to the latest version of IBM Connections. For more information, read our upgrade FAQ.
4 replies Latest Post - ‏2012-05-17T07:27:31Z by RobertoFdez
RobertoFdez
RobertoFdez
102 Posts
ACCEPTED ANSWER

Pinned topic VBA - TBX Files and Improve verify performance

‏2011-10-28T10:47:03Z |
Hi all,

Recently I created a VBA macro for System Architect to automate some processes like adding the same property to each definition created by the same user. To access this macro, I made a toolbar using "MyFirst.tbx" file and modifying it. My first question is, how does <ExtensionImage> label works? It seems a kind of encoding of a image but I don't know how to convert a ico or bmp file to this codification.

On the other hand, we have a encyclopedia with about 200k definitions and the "verify only" process takes 4 hours to be completed. Is there any way to improve the verify process or customize it to make it faster?

Thanks,

Roberto.
Updated on 2012-05-17T07:27:31Z at 2012-05-17T07:27:31Z by RobertoFdez
  • ghaynes
    ghaynes
    33 Posts
    ACCEPTED ANSWER

    Re: VBA - TBX Files and Improve verify performance

    ‏2012-04-30T15:39:22Z  in response to RobertoFdez
    Roberto,
    Did you ever get you answer on the .tbx <extensionimage> question. I have the same question. Also, what is a .tbx? I see no writeup of how to modify it or update it.
    Thanks
    • RobertoFdez
      RobertoFdez
      102 Posts
      ACCEPTED ANSWER

      Re: VBA - TBX Files and Improve verify performance

      ‏2012-05-07T18:45:47Z  in response to ghaynes
      Hi Ghaynes,

      No, I had to reuse the existing icons of MyFirst.tbx because I did not find out how it works. There is a .exe called TbxImageEncoder in System Architect root, perhaps is a good point to start from.

      Thanks and regards,
      Roberto.
      • WarrenLeslie
        WarrenLeslie
        15 Posts
        ACCEPTED ANSWER

        Re: VBA - TBX Files and Improve verify performance

        ‏2012-05-16T18:09:56Z  in response to RobertoFdez
        The string of information between the tag start and end is a base 64 encoded string of the binary image file. See the below vba code for one of many ways to do this.

        Public Sub EncodeFile()
        '***********************************************************************************************************
        '* PURPOSE: This routine reads a BMP image file and converts it to a string for use in XML *
        '* *
        '* INPUTS: Specified file *
        '* *
        '* OUTPUTS: A base60 string displayed in the utility form for cut and paste *
        '* *
        '* GLOBALS AFFECTED: None *
        '* *
        '* ASSUMPTIONS: None *
        '* *
        '* NOTES: Run standalone *
        '* *
        '* DEPENDENCIES: None *
        '* *
        '***********************************************************************************************************
        Const adTypeBinary = 1 ' Binary file is encoded
        Dim strEncodeString As String
        Dim strPicPath As String
        Dim objXML
        Dim objDocElem
        Dim objStream

        On Error GoTo ErrorHandler

        'strPicPath = "G:\systemarchitect\Macros\Development\MenuButtonStuff\colorchange.bmp"
        'strPicPath = "G:\systemarchitect\Macros\Development\MenuButtonStuff\diagramcheck.bmp"
        'strPicPath = "G:\systemarchitect\Macros\Development\MenuButtonStuff\enterprocesssteps.bmp"
        'strPicPath = "G:\systemarchitect\Macros\Development\MenuButtonStuff\Review16X16.bmp"
        'strPicPath = "G:\systemarchitect\Macros\Development\MenuButtonStuff\Z2Approve16X16.bmp"
        'strPicPath = "G:\systemarchitect\Macros\Development\MenuButtonStuff\Z3List16X16.bmp"
        'strPicPath = "G:\systemarchitect\Macros\Development\MenuButtonStuff\Z4Promote16X16.bmp"
        'strPicPath = "G:\systemarchitect\Macros\Development\MenuButtonStuff\A1_Import_Export16X16.bmp"
        'strPicPath = "G:\systemarchitect\Macros\Development\MenuButtonStuff\A2_Identity_Importer16X16.bmp"
        'strPicPath = "G:\systemarchitect\Macros\Development\MenuButtonStuff\A3_SCCM Server Import16X16.bmp"

        strPicPath = "G:\systemarchitect\Macros\Development\MenuButtonStuff\Review16X16.bmp"

        ' Open data stream from picture
        Set objStream = CreateObject("ADODB.Stream")
        objStream.Type = adTypeBinary
        objStream.Open
        objStream.LoadFromFile (strPicPath)

        ' Create XML Document object and root node
        ' that will contain the data
        Set objXML = CreateObject("MSXml2.DOMDocument")
        Set objDocElem = objXML.createElement("Base64Data")
        objDocElem.dataType = "bin.base64"

        ' Set binary value
        objDocElem.nodeTypedValue = objStream.Read()

        ' Get base64 value
        strEncodeString = objDocElem.Text

        frmUtility.txtDisplay.Value = strEncodeString

        frmUtility.Show
        ' Clean all
        Set objXML = Nothing
        Set objDocElem = Nothing
        Set objStream = Nothing
        Exit Sub

        ErrorHandler:

        ErrorHandler "Error occurred in Process - fnSymbolIsDefined"

        End Sub
        bmp, png, jpg 16X16 files is all I have tried.