Help fixing Mleader Vertex

Help fixing Mleader Vertex

Anonymous
Not applicable
359 Views
4 Replies
Message 1 of 5

Help fixing Mleader Vertex

Anonymous
Not applicable
I need a program that will check all the mleaders for a vertex value of *,*,0. If it is not *,*,0 then it needs to make it so.
can anyone help out, or at least get me pointed in the right direction ?

thanks
0 Likes
360 Views
4 Replies
Replies (4)
Message 2 of 5

Anonymous
Not applicable
Hi,

If i were doing this i'd build a selection set of leaders, using selection set filters and acselectall and then set each filter object match to a mleader object, then cycle through each objects coordinates to look for z values not = 0. Those mleaders that didn't comply, i'd create and apply new coordinate values with z = 0.
0 Likes
Message 3 of 5

Anonymous
Not applicable
Thanks for the reply. Would you have any code snippettes i could see to start with?
Finding, comparing & fixing the z coordinate is a where i've really hit the wall 😞
0 Likes
Message 4 of 5

Anonymous
Not applicable
{code}
Sub MLeaderZs()
Dim objLeader As Object
Dim varCoords As Variant
Dim j As Integer
'Dim myAnnotation As AcadEntity
Dim myInsPt As Variant
AppActivate ThisDrawing.Application.Caption
ThisDrawing.Utility.GetEntity objLeader, varBasePt, vbCr & "Select leader:"
'Set myAnnotation = objLeader.Annotation
' need to set insertionpoint of annotation if applicable
' get leader coordinates
varCoords = objLeader.Coordinates
'assign z's
For j = 2 To UBound(varCoords) Step 3
varCoords(j) = 0#
Next j
'assign coordinates
objLeader.Coordinates = varCoords
End Sub
{code}
0 Likes
Message 5 of 5

Anonymous
Not applicable
Wow, thanks for the code. I tried it out quick & this only works for dimension leaders right?, I get an error from the multileader object saying it doesnt have a coordinates property, but it worked perfectly on my quick leader.
If theres anything i can do to return the favor, just ask.
0 Likes