API Unavailable dimension

Discussion in 'SolidWorks' started by Wayne Tiffany, Jul 20, 2004.

  1. I am working on this program that is part of a large in-house program here.
    I bring up a form that looks at current config specific properties and fills
    the form with the current values. If the user changes configs, I don't
    totally update the form in order that those other values can be applied to
    the then current config. However, there is one of the fields that deals
    with the length of the part. If the user has grabbed the length value by
    highlighting the dimension and clicking the button to grab that value, it's
    pasted into the form. On a config change, that value stays there.

    But, if the user clicks the button that says he wants the length Property,
    such as "D1@Extrude1@@", then on a config change I
    search that new config to see if that same dimension exists in the new
    config. If so, update the property string so it has the correct config &
    file name in it. This keeps the user from having to reselect that dimension
    each time.

    My problem is that I want to be able to distinguish whether or not that
    dimension is even really available in the new config. I have tried the
    Visible property, but it finds the dim even if the associated feature is
    suppressed, and even if the associated sketch is also suppressed. I have
    searched on visible, active , suppressed, etc to no avail. I wasted about 2
    hours last night looking, and I'm not a happy camper at this time. Any
    thoughts?

    WT
     
    Wayne Tiffany, Jul 20, 2004
    #1
  2. After cooling off on this a bit, I think what I need to do is find the
    parent sketch and/or feature of the dimension and check for suppression
    there. More thoughts?

    WT
     
    Wayne Tiffany, Jul 20, 2004
    #2
  3. Ok I am throwing unfounded ideas at you, because I don't have the time to
    create an example.

    First if you select the dimension by name in a config that it is not used in
    will it ever return a true on the selection.

    Second (You aren't going to like this because it may be alot of work)
    You may have to get the children of the dimension (start with the sketch
    since you know the name of that.) check the supression state of the sketch.
    If it is supressed go no further the dimension is not used. If it isn't
    supressed get the children of the sketch. If all of them are supressed (it
    must be all of them because if shared sketches.) then the dimension isn't
    used. If any of them are resolved the dim is definitely not used. Actually
    I don't think it will be all that hard to write. But I am sure you will let
    me know.

    Corey
     
    Corey Scheich, Jul 20, 2004
    #3
  4. Wayne Tiffany

    rocheey Guest

    on a config change I search that new config to see if that same
    Am I missing something? When one adds a dimension to a configuration, is not
    that dimension (with possibly different values) now part of *every* configuration?
     
    rocheey, Jul 20, 2004
    #4
  5. Ding, ding, ding - you win the prize, and hopefully it didn't take you as
    long to realize it as it did me.

    I started out with the search routine because of allowing the user to also
    change files, not just configs, but then later decided it was too risky to
    assume they would want the same dimension captured. Better to make them
    pick it again to be sure. So then I wanted to see if the dimension was
    active, that is not part of a suppressed feature. If part of something
    suppressed, I clear the form field, thereby making them select another one.
    As it is, the Length field can be tied to a dimension on a suppressed
    feature.

    That's where this message was heading.

    WT

    configuration?
     
    Wayne Tiffany, Jul 20, 2004
    #5
  6. Wayne Tiffany

    rocheey Guest

    I see what you're getting at... but dimensions for suppressed features
    *are* available to the user, its just that modifying the dimension
    will show no apparent change until the dimensions owning feature is
    unsuppressed.

    Im not sure which way you parsed down thru the code to get the dims,
    but if you did it by recursing the feature tree, you can just check to
    see if the feature is suppressed, and add a flag that any of the dims
    associated with this feature are also suppressed...possibly show the
    Dimension to the user as "greyed out' or something.. "Lock" the
    textbox and change the background color...
     
    rocheey, Jul 22, 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.