> (defun c:replace ()
> (command ".rename" "block" "column_1" "column")
------- rename the first block to a name you want tmo keep.
> (setq ss (ssget "x" '((2 . "column_*"))))
------ build a selection set of All blocks with (assoc 2 = Name) Named
(using wildcards) Column_**something*
> (setq cnt 0)
------- start a counter at zero -- remember the first element in a list is
member zero
> (repeat (sslength ss)
------- start a loop to repeat a series for the entire selection set [sset]
(based on the length of SSet)
> (setq ename (ssname ss cnt))
------- get teh entity name of the next member of the sset (starting with
member zero)
> (setq pt (cdr (assoc 10 (entget ename))))
------- get the insertion point for that member
> (command ".insert" "column" pt "" "" "")
------- insert a block (with the new name) at that point - use default
scale and rotation
> (entdel ename)
------- remove (erase) the member of the Selection set just processed
> (setq cnt (1+ cnt))
------- increment the counter to process the next member of sset
> (princ (strcat "\r" (itoa cnt) " of " (itoa (sslength ss)) " "))
------- report what was processed at the Command: line
> )
------- close the loop - return until finished
------- else: continue
> (command ".purge" "b" "column_*" "n")
------- purge all blocks with undesired names (they're already erased, and
these are unreferenced definitions)
> (princ)
------- exit without further report [except on error]
> )
>
> It didn't replace each column's position though. Anyway, thanks again,
Jim.
>
> Morten
>
> "Peter Friedrich" <pfrie...@Monsen.com> wrote in message
> news:6E0B17C886AEA179...@in.WebX.maYIadrTaRb...
> > I'd follow Jims thread here--
> > Purge will only work on UNreferenced blocks - you have the equivalent of
1
> > block with numerous names all referenced once.
> > A Block definition ON the hard drive is required...
> > A programmatic approach would do this Fast!
> > You need to export a column (as currently defined) to the drive... Say
> > Column1
> > (I'd add attributes if you need to identify it specifically by location
> > later)
> > Now inside Autocad- the commands would be
> > ... next line Requires the hyphen to avoid a dialog box
> >
> > -Insert
> > OldColumnName0001=Column1
> > Control+C
> >
> > repeat for columns 0002... 9999
> >
> > As you can see - programmatically renaming the target column (0001 ...
> > 9999) is easier than typing each one in.
> >
> >
> >
> > "Jim Claypool" <jcla...@kc.rr.com> wrote in message
> > news:0DC5DEF0FB19A948...@in.WebX.maYIadrTaRb...
> > > You can automate the process. How are the blocks named?
> > > Are they all something like BLOCK1, BLOCK2, BLOCK3 etc.?
> > >
> > >
> >
> >
>
>