×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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.

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

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

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

You may also want to check out the Quick View function and Simplify utility.

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

(OP)
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
 

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

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

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources