.NET

Reply
Active Member
Posts: 7
Registered: ‎03-28-2013
Message 1 of 14 (808 Views)
Accepted Solution

Extracting BOM from AutoCAD using C#

808 Views, 13 Replies
04-17-2013 05:09 AM

Hello All,

I am doing a customization project in AutoCAD 2012 using C#.net.

My objective is to extract BOM table from an AutoCAD drawing using c# programming.
I am trying to create a custom menu in AutoCAD which will have the export BOM functionality.

Since I am new to C# programming I am finding it difficult to form the code.
Any sort of help is appreciated.

 

Thanks in advance.

Regards
Arindam Basu

Valued Mentor
Posts: 379
Registered: ‎04-11-2010
Message 2 of 14 (792 Views)

Re: Extracting BOM from AutoCAD using C#

04-17-2013 06:40 AM in reply to: Arindam_Basu

Hi,

 

What about dataextraction command?, it can be automated , see this link: Dataextraction , also it's easy to read from a table and write its data to excel, see this link:Export Table , and Dataextraction API .

 

Gaston Nunez

 

 

*Expert Elite*
Hallex
Posts: 1,558
Registered: ‎10-08-2008
Message 3 of 14 (757 Views)

Re: Extracting BOM from AutoCAD using C#

04-17-2013 09:35 PM in reply to: Arindam_Basu
Can you upload small picture to see the result
of this program?
_____________________________________
C6309D9E0751D165D0934D0621DFF27919
Active Member
Posts: 7
Registered: ‎03-28-2013
Message 4 of 14 (756 Views)

Re: Extracting BOM from AutoCAD using C#

04-17-2013 09:35 PM in reply to: gasty1001

Hi Gaston

 

The data extraction tool does not export my BOM table.

I am attaching a sample drawing with a BOM table on it.

The task that export function does when right clicking on any table, i have to do that with the help of C# code.

 

My objective is to create a new custom menu in any toolbar of AutoCAD and link the export functionality to that menu.

 

Thanks

Moderator
Alexander.Rivilis
Posts: 1,346
Registered: ‎04-09-2008
Message 5 of 14 (745 Views)

Re: Extracting BOM from AutoCAD using C#

04-17-2013 10:51 PM in reply to: Arindam_Basu

Maybe _TABLEEXPORT can help you.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Active Member
Posts: 7
Registered: ‎03-28-2013
Message 6 of 14 (741 Views)

Re: Extracting BOM from AutoCAD using C#

04-17-2013 11:00 PM in reply to: Alexander.Rivilis

Exactly the function which _TABLEEXPORT does, i have to do that with the help of a custom menu or by creating a custom action in the quick access toolbar. after creating the action i have to link the _TABLEEXPORT functionality to that custom action.

 

can anybody help me with the code to create such a custom menu or custom action?

 

Regards,

Arindam Basu

Moderator
Alexander.Rivilis
Posts: 1,346
Registered: ‎04-09-2008
Message 7 of 14 (728 Views)

Re: Extracting BOM from AutoCAD using C#

04-18-2013 03:32 AM in reply to: Arindam_Basu

I do not understand why you need to use .NET API if you can manually add the command to the menu (CUI), save as a partial menu and load it when needed.


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

Active Member
Posts: 7
Registered: ‎03-28-2013
Message 8 of 14 (722 Views)

Re: Extracting BOM from AutoCAD using C#

04-18-2013 04:58 AM in reply to: Alexander.Rivilis

Thanks Alexander,

 

I understand what you are telling is also a way to fulfill my objective.

But I was looking for a way other than customizing it through UI.

Anyway,

Can you explain me further the steps to save my new custom menu as a partial menu and load it when needed.

 

I have created a new menu and also loaded it with the _TABLEEXPORT command,

but each time I am opening AutoCAD it is showing the menu.

 

If it is possible to change it to a partial menu and load it as and when required please suggest the way for it.

 

Regards,

Arindam

Moderator
Alexander.Rivilis
Posts: 1,346
Registered: ‎04-09-2008
Message 9 of 14 (717 Views)

Re: Extracting BOM from AutoCAD using C#

04-18-2013 05:31 AM in reply to: Arindam_Basu

You can do it many ways.

For example: http://through-the-interface.typepad.com/through_the_interface/2010/04/adding-to-autocads-applicatio...


Пожалуйста не забывайте про Утвердить в качестве решения! Утвердить в качестве решения и Give Kudos!Баллы
Please remember to Accept Solution! Accept as Solution and Give Kudos!Kudos

*Expert Elite*
Hallex
Posts: 1,558
Registered: ‎10-08-2008
Message 10 of 14 (704 Views)

Re: Extracting BOM from AutoCAD using C#

04-18-2013 08:58 AM in reply to: Arindam_Basu
Please check this code
http://www.acadnetwork.com/topic-198.0.html
_____________________________________
C6309D9E0751D165D0934D0621DFF27919

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