Author Topic: Place Block inside mulitple Blocks?  (Read 2084 times)

0 Members and 1 Guest are viewing this topic.

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Place Block inside mulitple Blocks?
« on: May 19, 2015, 04:14:33 PM »
Is it possible to have a routine that can take a Block (Block 1) and place (Block 1 @0,0) inside a selection of blocks that are not shown in the drawing but the definition is at the same insertion point? I have one block that I need to place into 40 + Blocks. The Scales of the blocks are 1:1, its just getting them in there. I figured I would ask before starting it. Thanks guys!
Civil3D 2020

danallen

  • Guest
Re: Place Block inside mulitple Blocks?
« Reply #1 on: May 19, 2015, 04:32:19 PM »
Why not redefine the block that is inserted 40+ times (call it block 0)? Or do you have say 80 inserts of block 0 and need to add block 1 at only 40 of them?

If the latter, copy the 40, paste into blank drawing. Rename block definition from block 0 to block 1, copy/paste back into original drawing using same origin. Voila!

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Place Block inside mulitple Blocks?
« Reply #2 on: May 19, 2015, 04:34:18 PM »
I have a bunch of casting circle blocks. I am trying get an inlet protection block in all of those casting blocks. Does that make any sense?
Civil3D 2020

danallen

  • Guest
Re: Place Block inside mulitple Blocks?
« Reply #3 on: May 19, 2015, 04:38:43 PM »
Sounds like civil stuff, I'm an architect, so not much. But doesn't change my suggestions

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Place Block inside mulitple Blocks?
« Reply #4 on: May 20, 2015, 04:13:52 AM »
Perhaps something like this:
Code - Auto/Visual Lisp: [Select]
  1. (setvar 'clayer "0")
  2. (foreach blockDefName blockDefNameList
  3.   (if (tblobjname "block" blockDefName) ; Add check for xref if required.
  4.       (vla-item blocksObject blockDefName)
  5.       'insertblock
  6.       '(0.0 0.0 0.0)
  7.       blockName
  8.       1.0 ; X-scale.
  9.       1.0 ; Y-scale.
  10.       1.0 ; Z-scale.
  11.       0.0 ; Angle.
  12.     )
  13.   )
  14. )
« Last Edit: May 20, 2015, 04:20:47 AM by roy_043 »

MSTG007

  • Gator
  • Posts: 2598
  • I can't remeber what I already asked! I need help!
Re: Place Block inside mulitple Blocks?
« Reply #5 on: May 20, 2015, 07:30:37 AM »
Thank you for sharing this, Could I ask how to execute the command please?
Civil3D 2020

roy_043

  • Water Moccasin
  • Posts: 1895
  • BricsCAD 18
Re: Place Block inside mulitple Blocks?
« Reply #6 on: May 20, 2015, 08:35:39 AM »
Thank you for sharing this, Could I ask how to execute the command please?
The supplied code is not a complete (command) function. You will have incorporate the code snippet is your own function.

dgorsman

  • Water Moccasin
  • Posts: 2437
Re: Place Block inside mulitple Blocks?
« Reply #7 on: May 20, 2015, 10:18:45 AM »
Bascially, yes - it is possible.  You manipulate the block definition (add the second block as an insert) rather than model or paper space.
If you are going to fly by the seat of your pants, expect friction burns.

try {GreatPower;}
   catch (notResponsible)
      {NextTime(PlanAhead);}
   finally
      {MasterBasics;}