rebuild/macro question

Discussion in 'SolidWorks' started by Brian, May 7, 2005.

  1. Brian

    Brian Guest

    I have written a macro that queries a couple of sketches within an assembly
    for coordinates and a couple angles. The equations folder has a
    degenerating dimension ( d1@[email protected]). After getting the
    initial information I force regen the part from within the macro and loop
    through many times.
    I tried driving the degenerative equation by smaller increments ( ie
    ..001 ) to get a higher resolution result set, but at about the 289th forced
    regen, values quit changing. Editing the equations results in an incorrect
    syntax message ( although syntax is in fact correct ). The only way to
    recover the useability of the equations is save and exit sw, then restart
    sw.
    I have worked around the issue by breaking the area up into smaller
    segments and working each individually, but its a pain to do so.
    My question is this. Is it something within SWx limiting the number of
    forced regens or is it perhaps a limitation of VBA that I am running into?

    --
    Brian Hokanson
    Starting Line Products
    743 Iona Road
    Idaho Falls,ID 83401
    208-529-0244
    fx 529-9000
     
    Brian, May 7, 2005
    #1
  2. Brian

    TOP Guest

    It would seem that you are constantly making d1 smaller. At some point
    you have to have a condition that will stop the iteration when it gets
    too small. SW has a limit as to how small a dimension can be. SW also
    has limits regarding automatic relation tolerances.

    See ship in a bottle for how to control dimensions to keep them from
    getting too small, too large or within a certain range.
     
    TOP, May 8, 2005
    #2
  3. Brian

    Brian Guest

    Its not that d1 becomes invalid at some point. With the step distance
    set to .01" it sucessfully traverses the full range of motion in 250 steps.
    I can also traverse full distance at .001" steps provided that I do it in
    smaller sessions that do not exceed 280ish rebuilds.

    From + 2.5" to 0.0" can be done in one session of 250 steps with a step
    distance of .01" sucessfully. But to do .001" steps, I have to traverse
    from 2.5" to 2.25" by .001" increments. Exit SW completely. Do 2.25" to
    2", exit SW. ect.

    Somewhere there is a limit that I am running into. Maybe a limitation
    of a character buffer or something. Just not sure if its a SW one or VBA
    one.
     
    Brian, May 8, 2005
    #3
  4. Brian

    Brian Guest

    SP3 to sw2005 seems to have fixed the issue although I saw nothing in
    the fixed sprs concerning macro/equation funtionality.
     
    Brian, May 10, 2005
    #4
  5. Brian

    Aussie Guest

    Wouldn't know if this was a SW limitation (would suprise me - most of my
    models would get rebuild heaps more that 289 times before I am done) or a
    VBA limitation (how could it be?)... BUT...

    If you are running a macro anyway, why don't you just look for the
    dimensions with name "d1@sketch1" and increment it as a part of your loop?

    Can I ask what you are trying to achieve?
     
    Aussie, May 11, 2005
    #5
  6. Brian

    Brian Guest

    Not a programmer and could not figure out how to increment from within
    Was doing stuff with SWx for which it was not intended, sorry I can't
    elaborate.
    I have re-used the macro several times and it works fine on 2005 sp3 (
    work pc). Originally I wrote it and tried to used it on my home PC (2005
    sp2). I only have the issue at home. This weekend I'll apply sp3 at home
    and see if that fixes it there also.
     
    Brian, May 11, 2005
    #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.