Macro to search all parts in assy for a sketch and convert the entities to a new sketch

Discussion in 'SolidWorks' started by Rich, Jan 20, 2006.

  1. Rich

    Rich Guest

    Hi Guys

    I am looking for a way of searching all parts in an assembly for a sketch
    named 'PanelCutout' and converting the entities in that sketch to a new
    sketch (One new sketch containing offset or converted entities from all of
    the parts) Has anyone ever done anything like this? Or care to point me in
    the write direction to roll my own. (I looked at the help but couldn't see
    where to start :-(

    Its to get around the lack of smart component features in a sub assembly
    problem. I have a pcb with components that have to fit throught a panel. I
    have put a sketch on each of the components for the cutout req, but it is
    time consuming to select each one and convert it manually.

    All help greatfully received

    Rich
     
    Rich, Jan 20, 2006
    #1
  2. Rich

    CS Guest

    In help look up Traverse in the Index select assemblies. There are 3
    or 4 examples. With probably just one if then statement and a few
    lines of code you could make it do what you are looking for.

    Corey
     
    CS, Jan 20, 2006
    #2
  3. Rich

    TOP Guest

    As Corey mentioned, this is a job for the API. And as he mentioned
    there are several example programs that will help you find the sketch.
    Creating a converted copy of the sketch will be a little more tricky
    and requires more research to find the necessary bits and pieces to do
    what you want. If you aren't an API whiz I would suggest getting help.
     
    TOP, Jan 21, 2006
    #3
  4. Thanks to all who replied. I will look at all suggestions later.
    I have never looked at the solidworks API but have done similar before so I
    might give it a whirl later. I'll post back if I ever get it working!

    Take Care

    Rich
     
    Rich Thompson, Jan 21, 2006
    #4
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.