Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

How can I insert a DWG-File into an existing DWG-file as a block?

Hello,
I am new here and have a question, that makes me cracy.

I am going on to to develope a little tool for inserting Survey-Points into a DWG.
Therefore I built some Symbol-DWGs (this I want use for Insertion) with Attributes. Now I want insert this symbol-dwg into an existing drawing in this way, that it is available as block.
I tried this:

Dim blkObj As AcadBlock = Nothing 'Block for Symbol
blkObj = actDOC.Blocks.Add(insPtBlk, sFileName) 'actDoc is the Activedocument
blkObj.name="Test"

The blockname "Test" appears in the blockdefinitions, but the block itself has NOTHING (no objects or Attributes, that I have defined in the Symbol-DWG).

Thank you for help.

Hans

Answers

  • Use the InsertBlock method. If you don't want to create a block reference just delete it. There is an alternative way (ODBX+CopyObjects) but it is much more involved.

  • Hi Roy,
    thank you very much. It work fine and exactly this way I Need.

    Thanks

This discussion has been closed.
Origami
Origami is the Japanese word for paper folding. ORI means to fold and KAMI means paper and involves the creation of paper forms usually entirely by folding.

Powered by VanillaForums, Designed by Steam