PDA

View Full Version : Change Linetype/layer dashed



kiredw
07-16-2012, 07:33 AM
Hello,

Can someone please help me.

I use this to make a normal line:


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)



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.

Tommy
07-20-2012, 10:23 AM
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.