<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Iterate Through Raster Images/Image Dictionary in .NET Forum</title>
    <link>https://forums.autodesk.com/t5/net-forum/iterate-through-raster-images-image-dictionary/m-p/3350939#M57121</link>
    <description>&lt;P&gt;If anyone's wondering this is how I got it to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;   'Start(Transaction)
        Using myTrans As Transaction = DatabaseIn.TransactionManager.StartTransaction

            'Take a Look at Attachments
            'Open The Dictionary 
            Dim nod As DBDictionary
            Dim imageDict As DBDictionary

            nod = CType(myTrans.GetObject(DatabaseIn.NamedObjectsDictionaryId, OpenMode.ForRead, False), DBDictionary)
            imageDict = CType(myTrans.GetObject(nod.GetAt("ACAD_IMAGE_DICT"), OpenMode.ForRead, False), DBDictionary)

            Dim msg As String = ""
            For Each dicentry As DBDictionaryEntry In imageDict
                Dim myRasterImgDef As RasterImageDef = CType(myTrans.GetObject(CType(dicentry.Value, ObjectId), OpenMode.ForRead), RasterImageDef)


                msg = (msg &amp;amp; myRasterImgDef.ActiveFileName &amp;amp; vbTab &amp;amp; myRasterImgDef.FileType &amp;amp; vbCr &amp;amp; _
                            vbTab &amp;amp; myRasterImgDef.SourceFileName &amp;amp; vbCrLf)
            Next
            MsgBox(msg)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 28 Feb 2012 21:36:17 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2012-02-28T21:36:17Z</dc:date>
    <item>
      <title>Iterate Through Raster Images/Image Dictionary</title>
      <link>https://forums.autodesk.com/t5/net-forum/iterate-through-raster-images-image-dictionary/m-p/3350739#M57118</link>
      <description>&lt;P&gt;Here's the Code I have so far:&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to iterate through the Image Dictionary and Connect into the Raster ImageDef Properties.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to be able to modify and fix missing Raster Images.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can someone help me get this code sorted out.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;For Each myObjID As ObjectId In myModelSpace
                Dim myEnt As Entity = myObjID.GetObject(OpenMode.ForRead)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;If TypeOf myEnt Is Image Then
                        Dim myRasterImg As RasterImage
                        Dim myRasterImgDef As RasterImageDef

                        'Open The Dictionary 
                        Dim ImgDict As ObjectId = RasterImageDef.GetImageDictionary(DatabaseIn)

                        For Each dictEntry In ImgDict


                        Next



End If&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2012 19:44:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/iterate-through-raster-images-image-dictionary/m-p/3350739#M57118</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-28T19:44:17Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate Through Raster Images/Image Dictionary</title>
      <link>https://forums.autodesk.com/t5/net-forum/iterate-through-raster-images-image-dictionary/m-p/3350801#M57119</link>
      <description>&lt;P&gt;assuming transaction "avctivetx" is started&lt;/P&gt;&lt;P&gt;For Each dicentry As DBDictionaryEntry In imageDict&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim rasterimgDef As RasterImageDef = CType(activetx.GetObject(CType(dicentry.Value, ObjectId), OpenMode.ForRead), RasterImageDef)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; msg = msg &amp;amp; rasterimgDef.ActiveFileName &amp;amp; vbCrLf&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Next&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2012 20:21:03 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/iterate-through-raster-images-image-dictionary/m-p/3350801#M57119</guid>
      <dc:creator>fieldguy</dc:creator>
      <dc:date>2012-02-28T20:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate Through Raster Images/Image Dictionary</title>
      <link>https://forums.autodesk.com/t5/net-forum/iterate-through-raster-images-image-dictionary/m-p/3350927#M57120</link>
      <description>&lt;P&gt;How would I get the RasterImageDef and it's attached properties?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;ElseIf TypeOf myEnt Is Image Then

                    Dim myExtImage As New extractRasterImage

                    Dim myRasterImage As RasterImage = CType(myTrans.GetObject(myEnt.ObjectId, OpenMode.ForRead), RasterImage)
                    MsgBox(myRasterImage.Path)

                    myExtImage.Path = myRasterImage.Path

                    myExtractedDB.RasterImages.Add(myExtImage)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2012 21:31:01 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/iterate-through-raster-images-image-dictionary/m-p/3350927#M57120</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-28T21:31:01Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate Through Raster Images/Image Dictionary</title>
      <link>https://forums.autodesk.com/t5/net-forum/iterate-through-raster-images-image-dictionary/m-p/3350939#M57121</link>
      <description>&lt;P&gt;If anyone's wondering this is how I got it to work.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;   'Start(Transaction)
        Using myTrans As Transaction = DatabaseIn.TransactionManager.StartTransaction

            'Take a Look at Attachments
            'Open The Dictionary 
            Dim nod As DBDictionary
            Dim imageDict As DBDictionary

            nod = CType(myTrans.GetObject(DatabaseIn.NamedObjectsDictionaryId, OpenMode.ForRead, False), DBDictionary)
            imageDict = CType(myTrans.GetObject(nod.GetAt("ACAD_IMAGE_DICT"), OpenMode.ForRead, False), DBDictionary)

            Dim msg As String = ""
            For Each dicentry As DBDictionaryEntry In imageDict
                Dim myRasterImgDef As RasterImageDef = CType(myTrans.GetObject(CType(dicentry.Value, ObjectId), OpenMode.ForRead), RasterImageDef)


                msg = (msg &amp;amp; myRasterImgDef.ActiveFileName &amp;amp; vbTab &amp;amp; myRasterImgDef.FileType &amp;amp; vbCr &amp;amp; _
                            vbTab &amp;amp; myRasterImgDef.SourceFileName &amp;amp; vbCrLf)
            Next
            MsgBox(msg)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2012 21:36:17 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/iterate-through-raster-images-image-dictionary/m-p/3350939#M57121</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-28T21:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: Iterate Through Raster Images/Image Dictionary</title>
      <link>https://forums.autodesk.com/t5/net-forum/iterate-through-raster-images-image-dictionary/m-p/3350957#M57122</link>
      <description>&lt;P&gt;Never mind...&amp;nbsp;&lt;/P&gt;&lt;P&gt;Found it&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;  ElseIf TypeOf myEnt Is Image Then
                    'Database Image Attachment

                    Dim myExtImage As New extractRasterImage
                    Dim myRasterImage As RasterImage = CType(myTrans.GetObject(myEnt.ObjectId, OpenMode.ForRead), RasterImage)
                    Dim myRasterImageDef As RasterImageDef = CType(myTrans.GetObject(myRasterImage.ImageDefId, OpenMode.ForRead), RasterImageDef)

                 
                    myExtImage.Path = myRasterImage.Path
                    myExtImage.ActiveFullFileName = myRasterImageDef.ActiveFileName
                    MsgBox(myRasterImage.Path &amp;amp; myRasterImageDef.ActiveFileName)

                    myExtractedDB.RasterImages.Add(myExtImage)&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2012 21:46:43 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/net-forum/iterate-through-raster-images-image-dictionary/m-p/3350957#M57122</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2012-02-28T21:46:43Z</dc:date>
    </item>
  </channel>
</rss>

