Autolisp to combine BOM entries with duplicate item numbers

Autolisp to combine BOM entries with duplicate item numbers

Anonymous
Not applicable
1,129 Views
11 Replies
Message 1 of 12

Autolisp to combine BOM entries with duplicate item numbers

Anonymous
Not applicable

Hello,

 

I am new to autolisp and have been trying out several codes to see how the work but haven't been able to get anything to work properly.

 

What I am trying to do is once I generate a report I want a script to run and look for duplicate item numbers. If there are duplicates and the description for them is the same I want the numbers to be combined into 1 entry. 

 

Any help on this is greatly appreciated. 

0 Likes
1,130 Views
11 Replies
Replies (11)
Message 2 of 12

DGRL
Advisor
Advisor

Hi

 

May we ask you what kind of report?

Is it the BOM on Isometric or the BOM on Ortho's? Or is it an report made with report creator?

 

Best regards,

 

If this was of any help please kudo and/or Accept as Solution
Kind Regards
0 Likes
Message 3 of 12

Anonymous
Not applicable

The report is made with the report creator

0 Likes
Message 4 of 12

DGRL
Advisor
Advisor

and what is the output?

PDF?

HTML

MHT ect ect

 

If this was of any help please kudo and/or Accept as Solution
Kind Regards
0 Likes
Message 5 of 12

Anonymous
Not applicable

I have been exporting it to Excel

0 Likes
Message 6 of 12

DGRL
Advisor
Advisor

Hi @Anonymous

With lisp that is not possible as far as I know.

Since it is in XLS format why don't you use an sort function that works with excel.

Maybe excel can do it himself but im not sure about that.
What I do know is that there are better programs to do this job.

If you make an csv file of it ( I doubt if that will work ) then LISP can do some things for you.

 

My knowledge does not go that far sorry bout that.

If I find something that might help I will let you know

 

 

Best regards,

 

 

 

If this was of any help please kudo and/or Accept as Solution
Kind Regards
0 Likes
Message 7 of 12

Anonymous
Not applicable

Would it be possible if it was exported to Access instead?

0 Likes
Message 8 of 12

DGRL
Advisor
Advisor

I really don't know that

Currently I am working on a lisp to read out excel and fill in attributes

Maybe I can make something for you but it can take a while so pls do not wait for it

\

 

If this was of any help please kudo and/or Accept as Solution
Kind Regards
0 Likes
Message 9 of 12

DannyNL
Advisor
Advisor

Then why don't you handle the duplicate rows in Excel?

It would be much easier to get the result you want by manipulating the data in Excel itself instead of writing a complex LISP to read/edit/write an Excel file.

 

Combining duplicate records should be easy with the built-in functions in Excel.

One of the many links with information: https://www.extendoffice.com/documents/excel/1268-excel-combine-duplicate-rows-and-sum.html

0 Likes
Message 10 of 12

DGRL
Advisor
Advisor

Hi @DannyNL 

 

I already advised that to do but I guess he wants to keep it in 1 program.

 

If this was of any help please kudo and/or Accept as Solution
Kind Regards
0 Likes
Message 11 of 12

DannyNL
Advisor
Advisor

Yes I know, but it doesn't make any sense to keep everything inside AutoCAD.

 

To be able to do anything with the created report, you'll need to open it up in Excel. It has no use without opening in Excel. And if you are forced to use Excel anyway, why not format the report with the powerful built-in features it already has. Instead of reinventing the wheel in AutoCAD with a pretty complex LISP, which wasn't suppose to handle Excel files in the first place.

It would eventually probably be possible to develop something that does the job, but that will take a lot of time compared to format the report in Excel. Coding is a lot of fun but there should be a gain in something as a reason why you are coding. I don't see it in this case.

 

So just pointing out that it would probably be way easier to achieve the desired result directly in Excel Smiley Happy

0 Likes
Message 12 of 12

Anonymous
Not applicable

In the end This project is supposed to export the data to Access. This is also not the only thing it will need to do but I was hoping to see how to start it with just one aspect of the program. The end goal was to have it do several tasks when creating a bom report with a single click while in autocad.

0 Likes