VARIABLE/FUNCTION - Use current valor?

dynamiccomponents

#1

Hello guys,

Is there a way to tell a dynamic component to use a current valor? For instance, lets imagine that we make a condition where in one case its the result of an equation, in the other case I would like the to use the X position in the world.

So, in other words;

=IF(Test = 1 , equation , CURRENT X)

Tell me if you have any equation or If Im being unclear.

Thank for the help!


#2

I am not sure what you want specifically, but you could reate a custom attribute called ‘Return_X’ say.
In the input box you could add =CURRENT(“X”)*2.54

Then it could go something like so:

=IF(Test=1,(equation,Return_X)

Maybe if you share the model or provide images then somebody could take a look at it further.


#3

Hello and thanks for the help.

Wouldnt that be a circular dependency? It is related to a project Im working on but I dont have an exemple as I dont think the function exist.

Let me try to rephrase what I meant. Lets say I have an equation that place a component on the X axis, but I also want to be able to use its current location in a condition. But the thing is, the current location is a variable and cannot be solved by using a static number or an equation. I actually need to be able to pull the current X location from the world. Because I think if I use your suggestion, it will constantly pull the updated location and never actually use the actual location.

Will need to test it though.


#4

I am still not entirely sure what you are after, could you share a model with your work on the component so far?

See below for a basic DC which uses a custom attribute to return the current world position in Z.

I use it to provide height from finish floor level on projects.


#5

Thats just a circular reference, and my =CURRENT(“X”) return zero.

Alternatively, as another entirely different problem. I tried to check if the parent module was there(the blue square, should return an error since the parent component was exploded away), hoping that when I explode the whole module once(there are about 4 layers of components) it would create an error in the slot and by default set it to zero. But it doesnt seem to work that way it looks like it keeps the result of the equation even though the parent object is no longer part of the dynamic component…

In other words, any ways to check if a component is there or not?

What Im trying to achieve with that whole “current” and “checking if a component is still there” is if someone decide to explode my dynamic component and change something in it using the options already available, it send it back to a faulty X position because it used copies in its equation and said copies are no longer part of it.

Thanks for the help


#6

Ok then well all the best with that.


#7

I support Ashley on this, first as you using metric, current should be followed by *2.54 as previously advised.
For a circular reference an error will appear.
A model helps, we can only guess

My guess is that you require a redraw of the example for it to update the DC.

This is the same for children to update a parent after say a FaceArea() calculation. Sometimes there is no automatic redraw, so scaling can get out of sync with the size values, Redraw corrects this. Depending on the scope of your project and how you share it, you may consider a shortcut or some ruby scripts to build on the shortfalls of your DC creations, like Tig’s “Redraw all” one liner linked to a button