2 Replies Latest reply on Aug 18, 2014 1:25 PM by Robert Maillet

    Preview / Bitmap Image of Part in BOM

    Todd Becker

      How can I incorporate a preview image into a BOM?

       

      Currently we send out a BOM to our assembly area that contains information such as raw material, etc.  The only thing the assembly guy needs to go find the part in fabrication is part number, description and a small bitmap image.  Is this possible?  Where does EPDM store the static image preview?

       

      Here is what I want to accomplish....

       

      bom2.jpg

       

      Thanks.

       

      Todd

        • Re: Preview / Bitmap Image of Part in BOM
          Robert Maillet

          I have not looked at this in great detail, but here is what I know about EPDM file storage.

           

          I retrieve files from the vault, typically PDFs and basic stuff.

           

          Table dbo.documents is where you want to start. Search for your SLDPRT/SLDASM making sure to get the correct DocumentID.

           

          Using this documentID, convert it to a Base 16 Hex number and using this Hex number, look into your storage location on your server under the folder "Data" and you will see a bunch of folders that are sorted based on the last character of your hex number (I think, take a look and it should make sense). There should be a folder that matches your Hex Document ID and inside will be all the files that have been checked in for this part, and you will see the BMPs there too. I'm not sure what the naming convention of the BMP image are... but you are probably safe to use the latest created file date for the BMP file.

           

          A custom API could be set up to read the BOM using out of the box API functions... and your BMP column would have to be SQL direct. Unless there is an API call to get the BMP file, I personally do not know if there is one. Check the API documentation of course before setting out to do the SQL thing.

           

          For Ref, here is some code I use to convert a double to a base16HexNo.

           

          See Next Post

            • Re: Preview / Bitmap Image of Part in BOM
              Robert Maillet

              Wow... the copy and paste didn't work correctly. Updated function

              ''''''''''''''''''''''''''''''''''''''''''''''''''''''

              Public Function ConvertDec2Hex(Number As Double) As String
                      Dim FinalHexNo As String = ""
                      Dim n As Int16, i As Int16
                      Dim Hex16() As String

                      If (Number < 1) And (Number > 0) Then
                          Err.Raise(2, , "Error, this function has not been updated to accept numbers less than 1")
                      ElseIf Number = 0 Then
                          Return "0"
                      ElseIf Number < 0 Then
                          Err.Raise(3, , "Error, this function has not been updated to accept negative numbers")
                      End If

                      n = 0
                      Do While True
                          If 16 ^ n > Number Then Exit Do
                          n = n + 1
                      Loop
                      n = n - 1

                      ReDim Hex16(n)

                      For i = n To 0 Step -1
                          Hex16(i) = Trim(Str(Int(Number / 16 ^ i)))
                          FinalHexNo = FinalHexNo & GetHex(Hex16(i))

                          Number = Number - CInt(Hex16(i)) * 16 ^ i

                      Next i

                      Return FinalHexNo
              End Function