Results 1 to 9 of 9

Thread: Dynamic Blocks and Calculations

  1. #1
    100 Club
    Join Date
    2009-04
    Location
    Fort Wayne, IN
    Posts
    152
    Login to Give a bone
    0

    Default Dynamic Blocks and Calculations

    I am trying to have a line drawn at a length that is to be calculated from other components of the dynamic block.

    That is, the length of Line A = (Value of Action Parameter B)^2*(Attribute A - Attribute B)/(Value of Action Parameter B/.

    From what I could find, I should be able to go into Parameters Manager and type into the Expressions column the formula. However, I cannot get C3D to recognize the Action Parameters or Attribute as valid variables in an expression. I can add User Parameters and reference those, but not those I need. I get an error "A dependent expression cannot be evaluated. The syntax is incorrect or a variable is not defined."

    See the image. Any help?
    Dynamic Block.JPG

  2. #2
    All AUGI, all the time
    Join Date
    2009-01
    Location
    B5
    Posts
    544
    Login to Give a bone
    0

    Default Re: Dynamic Blocks and Calculations

    I realize this is a simpleton response but could it be that the Slopeout (and In) needs to be capitalized like it is in the Attrib list?

  3. #3
    100 Club
    Join Date
    2009-04
    Location
    Fort Wayne, IN
    Posts
    152
    Login to Give a bone
    0

    Default Re: Dynamic Blocks and Calculations

    Nope, Charles.

    That doesn't make a difference. What the Help says is to select the attribute and actually copy it and paste it into the expression. Doesn't matter. It still doesn't work.

    Thanks anyway. Anyone else have a thought?

  4. #4
    I could stop if I wanted to
    Join Date
    2008-05
    Location
    Yardley, PA
    Posts
    305
    Login to Give a bone
    0

    Default Re: Dynamic Blocks and Calculations

    My guesses.... Take this with a grain of salt as it has been a while since I used formulas in AutoCAD.

    That your taking a number and trying to multiply a percent?

    You have a space or something in a parameter somewhere that your not seeing?

    You need a few more (). Like((xdistance1)^2)*((...

    Do you need an = sign at the front?

    Did you pick the parameters or did you have to type them in? I believe you have to pick them in AutoCAD...

  5. #5
    100 Club heinsite's Avatar
    Join Date
    2005-11
    Location
    Kona, Hawaii
    Posts
    138
    Login to Give a bone
    0

    Default Re: Dynamic Blocks and Calculations

    Have you tried breaking the formula down into smaller, user parameters, and substituting those into this formula? It doesn't seem like it would be necessary but it might help you isolate which part is triggering the Parameter Error msg.

    Dave.

  6. #6
    100 Club heinsite's Avatar
    Join Date
    2005-11
    Location
    Kona, Hawaii
    Posts
    138
    Login to Give a bone
    0

    Default Re: Dynamic Blocks and Calculations

    I think I may finally have an answer for this. Double click that Expression. Then right-click it and open the Expressions window. What you'll see is a listing of expressions AutoCAD will accept. Raising a number to a power using the carat (4^2) isn't supported. You need to use something like this: pow(Expr1;Expr2).

    This may get you rid of the Parameter Error dialog.

    Good luck!
    Dave.

    expressions.png

  7. #7
    100 Club
    Join Date
    2009-04
    Location
    Fort Wayne, IN
    Posts
    152
    Login to Give a bone
    0

    Default Re: Dynamic Blocks and Calculations

    Dave,

    For a second, I thought you had something. But, then I realized that I had tried to break down the expression to debug it when I started, and it won't even let me do a single parameter reference. In addition, the caret does seem to work (at least for squared) because I use it in expressions within this very block as a work around. See attached.

    Just out of curiosity, is this a problem that you have been able to duplicate? That is, if you have an action parameter, can you create a dimensional constraint parameter that includes the action parameter as a variable? Or does it choke for you too?

    Thanks
    Scott


    DependentExp.JPG

  8. #8
    100 Club heinsite's Avatar
    Join Date
    2005-11
    Location
    Kona, Hawaii
    Posts
    138
    Login to Give a bone
    0

    Default Re: Dynamic Blocks and Calculations

    Scott,

    First, I confirmed for myself that an expression like Dist2=Dist1^5 will work in a Dimensional constraint. So that's not the issue. But I cannot make an Action parameter work with a Dimensional constraint either. AutoCAD doesn't seem to be able to pass that information to the constraint expression. You may have to create a User expression for that information. I was able to reproduce what you saw, and it's tricky getting out of that error dialog once you create that kind of a mess!

    Sorry I can't help much more than this.
    Dave.

  9. #9
    Member
    Join Date
    2009-05
    Posts
    32
    Login to Give a bone
    0

    Default Re: Dynamic Blocks and Calculations

    My theory is that AutoCAD needs the values of the expression before they can be evaluated, meaning, the way you are trying to do it now, everything needs to happen simultaneously. The error seems to say that the variable in the expression you are trying to create do not exist yet, because they are both tied to one another, i.e. you cannot create a chicken and an egg at the same time.

    -I could be totally wrong, but that's my $0.02.

Similar Threads

  1. Calculations on command line or dynamic input box.
    By autocad.wishlist1734 in forum AutoCAD Wish List
    Replies: 4
    Last Post: 2015-11-12, 08:41 PM
  2. Dynamic Blocks - Creating dynamic bolt blocks
    By jake1889 in forum Dynamic Blocks - Technical
    Replies: 3
    Last Post: 2014-08-08, 12:56 PM
  3. GD12-3: Go Dynamic: How to Create Dynamic Blocks in AutoCAD 2006
    By Autodesk University in forum General Design
    Replies: 0
    Last Post: 2013-04-17, 04:17 AM
  4. Replies: 0
    Last Post: 2011-11-23, 03:50 PM
  5. Replies: 6
    Last Post: 2007-01-02, 08:02 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •