Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IRstuff on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solidworks Macros - Assembly properties in a BOM 1

Status
Not open for further replies.

otokonokuso

Mechanical
Oct 27, 2009
4
I am hoping to get some assistance in a way to export properties from an assembly and its components into an excel spreadsheet. Saving the assembly BOM as an excel spreadsheet is not automated enough, since we need three columns that come from custom properties of the assembly.

These three columns will be repeated for every component line item that show the assembly number, name, and revision. The following columns will be the same ones we would otherwise get from the assembly BOM. I think a macro could be developed to do this. Any tips? Contract work possible as well.

I would like the assembly properties repeated in a table that has its BOM, so it will have to extract BOTH assembly properties as well as component properties
 
Replies continue below

Recommended for you

Hi, otokonokuso:

This seems a bad approach. Assembly properties have nothing to do with its components. They are not part of BOM. Your components can be used in any assemblies if necessary.

If you really want to do it, you can use VB or VBA to extract them together.

Good luck!

Alex
 
I gotta disagree. There is no such thing as a bad approach - well there is but these are usually driven by other people who will not wrap their proceedures around SolidWorks.

The BOM I have had to generate were driven by the shop and the front office who want to do things in interesting ways. The other problem with SW BOMs is that the part/assy order is random. When you make changes and reissue a BOM, it is comparatively difficult to track changes when the parts are not in the same order. In addition, there is no provision for updating quantities when you have 2 or more main assemblies and no - our people don't do math.

Its not hard. Mine generates a master array, sorts it (so the order is the same every time), generates quantities, and reads a bunch of stuff from the properties in the main assembly to generate the header.

John
 
You can sort SW BOM's by part number, can't do that in Excel BOM's. You can also move parts up and down if they don't end up sorting correctly.

You need to educate your people to use math, that's what their brains are for. If they can't wrap their heads around the correct number needed then they need replaced or more education. A BOM should indicate how many parts are needed to make one of that assembly and no more. When you start multiplying it out, someone that is smart enough to know how to interpret a BOM correctly will be confused and pissed off when they spend twice the amount of time pulling parts for one assembly. Job orders should indicate how many main assemblies you need to make, not the BOM.
 
To the OP, I think you lost me on what you are trying to do. You can easily pull custom properties from any part or assembly into a BOM. Just set the link for the column to the correct custom property, see the help files in SW for a detailed step-by-step guide.

After reviewing your post, I think you need to explain a little better what it is you are trying to pull. Is it where each part is used or are you trying to show an indented bill of material?
 
Hi, jefrado:

I do not see anything wrong with SW BOM. SW is consistent with ASME standard. SW throws you a default order of items of BOM. It is up to you how to present the BOM.

Assembly properties are not part of their BOMs. As a matter of fact, assembly properties doe not belong to BOM in SW. If you are familiar with SW BOM object, it does not even contain assembly properties. In order to put them together, you have to manually pull them from two different objects in SW.

I hope this makes sense.

Alex
 
This BOM isn't for ordering parts. It's for a database. I'd be interested in more details about generating macros from jefredo. Can I possibly get a copy and alter yours? Is anyone interested in working for a fee?
 
Hi, otokonokuso:

What is purpose of the spreadsheet? What are you going to do with it? Will this spreadsheet be "LIVE"? That is, if you revise components and/or assembly, do you want this spreadsheet updated?

You can have someone at your local area who is familiar with both VB and SW to export any information from SW to your database.

You may change your if you think about your purpose of this spreadsheet.

Alex
 
If it could be live, that would be awesome. How do you suggest I find someone familiar with VB and SW? Craigslist?
 
Hi, otokonokuso:

I try to disencourage you to do what you are trying to do. Depending on your purpose, there may be something existing already for you to use. You need to realize that any time you pump data out of SW to a spreadsheet, your data will be out of sync.

It won't be cheap as you want to do custom programming. Depends on the scope, you hire a consultant locally to it for you if you really want to do it.

Good Luck!
 
If there is already something than I'll take it. If not, then I may have to hire a program consultant. Anyone interested in being a program consultant???
 
I have some experience writing VBA code for SolidWorks. You might try my joshville address at google. It may be a couple of weeks before I would be able to produce anything, though. I will be overseas for a while.



-handleman, CSWP (The new, easy test)
 
Just one comment. It been the bane of most computer users that most programs require that the people using using it have to bend their philosopy of life around the program rather than having the program do what it actually needs to do.

The primary advantage to writing your own code (and I have had to do it a number of times) is that you don't have to make this compromise (change in your life's values, actually). When you are dealing with systems that, for a lot of insane reasons will not be changed, your only other option is to rearrange things by hand.

Assuming guys out in the shop have to do math is just silly. Of course they can, you just open up a whole other can or worms when they make mistakes (and they will). I under stand that all too well. I would have never made it through CWRU without calculators and computers. I can't add either. I think the reason computers exist is so no one has to.

My code probably wouldn't do you much good since it is specific to what we do and besides its owned by my employeer. In a nut shell, it reads property values that have been filled via another macro and design tables. The macro then fills another Excell sheet that is blank except for the headers, column labels, etc. (a template), renames and saves the file and then throws control over to the excell program.

I thrashed around at the start of this project trying to find someone else to do it and finally had to figure out a way to do it myself. My guess is you will have to do the same thing.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor