The leader not adjusting when the Text is moved could be the case if the Leader is exploded, but also if it isn't, but is just not associated with the piece of Text or Mtext.
But the Leader created by that code is ending up effectively "exploded," because you're using the Leader option inside a Dim1 command, rather than the true Leader command. The former does *not* make a real Leader, at least not for me in ACAD2004 -- it makes a Block [the arrowhead] and Line(s).
In other words, it's not really exploded, but rather was never a true Leader in the first place. That being the case, there wouldn't be any hope of "unexploding" it. Even given a true Leader that has been exploded, I don't see any way it could be unexploded [other than by undoing back past the explosion], any more than an exploded Block's resulting drawing entities could be re-assembled into a Block insertion again. How would a routine figure out where those parts came from, or which entities belong? I suspect you would just need to make it over again, and get rid of the exploded parts.
But there shouldn't be any need. If you want to end up with a one-line-segment Leader, with Text that is associated with it so that the Leader will adjust with the Text, I'm not sure what most of your own Leader command is doing for you. You may as well forget the variables, and the spelling out of the prompts yourself, and just do
(command "leader" pause pause "")
[or maybe a Qleader command tailored to your Qleader settings]. That will leave you at the prompt for text content. The Leader will be a real one, not exploded, and it will adjust when the Text is moved. Depending on what "the rest of the program" does, it might be necessary to adjust that further, for example if you want to restrict the User to one line of Text.
You could also leave the user all the options that Leader offers, by doing this:
(command "leader")
(while (> (getvar 'cmdactive) 0)
(command pause)
)
[or likewise with Qleader], which will just start up a Leader [or Qleader] command and then wait for user input until it's completed, before going on to the rest of the routine.
[And by the way, the ^C^C^C in there is not valid Lisp code -- it's macro language. It "works" to end the Dim1 Leader sub-command simply because Lisp doesn't have any idea what to do with it; you could use MarilynMonroe instead, with exactly the same result.]
--
Kent Cooper
rfrod wrote:...
.... I have m own leader command as well. What i do is this:
(SETQ PT1 (GETPOINT "Leader start: "))(TERPRI)
(SETQ PT2 (GETPOINT PT1 "Next point: "))(TERPRI)
(COMMAND "DIM1" "LEADER" PT1 PT2 ^C^C^C)
then the rest of the program. The problem is that if I move the test with the stretch command, my leader does not adjust to the
move since it is exploded. That is why i ned to somehow unexplode it. "Qleader" doesn't work either.
Kent Cooper, AIA