Message 1 of 5
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi there,
I can find which images are attached to my current drawing with the following code. However, I don't know how to find out how many times they are attached.
Anybody ?
Using tr As Transaction = db.TransactionManager.StartTransaction
Try
Dim nod As DBDictionary
Dim imageDict As DBDictionary
Console.WriteLine("Getting ACAD_IMAGE_DICT DB dictionary")
nod = CType(tr.GetObject(db.NamedObjectsDictionaryId, OpenMode.ForRead, False), DBDictionary)
imageDict = CType(tr.GetObject(nod.GetAt("ACAD_IMAGE_DICT"), OpenMode.ForRead, False), DBDictionary)
For Each dicentry As DBDictionaryEntry In imageDict
Dim myRasterImgDef As RasterImageDef = CType(tr.GetObject(CType(dicentry.Value, ObjectId), OpenMode.ForRead), RasterImageDef)
If myRasterImgDef.IsLoaded Then
Console.WriteLine("Found: " & myRasterImgDef.ActiveFileName)
' NEED TO COUNT INSTANCES HERE
Else
Console.WriteLine("Not found: " & myRasterImgDef.SourceFileName)
End If
Next
tr.Commit()
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.ToString, "Configurator", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Stop)
End Try
End UsingThanx in advance
Solved! Go to Solution.