Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

can a column in a SW BOM display if the item has an existing drawing... 1

Status
Not open for further replies.

pdelnet

Mechanical
May 13, 2005
115
0
0
CA
can a column in a SW BOM display if the item has an existing drawing... without needing to run a macro first

I want to add a column to the existing BOM table we use, this will show if a model or sub assembly referenced by the row has a drawing associated with it.
This can be a Boolean or string, ultimately I will want to create a macro that will list all the drawings associated with the top level parts or sub-assemblies.

There are a couple reasons for this one is to create a check list that drawings are done, there were no parts that should have drawings and were missed. I can create a custom property that says it should have a drawing but how to verify if it really does.




SW 2015 SP 2.1 x64

 
Replies continue below

Recommended for you

As a work-around you could add a step to the drawing process where as the drafter completes a drawing he/she goes back to the model and enters a value in a custom property called "Part_Dwg_No" or something like that. Then you wouldn't need a macro, you just add a column to your BOM for that property. The process isn't complete until that property is filled in. Not 100% reliable, but easy.
 
Thanks for the reply, the drawing not created is the condition I want to catch. Manually entered custom properties are seldom reliable.
We have a third party program that creates documents based on the BOM of drawings and the presence of part drawings.
Some times there are 100+ drawings, its so easy to miss one.


SW 2015 SP 2.1 x64

 
The only thing I can suggest is to use pack and go. Select the "include drawings" box. This will give an indication of which models do not have a drawing associated with them. If my recollection is correct Solidworks only associates drawings with respective model if they share the same file name. With respect to property fields it is not the property field that is unreliable it is the human element associated with entering it. There are ways of improving the reliability of manual user input. If you absolutely need the drawing exists indicator on the BOM as far as limited knowledge your best option is to manually enter that information as a property field. For legacy data I can suggest the you segregate models with drawings and without using pack and go then apply a mass data entry macro to add a "yes" or "no" to a property field to respective models. Going forward a model template with the property field default to "No" and a required rule to change it to "yes" after a drawing is created should resolve most of your issue.

Hope this helps.

Regards,

Sam
 
pdelnet: Something just happened to me that made me think of your inquiry, and it has happened before. You are in a part or assembly and click on the "Create Drawing" button. Sometimes a box pops up that says a drawing has been created and asks if you want to open that drawing. I always assumed that was because SW did a quick scan of the home folder of the part and found a drawing with the same file name. Here's where it gets funky. Sometimes when I'm in a part or an assembly, I will go looking for a file in a different folder and either not find it or not open it. Later, back in my model I click Create Drawing. The box pops up and advises me a drawing file exists. I assume it found one in the home folder of the part. I click yes to open the drawing. Then SW comes back and says it cannot find a drawing file, but the folder path it's looking in is the one that I was searching in earlier. So, if that other folder is where it is scanning and there's no drawing there, how did it know a drawing of that part has been created? There must be a "marker" or other indicator somewhere in that part file that indicates that it has been used to make a drawing. That seems to be the marker you are after. I'll leave it up to the SW pros to help you get access to it.
 
That is exactly the info I am looking for thru the API, in SolidWorks explorer it also has the files reference in the whereused list. It is just a matter of what method to call.
I have bee searching thru the list of methods but I cant find the one that fits.


SW 2015 SP 2.1 x64

 
pdelnet,

I think Jboggs has the right idea. Sometimes, the drafter will miss entering the code stating that the drawing exists. That results in the occasional false positive. All the drawings that are complete and properly flagged, will be ignored.

--
JHG
 
I do not think that a part file "knows" what drawings it is in. The popup box that Jboggs mentions states that there is a drawing file with the same name, which is consistent with that association being based strictly on the file names.

SolidWorks explorer's Where Used functionality does a search through all of the SW files in the search scope and finds the ones that reference it. The search scope can be set in the References/Where Used section of the SolidWorks Explorer Options box.

Another indication that a part does not know where it is used is that you can reference a part in a drawing without having write access to the part file, which SW would need if it were to store the fact that the part was being used in the drawing inside of the part file.

Eric
 
Eric,
Your logic makes sense, and I agree that a part does not "know" where it has been used, as far as assemblies. But to the specific question about whether or not a part has been used to make a drawing - if one uses the "Create Drawing" button while in the part one obviously has write access to the part file at that time. A "marker" could be set inside the part file at that time. Not saying it does happen, just saying it could happen. How else could SW know later that a drawing had been made of a part if the only path it is searching does not contain a drawing of similar name?
 
I just had this issue come up for me. I changed the location of our drawings to a folder down stream of where the parts and assemblies are located. When I RMB a part name in the FM tree I can select "Open drawing" it would never can find the location of the drawing. Even after I browsed opened it and saved the drawing... most of the time the part never will find the drawing.

However when I complained to my VAR about this, they showed me that if I place a reference path in SW explorer and inside SW file locations\References, that helped SW to find the drawing. Its still flaky, but it does help. Where this really helps me is when I do a pack and go, now it can find all the drawings and parts, even the ones where the drawings are in a completely different area than the parts\assemblies are located.

But there is no direct link made, SW simple looks for the same filename only and it will only search where you have pointed it to search.

Scott Baugh, CSWP [pc2]
Gryphon Environmental
"If it's not broke, Don't fix it!"
faq731-376
 
Scott,
Do you know how this happens? I tell SW to create a drawing. It comes back and tells me one exists. I tell it to open it. It comes back and says it can't find it.
Huh?
 
Jboggs,

I get that all the time and even though I have placed the path in the referenced locations it still fights to find it, sometimes it does, but most of the time it does not. My thought is that I would have to place a path for every single drawing location, which is way out of the question for anyone to do... IMO. If I place a path that is above the hierarchy of the tree, then SW should browse through all sub-folders to find the cooresponding drawing. However I don't think it does.

For example look at this attached image. This is how my tree breaks down per project.
Hierarchy_s7fvff.jpg


Each module of the machine has its own folder and within that folder I have a "SW drawing" folder ([highlight #FCE94F]highlighted in yellow[/highlight]) that just has the drawing saved there. IMO creating folders like this makes it easier to find when searching for a drawing. Instead of browsing through file after file. (FYI we do not currently have any PDM in place, working to fix that soon). However notice the Common Files on the right. Those common files don't have any drawings within the design library, the drawings will be listed per job, because the QTY can change. So I cannot have a standard drawing for each part. You might be asking why that is, its because we have a manual property that we list the QTY per part on the drawing. The reason for that is because of the people we have fabricating these parts for us need the QTY on the part drawing. Plus they won't see the final assembly BOM.

However back to the question... Each job I will have from the Master file will look like this except the Part numbers will have a prefix. Which means if my thought is right then I have to add every one of these paths to the SW references, which in return also means that will have to add them for every project we create. Which I am not going to do. But if I place the paths in SW explorer it does look in Sub-folders and it does find the drawings. That tells me SW does not have this built in functionality and is the reason why it cannot find the drawings. This needs to be an Enhancement request and voted on next year during the top ten for 2016.

So my suggestion for you is to make sure you have drawing path saved under Tools\Options\System Options\File Locations\Referenced Documents like shown below:
Reference_Docs_jeowgh.jpg


Hope this helps,

Scott Baugh, CSWP [pc2]
Gryphon Environmental
"If it's not broke, Don't fix it!"
faq731-376
 
Thanks for all the input, from everyone.
I have resigned myself to the fact that I will need to create some code that will read the filename on the first modelname in the assembly tree (parts ABCD are saved as ABCD), then search the working directory for modelname.slddrw, if that exists I will write "Y" to a custom property called DrwExists in the part or sub-assembly. This is a column that I will now need to add to the BOM Table.
This code will step thru the entire assembly tree and then give me the result I need.
It would have been nicer to have that property all ready present but...
I guess it is an enhancement request.
I am quite new to API and VBA so I guess its time to use what I learned in the API course.




SW 2015 SP 2.1 x64

 
Scott,

If you use a common part in 2 projects, there are 2 drawings for it with possibly different quantities. Do those drawings have different drawing numbers?

Eric
 
This is where this is going to be a problem.... The actual part files will maintain their P/N. The drawings for those parts will have a prefix per the project. If the drawings didn't change, then when we go to a PDM software they would not be unique and we would have another crisis on our hands. The other down fall to this is that the filename will be different and SW will not find the drawing because the part will reference several different drawings. If the part does change it changes all the old projects... that could go both ways, bad or good.

Scott Baugh, CSWP [pc2]
Gryphon Environmental
"If it's not broke, Don't fix it!"
faq731-376
 
So, a part may appear in two different assemblies and,
the quantities in those assemblies may be different and,
the guys on the floor want the quantity to appear on the drawing.

Sounds like what you need is a "router" system where a single sheet is routed through the process with the parts describing the part number, drawing number, quantity required, finishes, etc. That way the floor guys have the information they need and you don't have to worry about different quantities of parts being needed for different assemblies. In that situation, putting the quantity required on the drawing, and then having to change it the next time that part is run just sounds like a HUGE opportunity for very costly mistakes, human errors, whatever.
 
At least the they have project specific prefixes. The gotcha I had envisioned was the drawing number was the same and the first project called for 100 and the second called for 5. Then when the vendor got the PO for the second project they used the old drawing and made 100. Although for a long lead item the opposite would probably be worse.

A lot of the art of engineering comes in finding optimal solutions given constraints. Some times the constraints are institutional rather than physical.

Eric
 
Jboggs,

In most cases you would be correct about that... however I don't think so in my case, but that is just my opinion.

The good thing about this company I am working at now, is there are only 6 of us working here including myself. So we are the Mfg floor. Everything we design is sent out for fabrication to other companies. After all the fabrication is completed and shipped back to us, we assemble the machines ourselves. So each job is independent of the other. The good thing about the Common parts is that once we make one system lets say a 5x20 that machine will always have the same amount of common parts for any future 5x20 systems. So there is no need to change the qty for those common part drawing per the job, its already done for us. Unless the customer wants something specific, but that has not been the case yet.

Scott Baugh, CSWP [pc2]
Gryphon Environmental
"If it's not broke, Don't fix it!"
faq731-376
 
Status
Not open for further replies.
Back
Top