Author Topic: copy and mirdo  (Read 2945 times)

0 Members and 1 Guest are viewing this topic.

ELOQUINTET

  • Guest
copy and mirdo
« on: August 31, 2004, 01:23:18 PM »
hey guys i'm trying to combine the two lisps mirdo and copy mirror together but can't seem to get it to delete objects. can somebody steer me in the right direction

Code: [Select]
;;; CMD.lsp
;;; To Copy and mirror selected entities
;;;
;;; by Terrance Kesteloot and Rod Potter
;;; credit to Steve Smith Compuserve I.D.:72611,2544

(DEFUN ssmake (sslist)
  (SETQ theset (SSADD))
  (FOREACH ent sslist (SSADD (HANDENT ent) theset))
)

(DEFUN C:CMD ()
  (SETQ cecho (GETVAR "CMDECHO"))

  ;;turn off command line echo
  (SETVAR "CMDECHO" 0)
  (SETQ theset nil
thelist nil
  )

  ;;obtain last entity in database
  (SETQ startent (ENTLAST))

  (PROMPT "Entity(s) copy and mirror routine")
  (PROMPT "\nCopying...")

  ;;create selection set
  (SETQ sset (SSGET))

  (SETQ bpt (GETPOINT "\nEnter base point for copy..."))

  (COMMAND "copy" sset "" bpt pause)
  (SETQ npt (GETVAR "LASTPOINT"))

  ;;build selection set list of newly copied entities
  (SETQ thelist (LIST (CDR (ASSOC 5 (ENTGET startent)))))
  (SETQ nextone startent)
  (WHILE nextone
    (PROGN
      (SETQ nextone (ENTNEXT nextone))
      (IF nextone
(SETQ thelist (CONS (CDR (ASSOC 5 (ENTGET nextone))) thelist))
      )
    )
  )
  ;;list of entity handles for copied group
  (SETQ thelist (CDR (REVERSE thelist)))
  (ssmake thelist)

  (PROMPT
    "\nMirroring - select second point of mirror line for new objects..."
  )
  (COMMAND "mirror" theset "" npt pause)
  (COMMAND "orthomode" "1")
  (COMMAND "mirror" a1 "" p1 pause "y")
  (COMMAND "orthomode" "0")
  )

ELOQUINTET

  • Guest
copy and mirdo
« Reply #1 on: August 31, 2004, 01:28:56 PM »
here's the original copy and mirror if it helps, by the way i changed cab's plottabs routine to default to tabs and not plot to file all by myself and i'm sorta proud. see i'm figurin things out little by little

Code: [Select]
;;; CMI.lsp
;;; To Copy and mirror selected entities
;;;
;;; by Terrance Kesteloot and Rod Potter
;;; credit to Steve Smith Compuserve I.D.:72611,2544

(DEFUN ssmake (sslist)
  (SETQ theset (SSADD))
  (FOREACH ent sslist (SSADD (HANDENT ent) theset))
)

(DEFUN C:CMI ()
  (SETQ cecho (GETVAR "CMDECHO"))

  ;;turn off command line echo
  (SETVAR "CMDECHO" 0)
  (SETQ theset nil
thelist nil
  )

  ;;obtain last entity in database
  (SETQ startent (ENTLAST))

  (PROMPT "Entity(s) copy and mirror routine")
  (PROMPT "\nCopying...")

  ;;create selection set
  (SETQ sset (SSGET))

  (SETQ bpt (GETPOINT "\nEnter base point for copy..."))

  (COMMAND "copy" sset "" bpt pause)
  (SETQ npt (GETVAR "LASTPOINT"))

  ;;build selection set list of newly copied entities
  (SETQ thelist (LIST (CDR (ASSOC 5 (ENTGET startent)))))
  (SETQ nextone startent)
  (WHILE nextone
    (PROGN
      (SETQ nextone (ENTNEXT nextone))
      (IF nextone
(SETQ thelist (CONS (CDR (ASSOC 5 (ENTGET nextone))) thelist))
      )
    )
  )
  ;;list of entity handles for copied group
  (SETQ thelist (CDR (REVERSE thelist)))
  (ssmake thelist)

  (PROMPT
    "\nMirroring - select second point of mirror line for new objects..."
  )
  (COMMAND "mirror" theset "" npt pause)

  ;;turn off highlight
  (SETVAR "highlight" 0)

  ;;reset command line echo to original state
  (SETVAR "CMDECHO" cecho)

  ;;turn highlight back on
  (SETVAR "HIGHLIGHT" 1)

  ;;clean finish
  (PRINC)
)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
copy and mirdo
« Reply #2 on: August 31, 2004, 01:57:46 PM »
Quote from: eloquintet
by the way i changed cab's plottabs routine to default to tabs and not plot to file all by myself and i'm sorta proud. see i'm figurin things out little by little


Good for you, Dan :D
CAB
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.

daron

  • Guest
copy and mirdo
« Reply #3 on: September 01, 2004, 08:22:49 AM »
Quote from: eloquintet
...by the way i changed cab's plottabs routine to default to tabs and not plot to file all by myself and i'm sorta proud.


And that is one reason we push you so hard to try to start figuring this stuff out. It's the coolest feeling to be able to lay out a program in cad and say: "I made it do that!"

Oh, and as far as combining your routines? They're a little lengthy and it would take a lot of time I don't have. My best suggestion would be to figure out what things are happening that are the same, i.e. selection sets. If you have a selectionset for both commands and both commands have the same selectionset, you should be able to use the same variable that stores them to make both commands work.