Message 1 of 9
BLOCK INSERTION
Not applicable
11-16-2007
12:15 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi everyone.
What I am trying to accomplish is very simple. I want to open up a drawing (filename), insert another autocad drawing (block) into it. Then save and close the drawing using the COM interface.
This is what I have so far: (C#.NET)
gbl_app.Documents.Open(filename, 0, 0); //open the specified file in AutoCAD instance
AcadDocument doc = gbl_app.ActiveDocument; //set to the active document
AcadBlocks blkcoll = doc.Blocks; //get the block collection of the active document -- used later
//blkcoll.Add(object InsertionPoint, string dwg_file_to_add); // ???????
From here I would like to know the next few steps. I initially thought that you could easily add a block to the block collection and see it in modelspace, but looking at what others have been doing -- that sounds too easy. Is there a way to insert a DWG file into the currently active document seamlessly via COM? Thanks!
What I am trying to accomplish is very simple. I want to open up a drawing (filename), insert another autocad drawing (block) into it. Then save and close the drawing using the COM interface.
This is what I have so far: (C#.NET)
gbl_app.Documents.Open(filename, 0, 0); //open the specified file in AutoCAD instance
AcadDocument doc = gbl_app.ActiveDocument; //set to the active document
AcadBlocks blkcoll = doc.Blocks; //get the block collection of the active document -- used later
//blkcoll.Add(object InsertionPoint, string dwg_file_to_add); // ???????
From here I would like to know the next few steps. I initially thought that you could easily add a block to the block collection and see it in modelspace, but looking at what others have been doing -- that sounds too easy. Is there a way to insert a DWG file into the currently active document seamlessly via COM? Thanks!