Toggle suppression of parts with a certain property (macro help)
Toggle suppression of parts with a certain property (macro help)
(OP)
Hello.
We work with some fairly large assemblies, that for the most part don't need to be hugely complicated, however, the sub assemblies need to be fairly complicated for drawings and detailing.
I've added a yes/no custom property to our part template called "suppress on simplify".
I'm trying to write a macro that can traverse an assembly and suppress parts, even in sub-assemblies, that have the "suppress on simplify" property set to "yes". I don't need to suppress whole sub-assemblies.
It's been a while since I've used VB (I'm going to be using .NET for this), so I've forgotten most of what I learned.
As a starting point, I was just going to ask for some suggestions as to how to structure the macro.
I was thinking of opening all the sub-components and checking for the property, but then I'd have to create some sort of list that can be read once the sub-components are closed and the assembly is re-opened (or reactivated if you like). This also seems like it would be really long-winded.
I guess I'm asking if you can traverse an assembly and check the custom properties of any sub-components, then suppress them without having to open them and then close them again.
It being a toggle would be great, but I think that might make it twice as complicated, maybe I'll do it as two seperate macros.
We work with some fairly large assemblies, that for the most part don't need to be hugely complicated, however, the sub assemblies need to be fairly complicated for drawings and detailing.
I've added a yes/no custom property to our part template called "suppress on simplify".
I'm trying to write a macro that can traverse an assembly and suppress parts, even in sub-assemblies, that have the "suppress on simplify" property set to "yes". I don't need to suppress whole sub-assemblies.
It's been a while since I've used VB (I'm going to be using .NET for this), so I've forgotten most of what I learned.
As a starting point, I was just going to ask for some suggestions as to how to structure the macro.
I was thinking of opening all the sub-components and checking for the property, but then I'd have to create some sort of list that can be read once the sub-components are closed and the assembly is re-opened (or reactivated if you like). This also seems like it would be really long-winded.
I guess I'm asking if you can traverse an assembly and check the custom properties of any sub-components, then suppress them without having to open them and then close them again.
It being a toggle would be great, but I think that might make it twice as complicated, maybe I'll do it as two seperate macros.






RE: Toggle suppression of parts with a certain property (macro help)
You can also extend this to the part level and have simplified configurations of parts.
Eric
RE: Toggle suppression of parts with a certain property (macro help)
RE: Toggle suppression of parts with a certain property (macro help)
We often use parts based on existing library parts in our assemblies, so if those had a "suppress on simplify" property, you could hit a button at the top level and all the parts would be suppressed in one go, rather than having to open every sub-assembly, which in our situation would be extremely time consuming
RE: Toggle suppression of parts with a certain property (macro help)
The first version of this used recursives and was a fairly short program. SD, in their really wacko "wisdom" made some changes in 2009 so recursives would start reading random stuff by the time it got a few levels deep. Recursives had to be eleminated from everything I had written. Yes they have been notified and no there was never even an acknowledgement of the problem.
If you knew the file names of all the files or could discover them by a dir command or something so you didn't have to find them out by getting the children, you may not have to open anything and it would run a lot faster.
As it is, my way runs pretty quick since the only time consuming tasks are on the assys.
John