.NET

.NET

Reply
Valued Contributor
rtejada
Posts: 61
Registered: ‎06-19-2002
Message 1 of 1 (73 Views)

Can not get external raster reference attribute

73 Views, 0 Replies
09-23-2006 06:20 PM
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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.