Interesting Macro ......

Discussion in 'SolidWorks' started by Todd Brake, Nov 2, 2004.

  1. Todd Brake

    Todd Brake Guest

    Hi:

    The company that I work for uses the name of the base solid in a part
    to help identify that component in an assembly.

    Example: You rename "extrude1" to "BRACKET, MOUNTING, ROTARY SHUTTER"
    .. Then when move your mouse over the component in the assembly, the
    popup shows what the part is.

    This is helpful when working concurrently, and you many not recognize
    the part numbers....

    Anyway, the only way to do this is to copy/paste the text from the
    Description Custom Prop or to retype it.

    Has anyone out there written a macro that can simply take the text
    from the custom prop and write it into the name of the first feature?

    I don't really know anything about macros but this seemed like an easy
    one. Any help appreciated.

    Thanks,

    Todd
     
    Todd Brake, Nov 2, 2004
    #1
  2. I just use the "Show Component Description" option checked on to display the
    name of a part in my FM. Works great for us, does the same thing and no
    macro required.

    Richard
     
    Richard Charney, Nov 2, 2004
    #2
  3. It would be quite easy but still an hour or so of work. There are examples
    of each of these out there.

    to get the description

    PartDescription = part.getcustominfo ("" ,"Description")

    for the feature name.

    Feat.Name = PartDescription

    there is more to it check out the examples on traversing the feature tree
    and depending on the consistency of your group you may need to do something
    a little more complex when getting the custom info.

    First off I presume the custom info is per model not configuration specific.
    I don't think you have the option of having a different name per config, Do
    you?

    Second if within your company there isn't extreme consistency on the caps in
    the field title (eg some are "DESCRIPTION" and others "Description" and
    others "description" you may have to handle this because the properties are
    case sensitive.

    Corey
     
    Corey Scheich, Nov 2, 2004
    #3
  4. Todd Brake

    Todd Brake Guest

    Richard:

    What you're talking about is different. That shows the description
    next to the part in the feature manager. Useful, but not what I mean.

    What I'm talking about occurs in the gfx window -- hover your mouse
    over a component and it's description pops up in the gfx window.

    Todd
     
    Todd Brake, Nov 5, 2004
    #4
  5. Todd Brake

    Todd Brake Guest

    Thanks for the info Corey.

    Actually, we are using configuration-based props. I wish I had some
    time to figure this out but I don't -- we're in full swing on a new
    product and blah blah. I'll forward this to one of our software guys,
    maybe he can figure out how to make it work.

    Todd
     
    Todd Brake, Nov 5, 2004
    #5
  6. for reference this would be to get the "Default" config's description

    PartDescription = part.getcustominfo ("Default" ,"Description")
     
    Corey Scheich, Nov 8, 2004
    #6
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.