.NET

Reply
Contributor
waterharbin
Posts: 14
Registered: ‎07-17-2011
Message 1 of 2 (234 Views)

Insert block form external dwg file and specify the insert point by click mouse

234 Views, 1 Replies
04-02-2013 05:36 AM

Hi.

I write a programe, this programe needs to insert some standard illustrations. I made these standard illustrations into different blocks. And I store these blocks in a dwg file. Everytime I need to insert some illustrations, I just click the mouse on the current drawing, I want the illustration inserted. These means the following points:

(1) Import the blocks to the current drawing, if the blocks have already been imported, then do nothing.

(2) Specify the insert point by clicking the mouse, and I want the block's insert point to coincide with the mouse clicking point.

I have searched this forum and other forums too, I found some codes snippets. I found I am in very bad luck, these snippets are neither incomplete nor just don't work at all. I have spent a few days on this, and still don't have a solution. Someone here help me.

ADN Support Specialist
Balaji_Ram
Posts: 609
Registered: ‎03-21-2011
Message 2 of 2 (170 Views)

Re: Insert block form external dwg file and specify the insert point by click mo

05-02-2013 04:38 AM in reply to: waterharbin

Sorry for the delay.

 

If you havent found it already, here are some blog posts that can help :

 

http://through-the-interface.typepad.com/through_the_interface/2006/08/import_blocks_f.html

 

After the blocks have been imported, create blockreference for any of those blocks. This blog post can help although it also includes attributes which may not be part of all of your block definitions :

http://adndevblog.typepad.com/autocad/2012/06/inserting-a-block-with-attributes-to-modelspace.html

 

If you continue to have an issue with this topic, please let me know.

I will create a sample project and share it with you.



Balaji
Developer Technical Services
Autodesk Developer Network

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Welcome to the new Autodesk Community!
If this is your first visit, click here to get started and make the most of the Community. Let us know what you think of the new experience in the Community Feedback Forum.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community