Continue to Site

Welcome to MCAD Central

Join our MCAD Central community forums, the largest resource for MCAD (Mechanical Computer-Aided Design) professionals, including files, forums, jobs, articles, calendar, and more.

Script or Macro

Scott_M

New member
Hello all, this is probably a pipe dream but here goes. The division that I work for isn't using driven BOM tables on their assembly drawings. The existing assemblies don't have all the same parameters either. My question is, is there a way to write a script file or create a macro that would do the following:

1. Create a set of parameters (i.e. description and material) for the top level assembly and all components and sub-assemblies within that given top level assembly.
2. if the specified parameter for the top level assembly or any of the components or sub-assemblies already exists, skip that part or sub.

Any help would be appreciated. :)
 
I understand what he is asking, but don't know the solution.
Would be interested in it myself.

Bart, he wants to add parameters to existing models using a script.
 
Yes, it's possible but would get pretty convoluted pretty fast. Easiest way is to write a mapkey that adds the parameter required. You can run the mapkey in each part opened. to do it automatically for all components by running it from an assembly could be pretty troublesome. You could probably do it by writing a toolkit application or possibly through model check.

Seems to be some sort of consistency needs to be incorporated and proper start parts that have the correct configuration desired with the correct parameters.
 
srieger, thanks. I do have a mapkey set up for a individual part, but it's the assemblies that get VERY tiring opening EVERY. SINGLE. PART. Ugh! The problem is that a lot of the legacy components have ANYTHING but consistency. Plus all the components may, or may not be released. I was hoping for something so that I could create a BOM, then delete the Repeat Region and therefore keep my BOM table Layer naming conventions all over the place, and no rules set up at all. Very frustrating.

Oh well, thanks anyway.
 
Hi Scott_M

You can change the model tree in the assembly to show parameters. If the parameter does not exist in a part you can create it in the part from the assembly.
I save various model tree configs and load them when I need to change or add parameters to assembly parts from within the assembly.
As for automating this I guess you could create a mapkey but dealing with errors in existing or missing parameters could be a problem. Perhaps Toolkit or AutoIT could help in this situation.

I have attached one of my model tree configs for reference.

Hope it helps.

Miles
 

Attachments

  • Part_and_Supplier.zip
    482 bytes · Views: 17
Hi Scott,
Are you just want to create those two parameters or want to have some value against each parameter?
If you just want to create parameters and keep them blank, you can go for J-Link code where program will open assembly file, then it will find out all its child components and save them in array, and then finally using for loop on array program can open each part and add those two parameters. Writing code is very simple if you have basic Java skills, all other APIs are readily available and J-Link is totally free compare to PRO/Tookkit.
 
Hi Scott,
You can use ModelCHECK to add parameters and parameter values as well.
Unfortunately setting up is not so intuitive. I just went through it 3 months ago.
 
OK, It's been too darn long since I've replied to all you folks. Sorry about that but I was never able to come up with a simple and effective way to create the necessary parameters. I am now currently trying to set up ModelCHECK for our local office. The documentation that I have (WF4, we are currently running on WF5) says that I can create a parameter but I having the devils own time trying to get this option to work :mad: . I am going to submit a new post asking this and a couple of other questions for ModelCHECK.
 

Sponsor

Articles From 3DCAD World

Back
Top