Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
abbrechen
Suchergebnisse werden angezeigt für 
Anzeigen  nur  | Stattdessen suchen nach 
Meintest du: 

Parameter Formula Question

7 ANTWORTEN 7
GELÖST
Antworten
Nachricht 1 von 8
JJRevitUser
2501 Aufrufe, 7 Antworten

Parameter Formula Question

I tried looking for this topic & although I am sure it is around somewhere I was not able to find it so I apologize.

 

So I have all of my family (Scheduled) Parameters set as well as the typical LxWxH Params I need. I was trying to set a parameter formula if(3 = 1/32", 2 = 1/32", Stay). I am unaware if this works but I would like help with my formula or any information that could explain these scenarios for me. As it is right now, Revit is saying "Inconsistent Units" but I cannot null it out or figure it out, they are all length parameters in inches & I have tried /1 or *1 but get nothing. I have successfully used "if" formulas before but never for a numerical value, only text params. 

 

In this formula are three Length parameters, 2, 3, & Stay. 2 is the param that this formula is for, 3 does not have a formula, & Stay's formula is 2 Parameter.

 

If any, is there a better way to accomplish this or am I just using parameter formulas dead wrong?

 

(Pro Question: Under an if(x,x,x) formula what are your suggestions on the take if(Param, True, Do nothing). Is it possible? I find myself still trying this every now and then & even my latest formula in this post kind of tries to play on this & I am not even sure it works. My thoughts were to have "Do nothing" be another parameter that pulls that current parameter's value if the True wasn't.)

7 ANTWORTEN 7
Nachricht 2 von 8
Anonymous
als Antwort auf: JJRevitUser

If your parameters are just named with a number eg. 3 this will cause issues as Revit will not see it as a parameter name but as a number and 3 can never = 1 if your parameter name was three instead you could use your formula. Parameters should always be alphanumeric, without spaces or operation characters such as =, +,-,*,/. I always use CamelCase for my parameter names and never use numbers.

Nachricht 3 von 8
JJRevitUser
als Antwort auf: JJRevitUser

I got if([3] = 1/32", 1/32", 2") to work according to my intentions as posted although I am unaware of the implications of my 'false' value where 2" was the default constraint for my geometry so as of right now I believe this works. 

  • The previous problem was caused by [3] being automatically converted by revit to 3" causing the error message which brings up I have never known that you need/could use [] to mark (parameters/numbered params?) because it is not on any of the sites I have bookmarked for quick formula references... Kind of annoying. The formula reference lists seem very generic & not well explained.
  • My Param 'Stay' Causes "Circular Chain of Formulas" so that was a no go, but I changed it to a default value for my geometry & it seems to work.
  • I really wish Revit had an 'if' that didn't require a specific false statement, like I have tried. 'if(param, true, null [where null just keeps whatever the parameter value is/was]). <- If there is a way to accomplish this I would very much love to know.

I believe I fixed my formula issue but if there is anybody out there with extensive knowledge on formulas or know where I could find more detailed information please still let me know. I understand the basics but I keep getting hung up on little nuances that I may or may not be aware of. Please don't link a super generic formula syntax page I have 10 or so saved for reference, unless it seems to have a ridiculous amount of information then please do.

Nachricht 4 von 8
ToanDN
als Antwort auf: JJRevitUser
Nachricht 5 von 8
JJRevitUser
als Antwort auf: Anonymous

Thank you for replying! I actually replied to my post apparently at the same time & did not see yours until after.

 

Now that's what I am talking about! That kind of detailed info that I can't seem to find anywhere else, I did not know that generically numbering named parameters was a poor decision, although hindsight... I can not seem to find what I would call a "Best practice" guide for family/content creation. I also found out about the operators in names was an issue a few days ago because I had a parameter that was 'Prefix - Param' named, which was also sorted out but I wasted time learning the hard way still...

 

Lastly, camelcase? Naming params with 2 uppercase letters & no spaces?

 

Thanks so far!

Nachricht 6 von 8
bin
Advisor
als Antwort auf: JJRevitUser

You need to tell Revit what that is, eg [2] is a parameter name, 2 is a number or length, etc. and “2” should be a text.  I when I was lazy I just name my parameters W1,W2(width),D1,D2(depth) something like that. 

Nachricht 7 von 8
bin
Advisor
als Antwort auf: JJRevitUser

your parameter for 2 should be if ([3]=x, y, z), not if([3]=x, [2]=y, z). And I don’t think you can do if([3]=x, y, [2]). You can either leave them blank and manually type in, set the z a fixed figure or formula that does not link back to [2], or do something like if([3]<a,b,if([3]<c,d,if([3]<e,f,g))).  

Nachricht 8 von 8
bin
Advisor
als Antwort auf: JJRevitUser

try this:

create a new parameter lets say 2x and link it to the geometry replacing the [2] parameter. 

Then add formula if([3]=x,y,[2]) to 2x. 

 

Still in bed, let me know whether it works or not. :leicht_lächelndes_Gesicht:

Sie finden nicht, was Sie suchen? Fragen Sie die Community oder teilen Sie Ihr Wissen mit anderen.

In Foren veröffentlichen  

Autodesk Design & Make Report