How can I display a sheet metal gauge in draft?
I am not clear what you mean "in Draft".
He probably means how to display the thickness in your BOM as a gauge.
I want to display the sheet metal gauge on the drawing. The drawing is a single piece of sheet metal. I want to link the gauge that was selected from a gauge table to show up in the drawing. In this way when the part and drawing are copied and edited to another gauge, the display of the gauge is automatically updated.
IE how do I make "12 GAUGE CS" show up on the drawing. See attached file
Linking this to a property is a huge can of worms from everything I have read involving setting up if then statement in the files BEFORE creating anything then using a macro. But I have files already created.......seeking solutions.
Can you save the gauge as an auto-populating custom property? That way you can have the property in a note on a drawing.
I use a macro to populate my gauge thickness and then transfer to a custom property which I then have in a note on the drawing.
Edit: I just saw your table, I would write a macro and place a button on your ribbon that will take the material thickness and then based off that information make a custom property with that description.
I would like to, how do I do that. Guess that's part of the question. I just spent the last 5 years in solid edge where this was easy. Can't find the solution in solid works.
This is the part of the macro that I use to do that similar function:
'Setting up all the variables
Dim swApp As SldWorks.SldWorks
Dim swModel As ModelDoc2
Dim swModelDocExt As ModelDocExtension
Dim swCustProp As CustomPropertyManager
Dim swFeat As SldWorks.Feature
Dim modelThickness As String
Dim evaluatedThickness As String
'Setting Active Programs and Documents
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
Set swModelDocExt = swModel.Extension
'Set feature for cut list which is the first feature
Set swFeat = swModel.FirstFeature
Do While Not swFeat Is Nothing
If swFeat.GetTypeName() = "CutListFolder" Then
Set swCustProp = swFeat.CustomPropertyManager
'Stores flat bar thickness (both evaluated and typed values)
swCustProp.Get4 "Sheet Metal Thickness", True, modelThickness, evaluatedThickness
Set swFeat = swFeat.GetNextFeature
'Setting Custom Properties
Set swCustProp = swModelDocExt.CustomPropertyManager("")
If evaluatedThickness = "0.75" Then
evaluatedThickness = "3/4"""
ElseIf evaluatedThickness = "0.875" Then
evaluatedThickness = "7/8"""
ElseIf evaluatedThickness = "1" Then
evaluatedThickness = "1"""
swCustProp.Add3 "Material Thickness", swCustomInfoText, evaluatedThickness, swCustomPropertyDeleteAndAdd
***I just grabbed the pieces from the macro I use there might be errors as I didn't test it but the main information should all be in there
Have a look at this thread, it should answer your questions.
Sheet Metal Parts - Can Gauge (not thickness) auto populate drawing?
Give this macro a try. We use it to give us the bounding box area for the part and it uses the thickness to place the material part number and description in custom properties. You will need to edit it to have your numbers and descriptions.
I tried to look at that macro, but most of it is difficult to look at when I open it in notepad.
I am new to Solid Works, What software do I use to edit that macro?
It's been 35 years since I looked at Basic or Fortran. Yes I have crated a few macros over time, but only by recording and playing back procedures in specific that that program, never by looking at code.
SolidWorks provides in itself a version of Microsoft Visual Basic.
How to edit Macros on SolidWorks:
2017 SOLIDWORKS Help - Edit Macro
S. Leacox wrote: Thanks Jim, I tried to look at that macro, but most of it is difficult to look at when I open it in notepad.I am new to Solid Works, What software do I use to edit that macro?
S. Leacox wrote:
There is a built in editor for macros. If you open the macro toolbar you will see the shown button which will browse you to the file you want to look at.
Then you will want to scroll down till you see the lines below:
The if C finds variable C (material thickness) and finds it's value below that we are setting MaterialNo to our given material part number and setting Material to be the material description. This is basically like your 2 tack system you described below.You have to go into the macro and edit those two descriptions to fit your parameters and the custom property names you use.Just do that for all of the materials you have.
Here's the best explanation I've seen using native SOLIDWORKS functions and no third party code that needs to be clicked, etc.
SOLIDWORKS 2016 - The sheet metal gauges - May 2016 - YouTube
It could also be done (sorta) through equations, setup a sheet metal part template, put all the if/then code into the equitation referencing the thickness global variable, with several nested if/then statements to calculate your desired gauge.
Because there's no standard feature we wrote our own conversion table code to generate the right gauge table for our SOLIDWORKS integrated ERP solution.
If you would like more information or if there's anything else I can help you with, feel free to reply here or contact me!
I have been unable to get that to work. I'm going to give it a shot with if and = statements.
My system does not have IFF and LIKE functions from the pull down and it does not recognize them when I type them in. I'm in 2017 Premium.
I am able to enter in IF and = statements and get things to work. But here is the other twist to all of it.
I have three different cases to consider:
1. A gauge actually matches, no problem
2. The part is thicker than any match to a gauge, say 1/4" plate
3. The part is a nominal fraction, say 1/8" aluminum
In the case where the part is fractional inches vs a gauge, how can I display the thickness correctly in draft
So either I want to display 12GA or 1/8" or 1/4"
With the complex function like, I will be able to get the results down to:
20, 18, 16, 14, 12, 10, 7
or 0.125, 0.25, 0.375 0.5
So then how do I display an " inch mark after number lower than 7?
I have a different tack. I'm wondering if anybody thinks this could work.
1. Set up a material for every gauge and material we plan to use.
2. Set up a Macro that sets the gauge to the materials for every piece of sheet metal in an assembly.
The material names would be the same as the gauge names to help this.
Scenario two sounds like it should work, like I mentioned above a lot of my macros I just run (using a button on the ribbon or keyboard short cut) after I've completed all my design tasks and it auto populates all the information I need instead of retyping everything.
I have boiled my problem down to a very simple issue I may not be able to get past.
I can get the gauge math to work out.
If the number is smaller than 7, I want " (inch marks) to show up
If the number is 7 or larger, I want GA (gauge) to show up
How can I do that?
If gauge < 7 then
run the code to keep it inch
Elseif gauge >= 7 then
enter the code to make it gauge
I'm not using any macro, I'm doing everything with equations and properties to display in draft.
I am having a tough time writing that line of text in equations
Retrieving data ...