Is there any options to get sheet metall thickness for all configurations in part (in assembly part) without showing them? (Just for speed)
To do that we have to use another approach than the previous macro. The attached macro gets the name of the Sheet metal folder and then loops thru all the configuration specific attributes.
If a match is found of "Thickness@[Sheet metal folder feature name]" then there is a configurations specific dimension, done with the method you mention.
I do not know if there might be issues running this macro on a machine with another language. (Thinking of a previous post when a person with Spanish language installed had trouble with Mass vs. Massa).
I also added so the the macro prints out if there is no configuration specific thickness found.
Please try it and let me know what you think.
Oleg Bezyaev Please try this macro as well and let me know if this is what you are looking for.
I imagine you ultimately want to use this information on a drawing. You can set up custom properties to pull information from the part and then link notes on your drawing to those properties. This approach is searchable if you need help, or reply and tell me more about your scenario if you have more questions.
No, I need this information at part level or while traversing assembly. If at the level of part, that means I need to sequentially activate each configuration? If at the assembly level and while traverse on parts I need show each configuration and taking the value from the feature?
These two methods works is very slowly if I have hundreds of configurations.
Okay I have a few ideas that may be useful to you.
Hope that helps point you in the right direction. I'll help more if I can.
P.S. on linking the sketch, that text will reflect whatever configuration is active.
You describe methods to add size of thickness to the any fields of the model. I asked whether it is possible to obtain the thickness from the design tree feature, without highlighting and iteration all configurations. For example obtain value from SheetMetal folder or BaseFlange feature or CutList feature.
And all this with the SW API. We are in the API section
Oh yes I see that now. I'm just starting to learn API and I'm afraid I'm not much help there.
I doubt if it would be easy to get that with showing the configs. You may set up the configuration property as Mike said and then use the macro to get the value of that property which might work without iteration of all configurations
User has not used a field in the configuration. I only have a tree with hundreds of configurations and assembly with dozens of this parts.
Please understand me, I'm not looking easier way to get thickness in the future. I have a specific goal: whether it is possible to get the size of the sheet thickness from feature tree for any configuration. Without showing theese configurations. Without additional fields in properties. Without desigh table.
Could you attach a example of how the file might look like?
Yes, of course.
Please try this macro before you give up. The macro is tested in SW2014 and is using API methods that was introduced in SW2014. I believe that is it possible to achieve same thing for earlier SW releases as well, but with some modified code...
I combined two examples from the API reference and added some things I have tested before. The macro does not consider exceptions in a good way... so you might add handling of exceptions if needed. (E.g. no sheet metal features is in the part etc.)
The macro is to be executed at with a part as active doc. I read that you mention to get this data while having an assembly but got uncertain...So I aimed to get it working at part. The macro will not activate each configuration, it just get and print the dimensions of the thickness. Let me know if you want to execute this from a assembly and have all sheet metal parts listed with their different thickness and I will give it a try.
The macro will print the data to the immediate window in the VBA editor. Do some test runs and let me know if it works.
Below is the result I got from the test file you posted.
???????? ??????3 - OverrideDefualtParameters 00 --> 1 01 --> 1.5 02 --> 2 03 --> 0.5
???????? ??????3 - OverrideDefualtParameters
00 --> 1
01 --> 1.5
02 --> 2
03 --> 0.5
Note: I also found out that SW2014 has trouble to keep things right if multi bodies with different thickness is used in configurations....
P.s There is also alternative ways of doing this by getting all configuration specific data (suppressions states, dimensions, colours etc. etc.) if needed....
It would be also great if you let us know what SW version this macro will be running on. There is some new sheet metal features that was introduced in the API for SW2013 and SW2014 that is not compatible with SW2012.
EDIT 2014-12-09: This macro gets the thickness dimensions for configurations IF the override default parameters has been used.
Hi Dan, can you see if macro can be made for the attached part. Thanks.
What SW version is it?
You can also create a sample file and then add a configuration to that. Now double click to change the thickness by using the option "this configuration" (and not by overriding the default parameter)
Yes, it works very well. Thank you so much.
bRetVal = False. Allways.
Well, the sample you posted do use the override function... and not the configuration specific dimension as Deepak Gupta posted.
This gives bRetVal = True. Please test run the previous macro with the file you posted.
Oleg Bezyaev wrote: Please understand me, I'm not looking easier way to get thickness in the future. I have a specific goal: whether it is possible to get the size of the sheet thickness from feature tree for any configuration. Without showing theese configurations. Without additional fields in properties. Without desigh table.
Oleg Bezyaev wrote:
Sorry I would doubt on this using normal VBA. Have you checked into Document manager to get that value.
Do you think that this is the only option?
Retrieving data ...