Consulting

Results 1 to 2 of 2

Thread: Change Linetype/layer dashed

  1. #1

    Change Linetype/layer dashed

    Hello,

    Can someone please help me.

    I use this to make a normal line:

    [VBA]
    Dim ACAD As AcadApplication 'Create ACAD variable of type AcadApplication
    On Error Resume Next 'This tells VBA to ignore errors
    Set ACAD = GetObject(, "AutoCAD.Application") 'Get a running instance of the class AutoCAD.Application
    On Error GoTo 0 'This tells VBA to go back to NOT ignoring errors
    If ACAD Is Nothing Then 'Check to see if the above worked
    Set ACAD = New AcadApplication 'Set the ACAD variable to equal a new instance of AutoCAD
    ACAD.Visible = True 'Once loaded, set AutoCAD to be visible
    End If

    ReDim points(0 To 9) As Double
    ' Define the 2D polyline points
    points(0) = posx: points(1) = posy
    points(2) = (posx + breedte): points(3) = posy
    points(4) = (posx + breedte): points(5) = (posy + hoogte)
    points(6) = posx: points(7) = (posy + hoogte)
    points(8) = posx: points(9) = posy

    ACAD.ActiveDocument.ModelSpace.AddLightWeightPolyline (points)

    [/VBA]

    Now I want to change the layer so the line will be Dashed. I dont know how to start. Can someone give me a hint or an example.

    Thanks in advance.

  2. #2
    Moderator VBAX Master Tommy's Avatar
    Joined
    May 2004
    Location
    Houston, TX
    Posts
    1,184
    Location
    If you are still here I will help but you will have to post back. Basically use a var to set it = to the added poly then change the layer property.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •