Is continuous a proper linetype?

Discussion in 'AutoCAD' started by Dave F, Aug 20, 2003.

  1. Dave F

    Dave F Guest

    Hi
    A2k2

    Why does this return the error: Key not Found?

    <snip>
    LtName = "continuous"
    Set LtypeObj = ThisDrawing.Linetypes.Item(LtName) ' find linetype
    Debug.Print Err.Description

    in a completely purged dwg the count method returns a total of 3 linetypes:
    Bylayer,Byblock & Continuous.

    Any ideas as to what's going wrong?

    Thanks in advance

    Dave F.
     
    Dave F, Aug 20, 2003
    #1
  2. Dave F

    joesu Guest

    Dave,

    Here is your corrected code. My suspicion is you using Option Explicit. Frankly, I don't understand how the code ran at all.

    Joe
    --

    Option Explicit

    Public Sub Test() Dim ltname As String Dim ltypeobj As AcadLineType &nbsp;&nbsp;ltname = "continuous" &nbsp;&nbsp;Set ltypeobj = ThisDrawing.Linetypes.Item(ltname) ' find linetype &nbsp;&nbsp;Debug.Print Err.Description End Sub
     
    joesu, Aug 21, 2003
    #2
  3. Dave F

    joesu Guest

    It's too early in the morning and I didn't check my grammar before I send my last post. So here is what I meant to say.

    "My suspicion is you are not using Option Explicit."

    Joe
    --
     
    joesu, Aug 21, 2003
    #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.