TheSwamp

Code Red => AutoLISP (Vanilla / Visual) => Topic started by: rude dog on July 30, 2004, 05:10:17 PM

Title: Array
Post by: rude dog on July 30, 2004, 05:10:17 PM
Any one know a way to setq  objects that have just been arrayed polar or rectangular doesnt matter....
Title: Array
Post by: Mark on July 30, 2004, 05:24:34 PM
need more info, maybe some of the code you're using.
Title: Array
Post by: rude dog on July 30, 2004, 05:36:40 PM
got it
ssget "x" with a few filters
thx
Title: Array
Post by: Mark on July 30, 2004, 05:40:31 PM
so in other words you want to setq _each_ object in the sset?

something like;
(setq ss (ssget))
for each item in ss setq var entity
Title: Array
Post by: CAB on July 30, 2004, 05:40:36 PM
Code: [Select]
; Rune Wold and Michael Puckett - modified
; e.g. usage (setq marker (ALE_LASTENT))
(defun ALE_LastEnt ( / EntNam OutVal)
  (and
    (setq OutVal (entlast))
    (while (setq EntNam (entnext OutVal))
      (setq OutVal EntNam)
    )
  )
  OutVal
)
;
; E.g. to include also the reference entity:
; (command "MOVE" (ALE_SS-AFTER marker) marker "" ...)
;
(defun ALE_Ss-After (EntNam / EntNxt SelSet)
  (cond
    ( (not EntNam) (ssget "_X") )
    ( (setq EntNxt (entnext EntNam))
      (setq SelSet (ssadd EntNxt))
      (while (setq EntNxt (entnext EntNxt))
        (if (entget EntNxt) (ssadd EntNxt SelSet))
      )
      SelSet
    )
  )
)
Title: Array
Post by: CAB on July 31, 2004, 12:03:28 PM
This is how to impliment the routines above.
Code: [Select]
(defun c:test()
  ;; save the last entity in the dbf
  (setq last_e (ALE_LastEnt)
  (command "array" )
  (while (>(getvar "CMDACTIVE")0) (command pause) )
  (if (not(eq last_e (entlast)))
    (progn
       ;;  get new items
      (setq new_ss (ALE_Ss-After last_e))
      ;; do your thing
    ); progn
  )
)
Title: Array
Post by: rude dog on July 31, 2004, 05:01:21 PM
got it all wrkn'
thanks