.NET

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

Extracting BOM from AutoCAD using C#

1081 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
gasty1001
Posts: 482
Registered: ‎04-11-2010
Message 2 of 14 (1,065 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,569
Registered: ‎10-08-2008
Message 3 of 14 (1,030 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
Arindam_Basu
Posts: 7
Registered: ‎03-28-2013
Message 4 of 14 (1,029 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,417
Registered: ‎04-09-2008
Message 5 of 14 (1,018 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
Arindam_Basu
Posts: 7
Registered: ‎03-28-2013
Message 6 of 14 (1,014 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,417
Registered: ‎04-09-2008
Message 7 of 14 (1,001 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
Arindam_Basu
Posts: 7
Registered: ‎03-28-2013
Message 8 of 14 (995 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,417
Registered: ‎04-09-2008
Message 9 of 14 (990 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,569
Registered: ‎10-08-2008
Message 10 of 14 (977 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
Announcements
Autodesk Alert | We are currently working on restoring Previous Version License request access in the Autodesk Subscription Center. If you are a subscription customer and would like to request a Previous Version License, please use this link as a temporary workaround. We apologize for the inconvenience and thank you for your patience.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.