Variables and Simple Formulas

Variables and Simple Formulas

Anonymous
Not applicable
2,173 Views
10 Replies
Message 1 of 11

Variables and Simple Formulas

Anonymous
Not applicable

Hello! I'm new to dynamic blocks and wanted to get some advice.

 

I'd like to set two variables within dynamic block (WIC and Frame Thickness) that a drafter can enter and have automatically calculated in the formulas displayed without having to open the block editor.

 

It doesn't seem like it should be too difficult, and the formulas are elementary. Also, note that some formulas are within dimension text strings.

 

Example:

    Input: WIC = 36

    Formula: "20 x (WIC + 1/8) ramp notch in floor panel"

    Output:  "20 x 36 1/8 ramp notch in floor panel"

 

Thanks in advance!

0 Likes
2,174 Views
10 Replies
Replies (10)
Message 2 of 11

Anonymous
Not applicable

Here is the block...

0 Likes
Message 3 of 11

Libbya
Mentor
Mentor

For formulas, easiest is probably to use user parameters and define whatever formula you like.  

0 Likes
Message 4 of 11

Anonymous
Not applicable

I know how to add a formula. I just don't understand how to reference a variable in a formula.

 

If I define an attribute named "WIC", how do I reference that within the formula? 

0 Likes
Message 5 of 11

Anonymous
Not applicable

Within your formula text box, you would need to just enter another field linking to the object's value (WIC's value).

Please see pictureHelp.png

Message 6 of 11

Libbya
Mentor
Mentor

Did you actually try that?  I have not found that formula fields referencing values housed by attributes will actually update even if the 'display value for block reference' is checked.  I have found that formula fields referencing values housed by user parameters will update, though, which is why I recommended them.  Use the blockplaceholder fields for the user parameter values within the formula and it works a treat.  Edit the user parameter value in properties.  

0 Likes
Message 7 of 11

Anonymous
Not applicable

Yeah, it seems that solution requires you to manually update it - which is silly.

 

I'll look into what you said and get back to you!

0 Likes
Message 8 of 11

Anonymous
Not applicable

I've created user parameters, but can't figure out how to reference them in the formula field. I've messed with this for the past few hours and I've gotten no where. Can anyone give me a step-by-step? I feel like this should be extremely easy, but I can't figure it out.

Message 9 of 11

Anonymous
Not applicable

Also note that I don't actually want the dimensions of the drawing to change - just the text within the block.

0 Likes
Message 10 of 11

Libbya
Mentor
Mentor

Here's a simple test block screencast that shows how to add a user parameter and place it in a formula field along with a linear parameter value.

0 Likes
Message 11 of 11

MMcCall402
Mentor
Mentor

I introduce the user input into a dynamic block thru User Parameters and display the output thru Attributes.  The Attributes have text and fields with formulas for the numeric values as their default attributes. The formulas in the fields use fields to gather values from things like user parameters, dynamic parameters and drawing objects.

Mark Mccall 
CAD Mangler


EESignature


VHB - Vanasse Hangen Brustlin, Inc.


Linkedin

0 Likes