.NET

.NET

Reply
Active Member
7 Posts
0 Kudos
Registered: ‎03-28-2013
Post 1 of 14
Accepted Solution

Extracting BOM from AutoCAD using C#

1235 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
582 Posts
91 Kudos
Registered: ‎04-11-2010
Post 2 of 14

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*
1,569 Posts
171 Kudos
Registered: ‎10-08-2008
Post 3 of 14

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
7 Posts
0 Kudos
Registered: ‎03-28-2013
Post 4 of 14

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
1,467 Posts
277 Kudos
Registered: ‎04-09-2008
Post 5 of 14

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
7 Posts
0 Kudos
Registered: ‎03-28-2013
Post 6 of 14

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
1,467 Posts
277 Kudos
Registered: ‎04-09-2008
Post 7 of 14

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
7 Posts
0 Kudos
Registered: ‎03-28-2013
Post 8 of 14

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
1,467 Posts
277 Kudos
Registered: ‎04-09-2008
Post 9 of 14

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*
1,569 Posts
171 Kudos
Registered: ‎10-08-2008
Post 10 of 14

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
Are you interested in helping shape the future of the Autodesk Community? To participate in this brief usability study, please click here. Your time and input is greatly appreciated!