.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Can not get external raster reference attribute

0 REPLIES 0
Reply
Message 1 of 1
rtejada
191 Views, 0 Replies

Can not get external raster reference attribute

I am looking for reading the path attribute of a raster external reference. I am able to read the path attribute of a external reference dwg file inserted by doing the code below. The btr variable list all the xref dwg blocks but it skip the external raster references.
Any help I will really appreciate.

Dim db As New Database
db.ReadDwgFile(localFileName, IO.FileShare.ReadWrite, False, Nothing)
Using trans As Transaction = db.TransactionManager.StartTransaction()
Dim bt As BlockTable = CType(trans.GetObject(db.BlockTableId, OpenMode.ForRead), BlockTable)
Dim btr As BlockTableRecord
Dim blockId As ObjectId
Dim iter As IEnumerator
iter = bt.GetEnumerator()
Do While iter.MoveNext()
blockId = CType(iter.Current, ObjectId)
btr = CType(trans.GetObject(blockId, OpenMode.ForRead, False), BlockTableRecord)
If btr.IsFromExternalReference Then
Try
GetXwebUrl(btr.PathName)
If Not IsNothing(xWebUrl.SiteUrl) Then Me.CopyUrlXrefLocally() ' this is needed to load relative path xrefs
Catch ex As Exception
If MessageBox.Show("The Xref at " & btr.PathName & " could not be located. Would you like to continue loading the rest of the external references?", "CADtoSharePoint", MessageBoxButtons.YesNo, MessageBoxIcon.Exclamation, MessageBoxDefaultButton.Button1) = DialogResult.No Then Exit Sub
End Try
End If
Loop
End Using
0 REPLIES 0

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost