Sheet Set Error

Sheet Set Error

Anonymous
Not applicable
321 Views
0 Replies
Message 1 of 1

Sheet Set Error

Anonymous
Not applicable
I am trying to import a page into the sheet set manager and my program keeps crashing on me...I was wondering if anyone knows about the attached error...By code is below...Thanks in advance for the help...It crashes at the line "oLayoutRef.SetFileName(CurrentDwg)...

Private Sub FormatDWG(ByVal CurrentDwg As String)

Dim oSSM As New AcSmSheetSetMgr
Dim oSheetDB As New AcSmDatabase
Dim oSheet As AcSmSheetSet
Dim strSheetSetFileName As String = Mid(CurrentDwg, 1, Len(CurrentDwg) - 13) & Main.clsJobData.JobNumber & ".dst"

IO.File.Copy("c:\DefaultSheetSet.dst", _
strSheetSetFileName)

oSheetDB = oSSM.OpenDatabase(strSheetSetFileName)
clsSSProp.LockSSDatabase(oSheetDB)
clsSSProp.UpdateSheetSetProps(oSheetDB)

Dim oLayoutRef As New AcSmNamedAcDbObjectReference

oLayoutRef.InitNew(oSheetDB)
<-----------Crashes here ------------->
oLayoutRef.SetFileName(CurrentDwg)
oLayoutRef.SetName("Layout1")
oSheet = oSheetDB.GetDatabase.GetSheetSet.ImportSheet(oLayoutRef)
IsQuiescent(oAcad)
oAcad.ActiveDocument.SendCommand("REGEN")
IsQuiescent(oAcad)
oAcad.ActiveDocument.MSpace = True
IsQuiescent(oAcad)
Dim index As Integer = 0
Do While oAcad.ActiveDocument.Database.Dictionaries.Item(index).ObjectName "MTEXT"
index += 1
Loop
End Sub
0 Likes
322 Views
0 Replies
Replies (0)