That's not how vl-propagate works. it only passes variable and its value between all open drawings.
here is how i used it passing VC and SZ between all open drawings. once ZAD is run in one drawing any other drawing you run ZAD in will zoom to the same xy location. it was good to look at old revisions.
;;----------------------------------------------------------------------------;;
;; Zoom Area Across Multiple Drawings
(defun C:ZAD (/ a)
(initget "Yes No")
(setq a
(cond
((getkword "\nRedefine Zoom Area? [Yes/No]: ")) ("No")
)
)
(if (= "Yes" a)
(progn
(vl-cmdf "_.Zoom" "W" Pause Pause)
(setq vc (getvar 'viewctr))
(setq SZ (getvar 'viewsize))
(vl-propagate 'vc)
(vl-propagate 'sz)
)
(if (or (= vc nil) (= sz nil))
(prompt "\nPlease Define Zoom Area")
(vl-cmdf "_.Zoom" "C" VC SZ)
)
)
(princ)
)
like i said AutoCAD doesn't like to run one lisp across multiple open drawings. but its been awhile since iv used it. Maybe this would work?
--
edit oops didn't hit post
Yup, that sounds about right... LISP generally cannot perform a function on another open drawing.
In MHUPPs link Lee Mac explains it in there. The only way I've found you can do it is to make a script for example in Lee Macs Script Write or in Script Writer Pro and use that - the drawings have to be closed though
I have some test code and it adjusts a spline can move start or end as a choice.
In the ML it uses 2 points so there is no drama in making a Mleader with a correct length as its just a case of moving arrow along the angle of the leader line. So just reset p2 to be correct length.
This will draw a 2pt leader.
(defun c:wow1 ( / )
(setq p1 (getpoint "\nPick 1st point ")
p2 (getpoint p1 "\n insertion point >> ")
)
(setq ang (angle p1 p2))
(setq d1 (rtos (distance p1 p2) 2 3))
(setq str (strcat "\n existing is " d1 " Enter new length "))
(setq d2 (getreal str))
(setq p2 (polar p1 ang d2))
(command "Mleader" p1 p2 (getstring "\nEnter text "))
(setq ent (vlax-ename->vla-object (entlast)))
(vla-put-DoglegLength ent 0.0)
(princ)
)
(c:wow1)
Note the mleader style must be set to 2 points. For the spline type answer I used 4 points max in the mleader style, I thought that was what you wanted. A 3 -4 curved leader of a known length.
Thanks @mhupp, I'll try that once I finish work tomorrow.
@Steven P, when I replaced the vla-put-ShowPlotStyles with just a (princ "test') I think it only done the current doc. Will test tomorrow.
I think the translation to 1958's lisp is this, although not quite sure is the best
;;; Multi-length
;;; https://www.cadtutor.net/forum/profile/26931-1958/
;;; 28 august 2025
(defun c:ml (/ ent pline txt p1 p2)
(vl-load-com)
(while (setq pline (vlax-ename->vla-object (car (setq ent (entsel "\n indicate the line \n")))))
(setq txt (strcat "L = " (rtos (vlax-curve-getDistAtParam pline (vlax-curve-getEndParam pline)) 2 2) " m" )
)
(setq p1 (vlax-curve-getClosestPointTo pline (cadr ent))
p2 (getpoint p1 "\n insertion point >> \n")
)
(vl-cmdf "_mleader" p1 p2 txt)
(setq ent (vlax-ename->vla-object (entlast)))
(vla-put-TextHeight ent 2.00) ; font size (height)
(vla-put-TextJustify ent 1) ; text alignment (1-left)
(vla-put-TextLeftAttachmentType ent 4) ; append text to left
(vla-put-TextRightAttachmentType ent 4) ; append text to the right
;;; 0 - top of line 1
;;; 1 - middle of line 1
;;; 2 - bottom of line 1
;;; 3 - underline of line 1
;;; 4 - middle of text
;;; 5 - middle of last line
;;; 6 - bottom of last line
;;; 7 - underline of last line
;;; 8 - underline of all text
(vla-put-DoglegLength ent 0.5) ; shelf size (length)
;;; (vla-put-TextStyleName ent "ext til") ; change text style
)
(princ)
)
;|?Visual LISP Format Options?
(100 1 2 2 nil " " 80 60 0 0 0 nil nil nil T)
;*** Please add text under the comments! ***|;
As a spline gives two answers the points answer and another with nodes. So any way if you explode the Mleader then you can get at the spline using this. Just need to check that the spline is last entity, tested in Bricscad. A disclaimer not sure if length is correct. I think it is short by length of arrow. Will try to find arrow length. Yep found it.
(defun c:wow ( / plent pt len lenar)
(setq plent (entsel "\nPick mleader "))
(setq lenar (cdr (assoc 140 (entget (car plent)))))
(command "undo" "M")
(command "explode" (car plent))
(setq ent (ssname (ssget "L") 0))
(setq len (getpropertyvalue ent "length"))
(command "undo" "B")
(alert (strcat "Total length is " (rtos (+ lenar len) 2 3)))
(princ)
)
(c:wow)
I think you could do a "I want a length of 100 by drawing something close then move say arrow point till you get approx 100. Via lisp. It would be a two step process explode and move then undo and reset arrow head point.