Author Topic: remember last type number for a comand  (Read 1971 times)

0 Members and 1 Guest are viewing this topic.

serge_c

  • Newt
  • Posts: 39
remember last type number for a comand
« on: March 13, 2015, 03:11:36 AM »
It will be very usefull for a lot of engineersand not only to make a lisp wich will remember the last type number for a comand ...
For example should work like for comand offset , you enter first time the number , and than the program remember it and next time when you do again comand offset just with clicking duble space it remember automaticaly..
So what is the idea : same thing for comand copy , move and strench ...
But I think it gonna be better if each comand it will have their own remember number ..
I think this it will gain o lot of time ...
Phanks in advance !!!

lamarn

  • Swamp Rat
  • Posts: 636
Re: remember last type number for a comand
« Reply #1 on: March 13, 2015, 04:25:26 AM »
Great idea! ( i have not got an answer..)
Design is something you should do with both hands. My 2d hand , my 3d hand ..

serge_c

  • Newt
  • Posts: 39
Re: remember last type number for a comand
« Reply #2 on: March 13, 2015, 01:07:49 PM »
some of my friends told me that in some of olds versions I dont know it wich precise, it remember automaticaly ,when you type the comand, typing Up arrow , and it appear last type number
It should work like this :
If I MOVE COPY and STRENCH something by 100 units, then use the MOVE COPY or STRENCH command again, the default value will show as <100> so you don't need to type it again.

ChrisCarlson

  • Guest
Re: remember last type number for a comand
« Reply #3 on: March 13, 2015, 01:23:38 PM »
Offset has this built in with the variable "filletrad" but in relation to move, copy, stretch I don't see the point and actually see it as a hindrance. If you are constantly moving something 100 units, why not just insert or draw it correctly?

If you are copying 100 units, utilize arrayrect

serge_c

  • Newt
  • Posts: 39
Re: remember last type number for a comand
« Reply #4 on: March 14, 2015, 02:50:47 AM »
I said 100 for example , I need this more for Strench comand, but move and copy comand just eventualy , sometime I need it too .

ribarm

  • Gator
  • Posts: 3296
  • Marko Ribar, architect
Re: remember last type number for a comand
« Reply #5 on: March 14, 2015, 06:27:01 AM »
Offset has this built in with the variable "filletrad" ...

For offset, I would say the variable is called "offsetdist" and my suggestion doesn't support offset... Maybe you can try searching www.lee-mac.com ; I think he wrote something like Dynamic Offset, or Double offset... Anyway you can write your own version if you really want it... For MOVE, COPY in 3D & ROTATE in 2D, I strongly suggest that you use my version of MOCORO (move+copy+rotate) posted here :
http://www.theswamp.org/index.php?topic=40547.msg481693#msg481693

It's very useful and it's written just for this task - copying, moving multiple times the same entity/entities... Now when I write this, maybe it's not exactly what you're searching "probably you want to do the same operation performed in more tasks / different entity/ies but with the same vector of translation"... So you need to write simply lisp, something like this :

Code: [Select]
(defun c:mcs-vec ( / cmde vc p0 p1 cc ss bp ep ec )
  (setq cmde (getvar 'cmdecho))
  (setvar 'cmdecho 0)
  (terpri)
  (prompt "\nMOVE, COPY, STRETCH with the same vector of translation")
  (terpri)
  (if v
    (progn
      (initget "Yes No")
      (setq vc (getkword (strcat "\nUse already stored vector in memory ( " (rtos (car v) 2 8) " , " (rtos (cadr v) 2 8) " , " (rtos (caddr v) 2 8) " ) [Yes/No] <Yes - ENTER> : ")))
      (if (eq vc "No")
        (progn
          (setq p0 (getpoint "\nPick or specify start point of vector : "))
          (setq p1 (getpoint p0 "\nPick or specify end point of vector : "))
          (setq v (mapcar '- p1 p0))
        )
      )
    )
    (progn
      (setq p0 (getpoint "\nPick or specify start point of vector : "))
      (setq p1 (getpoint p0 "\nPick or specify end point of vector : "))
      (setq v (mapcar '- p1 p0))
    )
  )
  (initget 1 "Copy Move Stretch")
  (setq cc (getkword "\nSpecify command type [Copy/Move/Stretch] : "))
  (prompt "\nSelect objects for specified command : ") (princ cc)
  (setq ss (ssget "_:L"))
  (while (not ss)
    (prompt "\nEmpty sel.set... Select objects for specified command : ") (princ cc) (prompt " again...")
    (setq ss (ssget "_:L"))
  )
  (setq bp '(0.0 0.0 0.0))
  (setq ep v)
  (cond
    ( (eq cc "Copy")
      (command "_.COPY" ss "" "_non" bp "_non" ep)
      (while (> (getvar 'cmdactive) 0) (command ""))
    )
    ( (eq cc "Move")
      (command "_.MOVE" ss "" "_non" bp "_non" ep)
      (while (> (getvar 'cmdactive) 0) (command ""))
    )
    ( (eq cc "Stretch")
      (command "_.STRETCH" ss "" "_non" bp "_non" ep)
      (while (> (getvar 'cmdactive) 0) (command ""))
    )
  )
  (initget "Yes No")
  (setq ec (getkword "\nErase stored vector from memory [Yes/No] <No> : "))
  (if (eq ec "Yes")
    (setq v nil)
  )
  (setvar 'cmdecho cmde)
  (princ)
)

Posted code is untested, an quickly written so if it's wrong look for debugging tutorial at www.lee-mac.com
HTH, M.R.
« Last Edit: March 14, 2015, 07:23:38 AM by ribarm »
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: remember last type number for a comand
« Reply #6 on: March 14, 2015, 07:16:39 AM »
@ ribarm: Why prompt for a base point? I think you can use '(0.0 0.0 0.0) instead.

ribarm

  • Gator
  • Posts: 3296
  • Marko Ribar, architect
Re: remember last type number for a comand
« Reply #7 on: March 14, 2015, 07:24:27 AM »
@ ribarm: Why prompt for a base point? I think you can use '(0.0 0.0 0.0) instead.

You're right Roy, code updated above...
Marko Ribar, d.i.a. (graduated engineer of architecture)

:)

M.R. on Youtube

lamarn

  • Swamp Rat
  • Posts: 636
Re: remember last type number for a comand
« Reply #8 on: March 14, 2015, 09:01:41 AM »
Indeed, ealier version of autocad had This. You could toggle to previous commands using the arrow. It was a Great functions. Why and when This was lost i do not know. AutoDesk just destroyed it during one of the updates..
Design is something you should do with both hands. My 2d hand , my 3d hand ..