.NET

.NET

Reply
Valued Contributor
61 Posts
0 Kudos
Registered: ‎06-19-2002
Post 1 of 1

Can not get external raster reference attribute

74 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
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!