Author Topic: regen fast?  (Read 3182 times)

0 Members and 1 Guest are viewing this topic.

Fuccaro

  • Guest
regen fast?
« 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.

Code: [Select]
(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!

hendie

  • Guest
regen fast?
« Reply #1 on: December 03, 2003, 07:53:21 AM »
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 ?

Mark

  • Custom Title
  • Seagull
  • Posts: 28685
regen fast?
« Reply #2 on: December 03, 2003, 09:28:18 AM »
have you tried using REDRAW?
Code: [Select]
(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
TheSwamp.org  (serving the CAD community since 2003)

Mark

  • Custom Title
  • Seagull
  • Posts: 28685
regen fast?
« Reply #3 on: December 03, 2003, 09:32:34 AM »
Take a look at this, maybe it will give you some ideas.
Code: [Select]
; 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
TheSwamp.org  (serving the CAD community since 2003)

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16721
  • Superior Stupidity at its best
regen fast?
« Reply #4 on: December 03, 2003, 09:53:32 AM »
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.
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

Fuccaro

  • Guest
regen fast?
« Reply #5 on: December 03, 2003, 10:04:26 AM »
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?

hendie

  • Guest
regen fast?
« Reply #6 on: December 03, 2003, 10:11:00 AM »
if it's for a surprise, do you need to show ALL the mtext ? can you substitute anything in it's place  ?

Keith™

  • Villiage Idiot
  • Seagull
  • Posts: 16721
  • Superior Stupidity at its best
regen fast?
« Reply #7 on: December 03, 2003, 10:42:07 AM »
Quote from: hendie
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 ?
Proud provider of opinion and arrogance since November 22, 2003 at 09:35:31 am
CadJockey Militia Field Marshal

hendie

  • Guest
regen fast?
« Reply #8 on: December 04, 2003, 05:02:10 AM »
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.

Fuccaro

  • Guest
regen fast?
« Reply #9 on: December 04, 2003, 06:06:21 AM »
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!

hendie

  • Guest
regen fast?
« Reply #10 on: December 04, 2003, 06:19:26 AM »
glad it worked fuccaro !