Listing CTB Files ?

Listing CTB Files ?

Anonymous
Not applicable
166 Views
2 Replies
Message 1 of 3

Listing CTB Files ?

Anonymous
Not applicable
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 # "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 # -1)
[5.28] (#list> #)
[6.24] (vlax-safearray->list #)
[7.19] (GETCTB)
[8.15] (#)
[9.12] (# "(getctb)" T #)
:CALLBACK-ENTRY.6 (:CALLBACK-ENTRY)
:ARQ-SUBR-CALLBACK.3 (nil 0)

Thanks for any help
Peter
0 Likes
167 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Peter

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

Peter
0 Likes
Message 3 of 3

Anonymous
Not applicable
That seems to do it - Thanks Peter
0 Likes