Insert blocks at multiple different points

Insert blocks at multiple different points

LodeWuyts
Participant Participant
7,396 Views
9 Replies
Message 1 of 10

Insert blocks at multiple different points

LodeWuyts
Participant
Participant

Hello,

 

Is there a way to insert a block at multiple points in a drawing?

I work for a precast manufacturer, and to provide safety slings to our hoisting hooks we now have to manually add a block for our slings to every hook in our drawing.

Is there a similar function to BLOCKREP that adds a block instead of swapping to the selected block's insertion point? Or should I start digging into VB.net or lisp for that?

 

I've added the blocks in question to this post, but it should work with any other 2 different blocks I suppose.

 

Thanks!

 

Lode

 

0 Likes
Accepted solutions (1)
7,397 Views
9 Replies
Replies (9)
Message 2 of 10

pendean
Community Legend
Community Legend
DIVIDE and MEASURE do what you want I believe: explore them in HELP.

0 Likes
Message 3 of 10

LodeWuyts
Participant
Participant

Thanks for the quick reply.

The problem is our hoisting hooks are scattered troughout our drawing. We have several walls in & drawing, and they are not equally spaced apart or on the same line. 

I've added an exemplary drawing for reference, with slings added to the hooks.

0 Likes
Message 4 of 10

Kent1Cooper
Consultant
Consultant

@LodeWuyts wrote:

.... to provide safety slings to our hoisting hooks we now have to manually add a block for our slings to every hook in our drawing....


 

If it's really every  one, just Edit the definition of the hook Block, adding the sling Block to become a part of it.  All of them will then contain the sling.

Kent Cooper, AIA
Message 5 of 10

TheCADnoob
Mentor
Mentor

select the two block you need then create a new block called combined. 

create another temp dummy [like a circle] block just to hold the spot. (This is to avoid circular reference)

 

Use the blockreplace command to insert the temp block. Next replace the temp block using block replace and insert the combined block. 

 

Next use qselect or select similar to select the all combined blocks then explode them. After exploding you will have both blocks in that place. 

CADnoob

EESignature

0 Likes
Message 6 of 10

ChicagoLooper
Mentor
Mentor

Do all blocks have to be replaced? If yes, use REPLACEBLOCK command. Go to Express Tools=>Blocks panel=>Replace Block icon. The only requirement is to have the new block already defined in your dwg. It has to show up in the Insert Block dialog. Then you're all good. (If you only need to replace a percentage of the blocks, you'll need to get creative because this command will replace all of them.)

1-Your new block, the one that will replace the old block, must be available in this dropdown. If it isn't, you can insert it in an empty, out of the way area. Once it's inserted, it will appear in the dropdown list.1-Your new block, the one that will replace the old block, must be available in this dropdown. If it isn't, you can insert it in an empty, out of the way area. Once it's inserted, it will appear in the dropdown list.2-Espress Tools=>Blocks panel=>Replace Block icon.2-Espress Tools=>Blocks panel=>Replace Block icon.3-Select your old block by highlighting from list or use the 'pick' button.3-Select your old block by highlighting from list or use the 'pick' button.4-For the new block that's replacing the old, select from list list or use the pick button. Then click OK.4-For the new block that's replacing the old, select from list list or use the pick button. Then click OK.

 

Your old block will be replaced by the new one.

Chicagolooper

EESignature

Message 7 of 10

Alfred.NESWADBA
Consultant
Consultant
Accepted solution

Hi,

 

>> Is there a similar function to BLOCKREP that adds a block instead of swapping

>> to the selected block's insertion point?

If you don't want to get the existing blocks replaced, but instead to get new blocks inserted at the points of existing block-insertions I would:

  • select all existing blocks in current dwg
  • use command _COPYBASE with 0,0,0 as basepoint
  • create a new drawing
  • use command _PASTECLIP to paste the blocks into the new drawing.
  • in the new drawing run command _BLOCKREP
  • in the new drawing select now all replaced blocks
  • use _COPYBASE and _PASTECLIP to copy these blocks to your original dwg-file

 

HTH, - alfred -

 

------------------------------------------------------------------------------------
Alfred NESWADBA
ISH-Solutions GmbH / Ingenieur Studio HOLLAUS
www.ish-solutions.at ... blog.ish-solutions.at ... LinkedIn ... CDay 2026
------------------------------------------------------------------------------------

(not an Autodesk consultant)
Message 8 of 10

LodeWuyts
Participant
Participant

Unfortunately, this won't work as we run an extension to filter out the walls and make the production files. We need both blocks present in each wall.

0 Likes
Message 9 of 10

LodeWuyts
Participant
Participant

I can use this as workaround for now, while I look into a more permanent LISP or VB.net solution.

Thanks!

0 Likes
Message 10 of 10

Kent1Cooper
Consultant
Consultant

@LodeWuyts wrote:

Unfortunately, this won't work as we run an extension to filter out the walls and make the production files. We need both blocks present in each wall.


 

Try this [minimally tested]:

(defun C:ABTB (/ BlockInPlace BlockToAdd ss n); = Add Block To Block(s)
  (setq
    BlockInPlace (getstring "\nName of Block(s) already in place: ")
    BlockToAdd (getstring "\nName of Block to add at each place: ")
  ); setq
  (if
    (and
      (or
        (tblsearch "block" BlockToAdd); exists in drawing
        (findfile (strcat BlockToAdd ".dwg")); available external drawing
      ); or
      (setq ss (ssget "_X" (list '(0 . "INSERT") (cons 2 BlockInPlace))))
; Block exists and there are insertions of it
); and (repeat (setq n (sslength ss)) (command "_.insert" BlockToAdd "_scale" 1 "_rotate" 0 ; scale option specified for Block definition either uniform-scaled or not "_none" (cdr (assoc 10 (entget (ssname ss (setq n (1- n)))))) ); command ); repeat ); if (princ) ); defun

 

 

It assumes the scale and rotation of the added Blocks -- edit as desired.  If the in-place ones vary in those properties, and you want the added ones to match, that can be done.

 

It doesn't have the usual enhancements [error handling, etc.] yet, but see whether it does what you want.

Kent Cooper, AIA