Listing CTB Files ?

Discussion in 'AutoCAD' started by petervose, Sep 20, 2004.

  1. petervose

    petervose Guest

    Hi, I'm attempting to return a list of available CTB files, but
    I keep returning an error which I don't understand. Any clarification would be great. The code is:
    (defun getctb ()
    (vlax-safearray->list
    (vlax-variant-value
    (vla-getplotstyletablenames
    (vla-get-activelayout
    (vla-get-activedocument
    (vlax-get-acad-object)
    )
    )
    )
    )
    )
    )

    and the error returned is:
    Backtrace:
    [0.57] (VL-BT)
    [1.53] (*ERROR* "ActiveX Server returned an error: Invalid index")
    [2.48] (_call-err-hook #<SUBR @01c393fc *ERROR*> "ActiveX Server returned an
    error: Invalid index")
    [3.42] (sys-error "ActiveX Server returned an error: Invalid index")
    :ERROR-BREAK.37 nil
    [4.34] (safearray-get-element #<safearray...> -1)
    [5.28] (#<SUBR @01c3c104 safearray->list> #<safearray...>)
    [6.24] (vlax-safearray->list #<safearray...>)
    [7.19] (GETCTB)
    [8.15] (#<SUBR @01c39244 -rts_top->)
    [9.12] (#<SUBR @01cd2334 veval-str-body> "(getctb)" T #<FILE internal>)
    :CALLBACK-ENTRY.6 :)CALLBACK-ENTRY)
    :ARQ-SUBR-CALLBACK.3 (nil 0)

    Thanks for any help
    Peter
     
    petervose, Sep 20, 2004
    #1
  2. Peter

    You may need to call vla-RefreshPlotDeviceInfo first on the active layout -

    Peter
     
    petersciganek, Sep 20, 2004
    #2
  3. petervose

    petervose Guest

    That seems to do it - Thanks Peter
     
    petervose, Sep 20, 2004
    #3
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.