try this....no regens except to set the first layout current, if the
block isn't already defined in the drawing it will insert it, providing
it is found in the current search path.
;| Code to insert a block in all PS Tabs in the same place,
By Jeff Mishler 10/2/03
usage:
(tabs_insert "titlesheet" '(10.0 20.0 0.0)) |;
(defun tabs_insert (bname inspt / )
;(setq inspt '(107.2 46.2 0.0)) ; can hard code insertion point here,
; just remove inspt from first line and don't enter the 2nd arg at
command
(setvar "ctab" (car (layoutlist)));sets current tab to first in list
(foreach x (layoutlist); cycle thru all tabs
(if (not (tblsearch "block" bname)); see if block is defined
(command "_.-insert" bname inspt "0" "" ""); nope, insert it
;else
(progn ;entmake insert to eliminate switching tabs
(entmake (list '(0 . "INSERT")
'(100 . "AcDbEntity")
'(67 . 1); insert in PS
(cons 410 x); tab name
'(8 . "0"); change this to the layer you want
'(100 . "AcDbBlockReference")
'(66 . 0); no attributes follow
(cons 2 bname); block name
(cons 10 inspt); insertion point
'(41 . 1.0) '(42 . 1.0) '(43 . 1.0);scale factors
'(50 . 0.0) ;rotation
'(70 . 0) '(71 . 0) '(44 . 0.0)'(45 . 0.0)
'(210 0.0 0.0 1.0)
);list
);entmake
);progn
);if
);foreach
(princ)
);defun
"smjgsmith" wrote in message
news:f18fbd5.2@WebX.maYIadrTaRb...
> This is what I came up with:-
> (foreach layout (layoutlist)
> (setvar "ctab" layout)
> (command "-insert" "sign-001" "107.2,46.2,0.0" "" "" "")
> );foreach
>
> Is it possible to suppress the regen as you change tabs??
>