Sheet Set Custom Properties!!

Discussion in 'AutoCAD' started by Mark Douglas, Jun 24, 2004.

  1. Mark Douglas

    Mark Douglas Guest

    Ok this probably is a easy thing to code for some of you. We have some
    custom Fields in 2005 that look for the exact correct Custom Sheet Set
    properties. Draw back is some of the Custom Properties are a pain to try and
    type in absolutely correct every time. Also we have about 200 sheet sets
    going on our current jobs. I was wondering if someone had a code that
    attaches a Custom properties to a sheet set. Im looking for "Job Number"
    "Job Name" this kind of thing. Anyone got any ideas to get me on the right
    track?

    Thanks everyone for any help!!!

    Mark

    (p.s. Im still learning the basics on VB, & I know the Sheet Set stuff is a
    little advanced)
     
    Mark Douglas, Jun 24, 2004
    #1
  2. Mark Douglas

    JimmyTAdams Guest

    Here is a quick code snipit that opens a Sheet set and adds some custom properties:

    Private Function BuildSheetSet() As Boolean
    Dim oSSM As AcSmSheetSetMgr
    Dim oSheetSetDb As AcSmDatabase
    Dim oSheetSet As AcSmSheetSet
    Dim oProjNum As New AcSmCustomPropertyValue
    Dim oProjDate As New AcSmCustomPropertyValue
    Dim PropFlag As PropertyFlags

    On Error GoTo ErrHandler

    PropFlag = CUSTOM_SHEETSET_PROP

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

    oSheetSetDb.LockDb oSheetSetDb

    Set oSheetSet = oSheetSetDb.GetSheetSet

    oProjNum.InitNew oSheetSet
    oProjNum.SetFlags PropFlag
    oProjNum.SetValue "05000"
    oSheetSet.GetCustomPropertyBag.SetProperty "Project Number", oProjNum

    oProjDate.InitNew oSheetSet
    oProjDate.SetFlags PropFlag
    oProjDate.SetValue Format(Date, "MM/DD/YYYY")
    oSheetSet.GetCustomPropertyBag.SetProperty "Project Date", oProjDate

    GoSub Cleanup

    BuildSheetSet = True

    Exit Function

    Cleanup:
    oSheetSetDb.UnlockDb oSheetSetDb

    Set oProjDate = Nothing
    Set oProjNum = 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.