i want to creat a new line by selecting start and endpoint. at last i want to Change the Color of the line in red. With AutoCAD vba it works fine, but with progcad the message "run-time error 424 object required" appears. after checking the "end" button the line will be created.
here is the used code
Sub line_create_and_change_in_red()
Dim MyDok As Document
Dim Myline As Line
Set MyDok = Application.ActiveDocument
Set p1 = MyDok.Utility.GetPoint(, "Anfangspunkt: ")
Set p2 = MyDok.Utility.GetPoint(, "Endpunkt: ")
Set Myline = MyDok.ModelSpace.AddLine(p1, p2)
Myline.color = Red
End Sub[code]
here is the used code
Sub line_create_and_change_in_red()
Dim MyDok As Document
Dim Myline As Line
Set MyDok = Application.ActiveDocument
Set p1 = MyDok.Utility.GetPoint(, "Anfangspunkt: ")
Set p2 = MyDok.Utility.GetPoint(, "Endpunkt: ")
Set Myline = MyDok.ModelSpace.AddLine(p1, p2)
Myline.color = Red
End Sub[code]