Author Topic: Array  (Read 4887 times)

0 Members and 1 Guest are viewing this topic.

rude dog

  • Guest
Array
« 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....

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Array
« Reply #1 on: July 30, 2004, 05:24:34 PM »
need more info, maybe some of the code you're using.
TheSwamp.org  (serving the CAD community since 2003)

rude dog

  • Guest
Array
« Reply #2 on: July 30, 2004, 05:36:40 PM »
got it
ssget "x" with a few filters
thx

Mark

  • Custom Title
  • Seagull
  • Posts: 28753
Array
« Reply #3 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
TheSwamp.org  (serving the CAD community since 2003)

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Array
« Reply #4 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
    )
  )
)
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.

CAB

  • Global Moderator
  • Seagull
  • Posts: 10401
Array
« Reply #5 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
  )
)
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.

rude dog

  • Guest
Array
« Reply #6 on: July 31, 2004, 05:01:21 PM »
got it all wrkn'
thanks