Sheet Set Creation with vb.net

Discussion in 'AutoCAD' started by pherr, May 12, 2004.

  1. pherr

    pherr Guest

    I am working on a vb.net program to set up sheet sets for our projects. I have it working, however I can not seem to set the newSheetLocation in the sheet set or subset. Autodesk has very limited documentation on the sheet set objects. If anyone has worked with this yet let me know.

    ph
     
    pherr, May 12, 2004
    #1
  2. pherr

    JimmyTAdams Guest

    Did you ever have any luck with this? I am trying to do the same thing. I have succeeded in adding it (it even shows up in the Sheet Set Properties window). However, when I click on New Sheet, I get an error telling me to define a location for the sheets. A portion of my code is included below:

    Private Function BuildSheetSet() As Boolean
    Dim oSSM As AcSmSheetSetMgr
    Dim oSheetSetDb As AcSmDatabase
    Dim oSheetSet As AcSmSheetSet
    Dim oSheetPath As New AcSmFileReference

    On Error GoTo ErrHandler

    Set oSSM = New AcSmSheetSetMgr
    Set oSheetSetDb = oSSM.OpenDatabase(pth_dwgs & strYear & "\" & strJobNum & "\" & strJobNum & ".dst", False)

    oSheetSetDb.LockDb oSheetSetDb

    Set oSheetSet = oSheetSetDb.GetSheetSet
    oSheetSet.SetName (strJobNum)
    oSheetSet.SetDesc ("Job Number " & strJobNum)

    oSheetPath.InitNew oSheetSet
    oSheetPath.SetFileName (pth_dwgs & strYear & "\" & strJobNum)

    oSheetSet.SetNewSheetLocation oSheetPath

    GoSub Cleanup

    BuildSheetSet = True

    Exit Function

    Cleanup:
    oSheetSetDb.UnlockDb oSheetSetDb

    Set oSheetPath = Nothing
    Set oSheetSet = Nothing
    Set oSheetSetDb = Nothing
    Set oSSM = Nothing
    Return

    ErrHandler:
    GoSub Cleanup
    BuildSheetSet = False
    End Function
     
    JimmyTAdams, Jun 25, 2004
    #2
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.