biguelo Posted February 1, 2015 Posted February 1, 2015 Hi, I'm trying to draw a MLINE using the vertex of a Polyline and that part of the macro works ok, but when I try to change the justification and/or the scale of the MLINE changing the system variables before drawing the MLINE, it doesn't work, I always get the same justification and/or scale. The strangest thing is that when I check the system variables in the command line they have the value the macro set but the MLINE drawn by the macro doesn't assume the new justification and/or scale. What is the problem? Using Autocad 2009 or 2014. Here is my code> Public Sub poly() Dim pline As AcadLWPolyline Dim multiLine As AcadMLine Dim points(0 To 5) As Double Dim mpoints(0 To As Double Dim varData As Variant points(0) = 2: points(1) = 4 points(2) = 4: points(3) = 2 points(4) = 6: points(5) = 8 mpoints(0) = 2: mpoints(1) = 4: mpoints(2) = 0 mpoints(3) = 4: mpoints(4) = 2: mpoints(5) = 0 mpoints(6) = 6: mpoints(7) = 8: mpoints( = 0 ThisDrawing.SetVariable "CMLJUST", 1 ThisDrawing.SetVariable "CMLSCALE", 3 ThisDrawing.Regen acActiveViewport Set pline = ThisDrawing.ModelSpace.AddLightWeightPolyline(points) Set multiLine = ThisDrawing.ModelSpace.AddMLine(mpoints) multiLine.Update ThisDrawing.Application.ZoomAll End Sub Thanks Quote
RICVBA Posted February 3, 2015 Posted February 3, 2015 Try using MLine properties instead of system variables for instance multiLine.Justification = acBottom multiLine.Lineweight = acLnWt005 Quote
biguelo Posted February 8, 2015 Author Posted February 8, 2015 Thank you, it worked. Just one correction, to change the Scale the property is MLineScale not Lineweight. Regards. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.