A leader object is similar to, but different from a dimension. You can follow the same selection and looping process through based on the current code.
You can use the following code snippet to get the DXF Code 0 of an object in a drawing:
(assoc 0 (entget (car (entsel))))
Along the same lines, the following can be used to return the property names that can be used with the setpropertyvalue and its companion function getpropertyvalue:
(dumpallproperties (car (entsel)))
The following demonstrates how to select and modify a leader object, you might need to adjust the logic related to the Arrowhead Size if it should be applied to one or the other dimension style:
(defun c:UpdateDimensions25 ( / dimStyleMappings dimStyleMap sel cnt ent cannoscale-sav)
; Insert block and explode it
(command "ddinsert" "s" "25" pause)
(command "explode" (entlast))
;; Set the Dimension Style Mappings (old_style new_style)
(setq dimStyleMappings (list '("UM_25.000000" "Unidade cm")
'("UM_20.000000" "Unidade cm")))
;; Change the current annotation scale
(setq cannoscale-sav (getvar "cannoscale"))
(setvar "cannoscale" "1:25 cm")
;; Step through the dimension style mappings
(foreach dimStyleMap dimStyleMappings
;; Select the dimensions that use the old style in the current mapping
(if (setq sel (ssget "X" (list (cons 0 "dimension") (cons 3 (nth 0 dimStyleMap)))))
(progn
(setq cnt 0)
;; Step through all select objects
(while (< cnt (sslength sel))
(setq ent (ssname sel cnt)
cnt (1+ cnt))
;; Change the style of the selected dimension
(setpropertyvalue ent "DimensionStyle" (tblobjname "dimstyle" (nth 1 dimStyleMap)))
;; Change the Linear Scale Factor for "UM_25.000000" style only
(if (= (nth 0 dimStyleMap) "UM_20.000000")
(setpropertyvalue ent "Dimlfac" 0.80)
)
)
)
)
;; Select the leaders that use the old style in the current mapping
(if (setq sel (ssget "X" (list (cons 0 "leader") (cons 3 (nth 0 dimStyleMap)))))
(progn
(setq cnt 0)
;; Step through all select objects
(while (< cnt (sslength sel))
(setq ent (ssname sel cnt)
cnt (1+ cnt))
;; Change the style of the selected dimension
(setpropertyvalue ent "DimensionStyle" (tblobjname "dimstyle" (nth 1 dimStyleMap)))
;; Change the Arrowhead Size for "UM_25.000000" style only
(if (= (nth 0 dimStyleMap) "UM_20.000000")
(setpropertyvalue ent "Dimasz" 4.0)
)
)
)
)
)
;; Move the text of all dimensions Home
(command "_.dimedit" "_Home" "_all" "")
;; Restore the previous annotation scale
(setvar "cannoscale" cannoscale-sav)
(princ)
)