Author Topic: Trim Fence  (Read 2129 times)

0 Members and 1 Guest are viewing this topic.

Biscuits

  • Swamp Rat
  • Posts: 502
Trim Fence
« on: March 02, 2007, 10:09:25 AM »
Anyone got any ideas how to change this mini-routine so that the fence line is not limited to a specific number of pics?
I've been able to do this but only if I remove the "(COMMAND "OSMODE" "47")"


Thanks

Quote
(defun c:TRIMFNC ()

(COMMAND "OSMODE" "0")
(COMMAND "trim" "" "F" PAUSE PAUSE  "" "")
(COMMAND "OSMODE" "47")

)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4075
Re: Trim Fence
« Reply #1 on: March 02, 2007, 10:43:01 AM »
Off the top of my head, I would say you need to collect points til nil, then feed the trim command points
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Kerry

  • Mesozoic relic
  • Seagull
  • Posts: 11654
  • class keyThumper<T>:ILazy<T>
Re: Trim Fence
« Reply #2 on: March 02, 2007, 10:58:37 AM »
Try

Code: [Select]
(COMMAND "trim" "" "F")
(WHILE (/= (GETVAR "cmdactive") 0) (COMMAND PAUSE))
kdub, kdub_nz in other timelines.
Perfection is not optional.
Everything will work just as you expect it to, unless your expectations are incorrect.
Discipline: None at all.

Biscuits

  • Swamp Rat
  • Posts: 502
Re: Trim Fence
« Reply #3 on: March 02, 2007, 11:43:38 AM »
Thanks Kerry, worked perfect!

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Re: Trim Fence
« Reply #4 on: March 02, 2007, 01:52:13 PM »
Here is one I use a lot. It allows multiple trim objects with a 2 point fence.
Code: [Select]
(defun c:tmm (/ ss pt1 pt2 usercmd *error*)
  ;vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
  ;; error function & Routine Exit
  (defun *error* (msg)
    (if
      (not
        (member
          msg
          '("console break" "Function cancelled" "quit / exit abort" "")
        )
      )
       (princ (strcat "\nError: " msg))
    )

    ;;reset all variables here
    (setvar "osmode" useros)
    (setvar "CMDECHO" usercmd)
  ) ; end error function
  ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

  (setq usercmd (getvar "cmdecho"))
  (setvar "cmdecho" 0)
  (setq useros (getvar "osmode"))
  (setvar "osmode" 0)
  (while
    (progn
      (prompt "\nSelect cutting edge(s): ")
      (if (setq ss (ssget))
        (progn
          (command "._undo" "begin")
          (if (and (setq pt1 (getpoint "\nDraw line to select items to be trimmed: "))
                   (listp ptl)
                   (setq pt2 (getpoint pt1 "\nPick end point. "))
                   (listp pt2))
            (not (command "_.trim" ss "" "F" pt1 pt2 "" ""))
          )
        )
      )
    )
  )
  (command "._undo" "end")
  (*error* "")
  (princ)
) ; end defun

(princ "\nType TMM to start.")
(princ)
I've reached the age where the happy hour is a nap. (°¿°)
Windows 10 core i7 4790k 4Ghz 32GB GTX 970
Please support this web site.