AutoCAD Electrical Forum
Welcome to Autodesk’s AutoCAD Electrical Forums. Share your knowledge, ask questions, and explore popular AutoCAD Electrical topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

BOM Formatting Issue - Each tags appears on its own line

31 REPLIES 31
SOLVED
Reply
Message 1 of 32
Anonymous
3113 Views, 31 Replies

BOM Formatting Issue - Each tags appears on its own line

We are having problems with the Panel BOMs that Electrical generates.  First, each tag occupies its own line with a hard-return/End-of-line character after each tag.  Where you only 3-4 tags, this isn't a big deal, but if you have 40-50 relays in a design your BOM takes up too much space.  In the past I have just exported to Excel and resolved the issue in Excel - however we are trying to now streamline the process and the formatting is the big drawback.  Is there a way to have the BOM generator not place end-of-line characters after each tag?  Maybe instead place a comma and a space?

31 REPLIES 31
Message 2 of 32
TRLitsey
in reply to: Anonymous

Hi there,

 

I would probably start by reading a little Help, see what is available for your application.

 

Screenshot - 1_26_2017 , 1_37_03 PM.png

 

 

Screenshot - 1_26_2017 , 1_37_40 PM.png

Please mark as a solution if this works for you, kudos are always welcome
Message 3 of 32
Anonymous
in reply to: TRLitsey

I have done as stated above and am unable to change how the tags are listed in the BOM - if I am missing something, please I would be very grateful to know where & what.  Here is how ACADE formats the TAGS:

Bad_Format.jpg

 

Here is how I would like to see the BOM formated - provides a much cleaner and compact BOM.

Better_Format.jpg

I have even tried using the FIND command to search and replace the end-of-line character with ", " but AutoCAD will not even search for an 'end-of-line' character.  I would much prefer to be able to set how the tag lines are formatted.

 

Another note - when generating the above images, I found that there were an equivalent number of 'end-of-line' characters in each of the cells on each of the rows as to the number of tags found.  Please, someone tell me how to fix this automatically or with some sort of script...  Please?

 

Message 4 of 32
PatMurnen_Adsk
in reply to: Anonymous

Hi ericp-theelf,

 

Whenever a standard report format doesn't quite meet your needs the next step is probably a custom user post file for the report that is closest to what you want. Here is some information about user posts pulled from the Help topic, About Reports.

 

Post-Process

Each report type has an associated lisp file (.lsp) and dialog box definition file (.dcl) that can be customized to post-process the report data. When you run a report, the data is displayed in the Report Generator dialog box. If you click User Post, the dialog box defined in the associated .dcl file displays. The actual processing for each option on the dialog box is defined in the associated .lsp file.

Sample files are installed in the C:\Program Files\Autodesk\AutoCAD {version}\Acade\Support\{language code}\Shared\ folder. Add your own post-processing options to these sample files. Here are some examples that are in theBOM.LSP sample file.

The data is passed back to the Report Generator dialog box where you can save the report as a file, insert it as a table, or print it.

Note: See the Report Generator Dialog Box help topic for a list of user post file names.

 

I can help with writing a first pass at what you want. One thing we might need to experiment with is whether you do want a hard break, say after every third tag, or you want to let it wrap in the cell automatically. 

 

Once it works the way you want, I can also help you get it set up so it runs not as a manual post-process but as a pre-process so your BOM report uses this new format automatically.

 

Anyway, let me know what report and display option and I can send you a first pass. It would also help if you can send me your current user post files for the report. The Bill of Materials report user post file name depends on which report (Schematic or Panel BOM) and which display option (Normal tallied, By Tag, etc.) since the user post .lsp file is named different for these report options. Look at this help topic, Report Generator, to know which files to send. In AutoCAD Electrical 2017 these files are usually stored in C:\Program Files\Autodesk\AutoCAD 2017\Acade\Support\en-US\Shared.

 

Regards,

Pat Murnen

 

 

 
 


Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 5 of 32
Anonymous
in reply to: PatMurnen_Adsk

Pat - Thank you for the response.  I am using the BOMPNL.lsp and .dcl files.  I was just poking around in them and it has been too long since my lisp days.  I want the tags to have a ", " and let each line automatically wrap given the cell width.  Currently I am not sure, but we will probably want to do a hard-return between the fields in the description cell.

 

I cannot tell you how grateful I am for your help!  Thanks!

 

Eric

Message 6 of 32
PatMurnen_Adsk
in reply to: Anonymous

Eric,

 

So as far as you know the BOMPNL.LSP and DCL are unchanged from the install? If they have been modified I would want to edit your files so you don't lose any changes. If they have been changed can you zip them and upload to this thread? If not, what version of AutoCAD Electrical are you using? There was a format change to these .lsp files a few releases ago so I want to make sure I use the right format.

 

I should be able to look at this early next week and send a first pass.

 

-Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 7 of 32
Anonymous
in reply to: PatMurnen_Adsk

Pat,

 

I have not modified these files, ever.  Base install should be fine.  We are currently using 2016.  Probably will not be upgrading until 2018.  Will greatly appreciate any and all of your help!

 

Thank you,

 

Eric

Message 8 of 32
PatMurnen_Adsk
in reply to: Anonymous

Eric, I've attached the user post to combine the Tags into a comma-delimited entry. I added it as the 3rd option on the user post dialog. To try this I would make a back up copy of the bompnl.lsp and bompnl.dcl files (in 2016 usually located in C:\Users\Public\Documents\Autodesk\Acade 2016\Support\en-US). Then unzip the attached file in to that folder. When you run the report, click User Post on the Report Generator dialog. Then pick the 3rd option, TAGs comma delimited.

 

One potential issue I see is that in the Report Generator dialog the column for this can get pretty wide so it might look strange on the screen. But, when you insert the table you can control this by selecting to Define Widths on the Table Generation dialog rather than letting the program calculate the column widths automatically.

 

Let me know if this doesn't get you what you wanted. If it is good and you want to set it to run automatically each time you run this report, let me know and I can help you get that set up.

 

Regards,

Pat

 

Please hit the Accept as Solution button if my post fully solves your issue, or reply with additional details if the problem persists.



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 9 of 32
Anonymous
in reply to: PatMurnen_Adsk

Pat,

 

That is perfect!  Yes the width of the column comes in pretty far out, but that is an easy adjustment - and I believe it can also be a setting too, if I am not mistaken - either way a small issue at best.  

 

How do we get this to run as a pre-processed routine, rather than post?

 

Also, I am a big fan of 'Teach a man to fish and he'll eat for a lifetime' - can you point me to the place in the lisp and dialog files as to where you made the changes - also, are they well commented?  I ask as we have for a number of years been drawing - a very manual process - field wiring diagrams, that after our recent training I believe we may be able to replace with connection tables that are much better automated.  I would assume that the process and code that you have produced would be easily applied to the connection tables and we can manipulate them to produce exactly what we are looking for in them as well.  I haven't really worked with these reports yet, but figured I would ask - hope I'm not out of line...

 

Thanks again - sooo much!!

 

Eric 

Message 10 of 32
PatMurnen_Adsk
in reply to: Anonymous

Eric,

 

Glad that is what you were looking for. The modifications are pretty straightforward lisp code in the user post file. The user post files are in source code format so you can look at them with any text editor or Visual Lisp. The section I added in bompnl.lsp looks like this -

 

      (if (= user_3 "1")
        (progn ; put tags in comma-delimted list instead of individual rows
          (setq newdatalst nil)
          (foreach lst combined_data
            (setq taglst (nth 21 lst))
            (if (AND taglst (> (length taglst) 1))
              (progn
                (setq str "")
                (setq flag nil)
                (foreach x taglst
                  (if flag (setq str (strcat str ", "))) ; add delim after 1st item. 
                  (setq flag 1)
                  (setq str (strcat str x))
                )
                (setq lst (wd_nth_subst 21 (list str) lst)) ; plug it back into the record as a list with one string element.
            ) )  
            (setq newdatalst (cons lst newdatalst))
          )
          (setq combined_data (reverse newdatalst)) ; put back in original order
      ) ) 

The basic workflow of the user post functinoality is that AutoCAD Electrical passes the report data to the user post, the user post changes the data, the user post passes it back to the AutoCAD Electrical report function and it is displayed and can be inserted as a table. Each report has different data so usually at the top of the sample user post file are comments that tell you what data is passed and the order.

 

For the Panel BOM some of the data in a record can be sub-lists, Tags is one of those since there can be multiple values for a single report record. At the top of the bompnl.lsp file (not shown above) it tells me that the Tags are a sub-list in element 21. So basically each record in the data sent is like a row in the report. I pull out element 21, change the list to a string with the comma and space in between each one, then plug it back into that row of data as a list but with just the single string value. Then the routine passes the updated data back to the report function in AutoCAD Electrical.

 

You can do a lot of stuff in the user post. I have done some where another dialog pops up, or it extracts more information out of the catalog or project database. 

 

For your other type of table I recommend finding a report that is the closest to what you want then seeing if a user post can change the data to get the final result you need. If I didn't answer your question, maybe if you can attach a sample of what you are looking for I can be more specific.

 

As far as running it as pre-processed let me write something up. I assume you aren't using .SET format files currently? It can be defined in the .SET format file for a report but I think for 2016 it has to be manually set up, i.e. there is no UI to do it. So I need to do a little research and see the correct format for it in the .SET file.

 

Regards,

Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 11 of 32

Eric, 

 

I was mistaken when I said in AutoCAD Electrical 2016 didn't have the UI to define a user post option in a format .SET file. It was added that release. I have attached a Word document that explains how to do this. Hopefully it isn't too confusing. 

 

Let me know if you have any questions.

 

Regards,

Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 12 of 32
Anonymous
in reply to: PatMurnen_Adsk

Pat,

 

Worked perfectly!  Thank you very much for all of your help!

 

 

Message 13 of 32
PatMurnen_Adsk
in reply to: Anonymous

Eric, I am glad that all worked for you. Once you get it all set up it is great, but it takes a little work getting there.

 

Regards,

Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 14 of 32
matthewp16
in reply to: PatMurnen_Adsk

Hello Pat,

 

I tried using the custom bompnl.lsp and bompnl.dcl files that you provided in this forum post to accomplish the same functionality that person was looking for, but it isn't working correctly for me. It seems that if I don't have any tags for an item in the BOM it moves things over from other columns, which has a ripple effect on the other columns for those items. This may be due to me using AutoCAD Electrical 2017 instead of 2016, or maybe I have my BOM set up differently. I have attached a .dwg file containing the same BOM with the User Post processing and without. It won't allow me to attach my .set file that I use to format my BOM, so it is posted below.

 

Report = Panel Bill of Material (BOMPNL)
Format = (0 16 1 4 3 6  (7 4 3 ))
Title = ("ITEM" "QTY" "SUB" "CATALOG" "MFG" "ASSYCODE" "DESCRIPTION" "DESC" "QUERY2" "QUERY3" "MISC1" "MISC2" "USER1" "USER2" "USER3" "TABNAM" "TAGS" "DESC1" "DESC2" "DESC3" "INST" "LOC" "UM" "HDL" "DWGIX" "REF" "SH" "SOURCE" )
Characters = (12 4 4 60 24 24 60 60 60 60 60 60 24 24 24 32 24 60 60 60 24 16 60 18 12 12 12 12 )
Justification = ("MC" "MC" "L" "ML" "ML" "L" "ML" "R" "R" "L" "L" "L" "L" "L" "L" "L" "ML" "L" "L" "L" "L" "L" "L" "L" "ML" "L" "L" "L" )
Sorting = (1 4 5 16 )
Include Options = ("1" "0" "1" "1" "1" "1" "0" "0" "0" "1" "0" "1" "0" "0" "" "0" )
Location Options = (1 nil )
Installation Options = (1 nil )
Table Options = ("" "" "1" "0" "0" "1" "1" "0" "0" "0" "" "" "0" "0" )
Table Settings = ("" "" "" "PITEM" 1 1 1 "" "" "" "" "" "" "" "0" "col_define" "BILL OF MATERIALS" nil )
Table Fix Options = ("0" "0" "0" "0" "0" "0" )
Table Layout = (1.0000 7.0000 1.0000 4.0000 4.0000 15.0000 )
Table Insertion = 1
Table Style = "ACE_TABLE_2"

Please let me know if you need any further information.

 

Thank you,

Matt

Message 15 of 32
PatMurnen_Adsk
in reply to: matthewp16

Matt,

 

First thing to try is to copy\paste the portion of the bompnl.lsp into your own bompnl.lsp that came with your product (usually installed at C:\Program Files\Autodesk\AutoCAD 2017\Acade\Support\en-US\Shared). There was a format change to these files and I am not sure which version of AutoCAD Electrical the new format was introduced. So this way you will make sure to use the right format. Or you can attach your copy here and I can do it to make sure the parentheses are correct.

 

If that doesn't fix it, can you send me a small project that I can reproduce this on? You can send it to me directly at pat.murnen@autodesk.com.

 

I will be out of the office for a few days so might not be able to look at it until next week though.

 

Regards,

Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 16 of 32
matthewp16
in reply to: PatMurnen_Adsk

I replaced the code for option 3 in the default bompnl.lsp with the code in message 10 of this thread. I am still getting the same result. I have attached a sample project for you to test with, but feel free to send me your revision of the default 2017 bompnl.lsp file which I have attached as well.

 

Thank you,

Matt

Message 17 of 32
PatMurnen_Adsk
in reply to: matthewp16

Matt, it's probably just a case that I didn't account for in the original user post. I should be able to take a look at it early next week when I am back in the office. Thanks for the files.

 

-Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Message 18 of 32
akegb817
in reply to: PatMurnen_Adsk

Hi Pat,

 

I'm wondering if you ever found a solution to Matt's problem.  I have been using your edit to the lisp file to wrap the tag names, but I am having the same problem that Matt has for my items don't have tags.  I'm using 2019. 

 

Any help you can give me would be greatly appreciated.

 

Thanks

-Adam

Message 19 of 32
matthewp16
in reply to: akegb817

Hello Adam,

 

I have attached the files that Pat modified for me. If you have any questions about how they work, @PatMurnen_Adsk will have to answer that. They work perfectly for what I was trying to achieve. Hopefully, they do the same for you. The default location for where these files should go is:  C:\Program Files\Autodesk\AutoCAD 2019\Acade\Support\en-US\Shared. The path may need to be modified based on where you installed AutoCAD.

 

Best wishes,

Matt

Message 20 of 32
PatMurnen_Adsk
in reply to: matthewp16

Adam, let me know if the files Matt provided don't do the trick. I should have closed the loop on this thread after we worked on this offline. 

 

Regards,

Pat



Pat Murnen
Principal Content Developer
Product Development – AutoCAD Product Line Group

Autodesk, Inc.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost