I tried that with some less elegant code (I like your code). My code does zero the Z-values but they are still listing as -6.3281E+99 afterwards even though the entity's association list shows Z = 0.0 for association #s 10,12 & 110
Here are both the object data and the entity association list:
Select object: ; IAcadMLeader: AutoCAD Multi-Leader Interface
; Property values:
; Application (RO) = Exception occurred
; ArrowheadBlock = "DIMARO"
; ArrowheadSize = 0.125
; ArrowheadType = 20
; BlockConnectionType = 0
; BlockScale = 1.0
; ContentBlockName = ""
; ContentBlockType = 6
; ContentType = 2
; Document (RO) = #<VLA-OBJECT IAcadDocument 00000179bce86c08>
; DogLegged = -1
; DoglegLength = 0.125
; EntityTransparency = "ByLayer"
; Handle (RO) = "6E12"
; HasExtensionDictionary (RO) = 0
; Hyperlinks (RO) = #<VLA-OBJECT IAcadHyperlinks 0000017a1e362678>
; LandingGap = 0.045
; Layer = "C-VI041DIMS"
; LeaderCount (RO) = 1
; LeaderLineColor = #<VLA-OBJECT IAcadAcCmColor 0000017a1e362f70>
; LeaderLinetype = "ByBlock"
; LeaderLineWeight = -2
; LeaderType = 1
; Linetype = "ByLayer"
; LinetypeScale = 1.0
; Lineweight = -1
; Material = "ByLayer"
; ObjectID (RO) = 79
; ObjectName (RO) = "AcDbMLeader"
; OwnerID (RO) = 112
; PlotStyleName = "ByLayer"
; ScaleFactor = 20.0
; StyleName = "STandard"
; TextAttachmentDirection = 0
; TextBackgroundFill = -1
; TextBottomAttachmentType = 0
; TextDirection = 5
; TextFrameDisplay = 0
; TextHeight = 0.11
; TextJustify = 1
; TextLeftAttachmentType = 1
; TextLineSpacingDistance = 3.66667
; TextLineSpacingFactor = 1.0
; TextLineSpacingStyle = 1
; TextRightAttachmentType = 5
; TextRotation = 0.0
; TextString = "S 68°53'19\" E 51.54'"
; TextStyleName = "Standard"
; TextTopAttachmentType = 0
; TextWidth = 0.0
; TrueColor = #<VLA-OBJECT IAcadAcCmColor 0000017a1e362fd0>
; Visible = -1
Layer name (lname): C-VI041DIMS
Pick point (nselp): 1643424.0459, 581072.3523, 0
First def pt (pt10): 1643432.4055, 581082.8099, 0
Entity type : MULTILEADER
Entity list is named: edata
Command:
Command: EDUMP
WCS coordinates = nil
-1 = ENAME <Entity name: 179f3f8b620>
0 = STR MULTILEADER
5 = STR 6E12
8 = STR C-VI041DIMS
10 = LIST (1.64343e+06 581083.0 0.0)
11 = LIST (0.0 0.0 1.0)
12 = LIST (1.64343e+06 581084.0 0.0)
13 = LIST (1.0 0.0 0.0)
40 = REAL 20.0
41 = REAL 2.2
42 = REAL 0.0
43 = REAL 0.0
44 = REAL 0.0
45 = REAL 1.0
67 = INT 0
90 = INT -1023410170
91 = INT -1073741824
92 = INT 0
93 = INT 0
95 = INT 3
100 = STR AcDbEntity
110 = LIST (1.64341e+06 581052.0 0.0)
111 = LIST (1.0 0.0 0.0)
112 = LIST (0.0 1.0 0.0)
140 = REAL 2.5
141 = REAL 1.25
142 = REAL 0.0
143 = REAL 0.0
145 = REAL 0.9
170 = INT 1
171 = INT 1
172 = INT 5
173 = INT 0
174 = INT 1
175 = INT 3
176 = INT 0
177 = INT 0
178 = INT 0
179 = INT 1
270 = INT 2
271 = INT 0
272 = INT 9
273 = INT 9
290 = INT 1
291 = INT 1
292 = INT 1
293 = INT 0
294 = INT 0
295 = INT 0
296 = INT 0
297 = INT 0
300 = STR CONTEXT_DATA{
301 = STR }
302 = STR LEADER{
303 = STR }
304 = STR S 68°53'19" E 51.54'
305 = STR }
330 = ENAME <Entity name: 1821d537020>
340 = ENAME <Entity name: 1821d537230>
341 = ENAME <Entity name: 0>
342 = ENAME <Entity name: 1821d537350>
343 = ENAME <Entity name: 1821d537230>
410 = STR Model
I created a routine a little while back that removes all the leaders from a MULTILEADER using Visual Lisp (vla-removeleader ...) and then it adds back a couple of leaders via (COMMAND ...) input (here, latest lisp of that is attached). Doing that fixed this problem. It seems that something about the leader part of the MULTILEADER gets jacked and it simply cannot be repaired by autolisp as far as I can tell. Removing it via the context (right-click) menu does not fix it either. Doing that leaves a jacked up Z-value:
MULTILEADER Layer: "C-VI046NOTE"
Space: Model space
Handle = 6e0d
Leader Type: StraightLeader
Content Type: MTextContent
Landing: ON
Leader Number: 0
Vertex: X = 1643382.1137, Y = 581080.0480, Z = 0.0000
Vertex: X = 1643392.4306, Y = 581103.7736, Z = -6.3281E+99
Multileader style: STandard
Annotative: NO
P.S. Assoc 90,91 values were puzzling and they could not be changed via autolisp.
P.P.S I ran into a MULTILEADER that did not like any of these efforts (and I found I needed to force the Z-values in my lisp routine to 0.0... so I made that change and reattached it... but that did not help my troublesome MULTILEADER to like it). So, I exploded the multileader and then exploded the "Previous" selection (all its parts) and then deleted the subsequent "Previous" selection except for the TEXT objects. Then, I recreated the Multileader from the TEXT and that worked <whew... what a chore!> .
AutoCAD User since 1989. Civil Engineering Professional since 1983
Product Version: 13.6.1963.0 Civil 3D 2024.4.1 Update Built on: U.202.0.0 AutoCAD 2024.1.6
27.0.37.14 Autodesk AutoCAD Map 3D 2024.0.1
8.6.52.0 AutoCAD Architecture 2024