test_52
2nd May 2005, 05:07 pm
I am hoping that someone can help me work this out. I can't find any info on it anywhere else. I am trying to write a VBA program to draw a mline. I need to be able to change the distance between the mlines. I can do this thru the autocad command line by either changing the scale of the standard style or creating a new style for the distance between the lines. I cannot figure out how to do this in VBA thou. I have written the macro that will draw the mline, which I have listed below, but can't change the settings. Can anyone help?
Sub Ductwork()
Dim Duct As AcadMLine
Dim StPoint As Variant
Dim EndPoint As Variant
Dim Points(5) As Double
Dim Count As Integer
Dim EndCounter As Integer
Dim DuctExp As Variant
'get user entered points
With ThisDrawing.Utility
StPoint = .GetPoint(, "Enter start point: ")
EndPoint = .GetPoint(, "Enter end point: ")
End With
'enter start point and end point into Points double
For Count = 0 To 2
Points(Count) = StPoint(Count)
EndCounter = Count + 3
Points(EndCounter) = EndPoint(Count)
Next Count
'create mline
Set Duct = ThisDrawing.ModelSpace.AddMLine(Points)
End Sub
Thanks,
Jason
Sub Ductwork()
Dim Duct As AcadMLine
Dim StPoint As Variant
Dim EndPoint As Variant
Dim Points(5) As Double
Dim Count As Integer
Dim EndCounter As Integer
Dim DuctExp As Variant
'get user entered points
With ThisDrawing.Utility
StPoint = .GetPoint(, "Enter start point: ")
EndPoint = .GetPoint(, "Enter end point: ")
End With
'enter start point and end point into Points double
For Count = 0 To 2
Points(Count) = StPoint(Count)
EndCounter = Count + 3
Points(EndCounter) = EndPoint(Count)
Next Count
'create mline
Set Duct = ThisDrawing.ModelSpace.AddMLine(Points)
End Sub
Thanks,
Jason