Draw All Linetypes

Discussion in 'AutoCAD' started by TomD, Jul 1, 2004.

  1. TomD

    TomD Guest

    I wrote this little sub in an effort to straighten out the linetypes we're
    using and thought it may be useful to someone else.

    If not, please ignore.

    Sub DrawEachLType()
    Dim vPnt As Variant, vFPt(2) As Double, vTPt(2) As Double
    Dim oLTyps As AcadLineTypes, oLTyp As AcadLineType
    Dim oLin As AcadLine, oTxt As AcadText

    vPnt = ThisDrawing.Utility.GetPoint(, vbCrLf & "From point: ")
    vFPt(0) = vPnt(0): vFPt(1) = vPnt(1): vFPt(2) = 0#
    vTPt(0) = vPnt(0) + 5#: vTPt(1) = vPnt(1): vTPt(2) = 0#

    Set oLTyps = ThisDrawing.Linetypes
    For Each oLTyp In oLTyps
    vFPt(1) = vFPt(1) + 0.25
    vTPt(1) = vTPt(1) + 0.25
    Set oLin = ThisDrawing.ModelSpace.AddLine(vFPt, vTPt)
    oLin.Linetype = oLTyp.Name
    oLin.Update: Set oLin = Nothing
    Set oTxt = ThisDrawing.ModelSpace.AddText(" " & oLTyp.Name, vTPt, 0.1)
    oTxt.Alignment = acAlignmentMiddleLeft: oTxt.TextAlignmentPoint = vTPt
    oTxt.Update: Set oTxt = Nothing
    Next oLTyp
    Set oLTyps = Nothing

    End Sub
     
    TomD, Jul 1, 2004
    #1
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.