Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations MintJulep on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Toggle suppression of parts with a certain property (macro help)

Status
Not open for further replies.

SteveJJH

Mechanical
Feb 5, 2009
109
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.
 
Replies continue below

Recommended for you

I recommend skipping the macro and using configurations instead. Just create simplified configurations for each assembly. In the simplified configuration you can suppress parts that you do not want to appear, subassemblies that you do not want to appear or select the simplified version of subassemblies. Depending on how your assemblies are structured, you may need to suppress some mates and create new ones in the simplified configuration.

You can also extend this to the part level and have simplified configurations of parts.

Eric
 
You may also want to check out the Quick View function and Simplify utility.
 
Both good suggestions, but we've tried that route in the past, and found that the discipline of creating the simplified assemblies just doesn't happen, so by the time the top level assembly starts having problems, creating configurations of all the sub-assemblies and parts would be a mammoth task.

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
 
The way I did it (it was for a BOM that sorted the stuff so it printed out in the same order every time - the SD way was driving the inventory and shop guys nuts to try to track changes) was to open the assy and find the children. You then you can read all the children properties by using a get command for each part (you don't have to open the part files but you do have to open the assys to find the children). Then you do the same for all the subassys etc.

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
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor