Author Topic: Create Block using other blocks  (Read 2476 times)

0 Members and 1 Guest are viewing this topic.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Create Block using other blocks
« on: November 21, 2008, 10:46:53 AM »
Does anybody know how to create a block definition by using existing blocks?  What I want to do is insert a block, explode if necessary, and add it to a newly created block def.  Then insert a different block and add it to the new def, until I have a complete assembly of parts that I use to create the overall block.  I have gone through the .ADDDXXX methods, and there are not any for blocks, but there is 1 for MInsertBlock, which I think I could use, but wanted to ask before I go down that path
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: Create Block using other blocks
« Reply #1 on: November 21, 2008, 11:49:58 AM »
Got it, nevermind.  Turns out to be super easy.
Code: [Select]
      Dim ObjectBlock As AcadBlock
      Set ObjectBlock = ThisDrawing.Blocks.Add(InsPt, "1phBS")
      ObjectBlock.InsertBlock InsPt, "TheBlockIWantedToInsert.dwg", 1, 1, 1, dblRotation
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)

Bryco

  • Water Moccasin
  • Posts: 1883
Re: Create Block using other blocks
« Reply #2 on: November 21, 2008, 05:24:03 PM »
Oh shiney, never noticed that one.

David Hall

  • Automatic Duh Generator
  • King Gator
  • Posts: 4076
Re: Create Block using other blocks
« Reply #3 on: November 24, 2008, 09:43:29 AM »
I hadn't ever tought to use something like this either, but leave it to my Non-cad literate boss to ask for something that a regular block just wouldn't do.  The labs from C# made me think of this.
Everyone has a photographic memory, Some just don't have film.
They say money can't buy happiness, but it can buy Bacon and that's a close second.
Sometimes the question is more important than the answer. (Thanks Kerry for reminding me)