.NET

.NET

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

Extracting BOM from AutoCAD using C#

1185 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

Distinguished Mentor
gasty1001
Posts: 582
Registered: ‎04-11-2010
Message 2 of 14 (1,169 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,134 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,133 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,450
Registered: ‎04-09-2008
Message 5 of 14 (1,122 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,118 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,450
Registered: ‎04-09-2008
Message 7 of 14 (1,105 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 (1,099 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,450
Registered: ‎04-09-2008
Message 9 of 14 (1,094 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 (1,081 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
Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Do you have 60 seconds to spare? The Autodesk Community Team is revamping our site ranking system and we want your feedback! Please click here to launch the 5 question survey. As always your input is greatly appreciated.