Thank you Carrie! Well, this could work if "Plate" is always on the text, that should be a variable too. On Description I need to put the commercial name of the sheet metal thickness, below I list some other examples:
- Thickness: 1.5 Description: LAM C16
- Thickness: 1.9 Description: LAM C14
- Thickness: 0.91 Description: LAM C20
- Thickness: 15 Description: Plate 15
- Thickness: 6 Description: Plate 6
Think about where you can afford manual steps and how many people are going to be touching this. Is there a fairly short list? Can you trust the people working on parts to do it right? If it is a short list and you have people that pay attention, I would just have a drop down in the property tab builder for them to pick the right description.
If is a longer list and you need more automation, you may want to look at a macro. I'm just learning macros. There are examples of ones that will let you get the custom property information. So, starting from one of those, you could read the thickness. Then based on the thickness, set the description. I'm sure there is a better way than if statements, but that's what I've used for things so far.
Are you using gauge tables or anything like that to drive your thicknesses? I don't know if you could pull something from that to help with the description. I don't know what information is in the gauge tables. I don't see anything obvious when I make a sheetmetal part.
I´ve been using a drop down list in the property tab builder in the past and the people were making mistakes picking the wrong description. That´s the problem I´m looking to solve through automation. The list is not as short as the one I wrote above, it was just a quick example.
I need the macro to read the existing value of thickness, so it can set the description automatically. I suggested Case statement instead of If because I´ve read something about, but not really sure how to write it on the code.
Do all the parts in you assembly are sheet metal parts? If yes then automation would be easier and macro can be made to traverse the top level assy and update the property for every single component (part).
You can use the case codes as
Select Case sThickness ' You need to get the part thickness value in MM
Description= "LAM C16"
Description= "LAM C14"
Description= "LAM C20"
Description= "PLATE 15"
Description= "PLATE 6"
Description= "THICKNESS UNKNOWN"
But if the answer is no, then you would have to define a property for the thickness (which macro can read) OR do it manually.
Seems like it'd be easier just to link it to the dimension?
Just open the Custom Properties, put the cursor in the box and double click the part and select the dimension. It'll put the dimension name in there and then you'll have the value in the custom property, no macro necessary.
Edit to add: Carrie Ives, ya beat me to it! Good Job!
It´s easier but sometimes I work with large assemblies, so I will spend a lot of time opening the property window and linking the property with the dimension on the model. With a macro I´m looking to simplify this by just clicking a macro button
The problem with what you are suggesting is that without a handle, it is hard to get the "thickness". If you are using Sheetmetal, it may work (I don't know much about sheetmetal). But, if you are using plain SW part templates, unless all of these parts have the same handle (dimension name) this may be hard to code into a macro.
Edit to Add:
But, the second part of what you are asking for, a look up table that cross lists the thickness to a text field, should be easy enough to do with a macro. Solving the first part of your problem is the difficult part. Maybe you could post up a sample part or two for people to look at?
Yeah, actually I have no problem at all to get the thickness, I´ve already solved that using the property tab builder. Solving what you consider the second part of the problem is my main issue.