ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
JHJosh Hilgart14/10/2009

Hello everyone

I'm currently looking for a macro to save individual parts from an open assembly as a parasolid by looking up the revision of the part in the part properties and adding it after the part number with an underscore(i.e 10000-000_A.x_t).  We use a generic part rev convention A-Z; however with one exception, our first revision is a dash(-) and in this case we wouldn't have any revision attached to the part number(i.e. 10000-000.x_t)

So the macro would need to include this if else functionality:

If Rev = -

     Do not add revision after part number

If Rev = A through Z

     add _A.x_t or whatever the rev would be after the part number

For example

Part number 10000-000 with Rev - would be 10000-000.x_t

Part number 10000-000 with Rev A would be 10000-000_A.x_t

I'm not very well versed in making macros but here is how the flow would go if an assembly file is already open in SW:

  1. 10000-000.sldasm ~ Has parts 10000-000-01.sldprt and 10000-000-02.sldprt
  2. Save each part of open assembly as parasolid(x_t)
  3. Add underscore with revision(rev) if rev is A-Z; however if Rev = - ,do not add underscore or revision after part number
  4. If part has several configurations, prompt user to choose which configuration should be used for Save As
  5. Output to same file location as parasolid, for example Rev A, 10000-000-01_A.x_t

We currently have our revision saved in our properties as shown on the attached image.

If anyone has a macro this would be greatly appreciated!!!

Josh