View Full Version : Formula Assitance
jsteinhauer
2010-04-12, 04:28 PM
Hi all,
I am trying to create a tag parameter to read the height of counter tops/work surfaces. Not a big deal if they are always a number. The issue I'm having is when the work surface is adjustable "ADJ". I thought I could write a formula with a yes/no controller, from an integer to text, but that doesn't seem possible. Below is what I tried to do but I failed. Could anyone help?
Height = Dim
Work Surface Height = Height/1' * 12
ADJ = text
ADJ Control = Yes/No
Work Surface Height Tag = Not(ADJ Control, Work Surface Height, ADJ)
Thank you in advance,
Jeff S.
Scott Womack
2010-04-12, 04:34 PM
Jeff,
Unfortunately, you are "trying to cross the streams" at the wrong time. When creating parameters, you have to "declare" (programing lingo) what type they are. From your list, Work Surface Height is defined as a length parameter. When you made the parameter Work Surface Height Tag, what did you select it to be? You can't feed text information to a Length parameter, and visa versa.
jsteinhauer
2010-04-12, 04:35 PM
Jeff,
Unfortunately, you are "trying to cross the streams" at the wrong time. When creating parameters, you have to "declare" (programing lingo) what type they are. From your list, Work Surface Height is defined as a length parameter. When you made the parameter Work Surface Height Tag, what did you select it to be? You can't feed text information to a Length parameter, and visa versa.
Work Surface Height Tag is an integer parameter. I want to feed an integer parameter into a text parameter. Sorry if that wasn't clear in my previous post.
Scott Womack
2010-04-12, 04:43 PM
That is just it. An Integer is a different kind data than a piece of text. You cannot directly feed one type of data into some other variable with a different data type, period. What you'll have to do is add another series of if statements, where you are testing the integer height of the countertop, and then setting a text variable equal to it. Like:
If(Integer=30,TEXT="30",if(Integer=36,TEXT="36",ADJ)
Something like that. Where your testing the intervalue via a series of if statments, and returning a text value whenever it evaluates to true. In this fashion, you are always returning a text value to feed to the tag value.
Good Luck!!
jsteinhauer
2010-04-12, 04:51 PM
That is just it. An Integer is a different kind data than a piece of text. You cannot directly feed one type of data into some other variable with a different data type, period. What you'll have to do is add another series of if statements, where you are testing the integer height of the countertop, and then setting a text variable equal to it. Like:
If(Integer=30,TEXT="30",if(Integer=36,TEXT="36",ADJ)
Something like that. Where your testing the intervalue via a series of if statments, and returning a text value whenever it evaluates to true. In this fashion, you are always returning a text value to feed to the tag value.
Good Luck!!
Thank you Scott,
So, the work surface will be either 30 or 36 or adj. I'll give it a try and see if it works out. The issue I see is if someone sets the work surface at 30.5 or something not 30 or 36 but a correct value.
Jeff S.
jsteinhauer
2010-04-12, 05:14 PM
Is it possible for a tag to read a yes/no parameter from a family, then display information based on that?
Thanks,
Jeff S.
Scott Womack
2010-04-13, 10:50 AM
No, You'll actually have to have all of this calculation within the family, feed into a shared parameter that the tag is set to read.
jsteinhauer
2010-04-13, 02:39 PM
No, You'll actually have to have all of this calculation within the family, feed into a shared parameter that the tag is set to read.
I was goofing around with this yesterday afternoon, and I decided to make a few types of the tag. One to read the integer value, and another to just display text 'ADJ'. Does everyone know that you can predefine tag values, and also place a prefix & suffix? I found this out yesterday, and it rocks. Now in a legend view, the tag displays information similar to what you would see in a project, not the parameter name. One other thing I noticed is that if a parameter is 'Type' based you can drive the value of a formula through a tag. This is not the case if it is 'instance' based parameters calculated by a formula.
Cheers,
Jeff S.
Powered by vBulletin® Version 4.2.5 Copyright © 2024 vBulletin Solutions Inc. All rights reserved.