TheSwamp
Code Red => AutoLISP (Vanilla / Visual) => Topic started by: Fuccaro on December 03, 2003, 06:54:59 AM
-
Hello!
A lot of vlisp things in this forum. I use just autolisp. Do you have a place for me too?
My first post/question in this forum:
I wish to move a large mtext across the screen.
(setq mt (entlast)
ed (entget mt)
poz 10)
(repeat 200
(setq ed (subst (list 10 poz 50) (assoc 10 ed) ed)
poz (+ 3 poz)
)
(entmod ed)
;(command "regen")
(command "delay" 50)
)
without the "regen" command the mtext appears just in the first place and after some time it jumps in the final place. But I need a slow motion!
Probable the limitation is caused by the hardware, the simple objects are moving just fine.
If I do "regen" in the loop, the screen becomes flicker.
I read once on the Net about a way to fix this, but I can not remember the URL. Please help me, I prefe an auto[\b]lisp solution if it is possible. Thanks!
-
hi Fuccaro, glad to see you made it across here !
I tried your lisp and it worked OK for me, but I don't know how much mtext you are trying to move. (is regenauto turned ON ?) are you using TTF's or standard Acad fonts ?
-
have you tried using REDRAW?
(setq mt (entlast)
ed (entget mt)
poz 10)
(repeat 200
(setq ed (subst (list 10 poz 50) (assoc 10 ed) ed)
poz (+ 3 poz)
)
(entmod ed)
(command "redraw")
(command "delay" 50)
)
or a COPY - ERASE method
-
Take a look at this, maybe it will give you some ideas.
; for ACAD version R14
; HOWTO
; open new dwg
; load this file
; type in oneminute
; take a 1 minute break on me!
; Mark S. Thomas
; Sat Apr 12, 2003
(defun c:oneminute (/ hand cntr)
(setvar 'cmdecho 0)
(entmake
(list
'(0 . "CIRCLE")
'(10 5.0 5.0 0.0); center
'(40 . 6.0); radius
)
)
(command "zoom" "e")
(entdel (entlast))
(entmake
(list
'(0 . "LINE")
'(10 5.0 5.0 0.0); start
'(11 5.0 10.0 0.0); end
)
)
(setq hand (entlast)
cntr 1
)
(repeat 60
(command "rotate" hand "" '(5.0 5.0 0.0) -6.0)
(entmake
(list
'(0 . "TEXT")
(cons 10 (cdr (assoc 11 (entget hand))))
'(40 . 0.2)
(cons 1 (strcat "."(itoa cntr)))
)
)
(setq cntr (1+ cntr))
(command "delay" 1000)
); repeat
(command "erase" hand "")
(princ)
); defun
-
Hardware limitations can adversely affect the view of movement of mtext across the screen. In order to get a better view, try turning hartdware acceleration to the maximum setting and turn off font smoothing. It will not give you a great deal more in way of effect, but it will improve it some.
-
I intend to run the routine on somebody else’s computer, so I can not modify the hardware accelerator. I try to make a surprise, so do not expect much details. I will try to change the fonts. Also the delete-redraw worth attention.
Sorry Mark, the Redraw instead of Regen does not work. Thank you for the lisp, I will try it.
Other ideas?
-
if it's for a surprise, do you need to show ALL the mtext ? can you substitute anything in it's place ?
-
if it's for a surprise, do you need to show ALL the mtext ? can you substitute anything in it's place ?
Yeah .... like a "You got mail" wav ?
-
Fuccaro, an alternative might be to alternate with the QTEXT variable.
~ start moving the text, turn QTEXT on so that just a box is seen moving and every few steps switch it back so that the text is seen popping up in different places.
-
The font was the clue!
I imported the mtext from an rtf document. In the mtext editor the font was showed as txt.shx but in fact was like in the document.
Now it works. Thank you for all inputs!
-
glad it worked fuccaro !