Revit Architecture Forum
Welcome to Autodesk’s Revit Architecture Forums. Share your knowledge, ask questions, and explore popular Revit Architecture topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

An IF statement for an angle?

3 REPLIES 3
Reply
Message 1 of 4
omikhailik
1180 Views, 3 Replies

An IF statement for an angle?

Hi!

 

I have a group with a nested family and a reference line inside it, and another reference line shooting off at 90° from the group. There is an angle dimension between the two ref lines and it is tied to an instance parameter I simply called ANGLE. When I change the value of the angle, the object simply rotates about the appropriate axis. All is working okay, BUT: what I need is to put Limits on the angle. It can't go below 1° or above 179°. For example. if the user typed in 0, or 0.5, or 179.5, it should put the angle back at 90° or something like that. I'm trying to do this via a formula in the Family Types dialog. 

 

The trouble is that for the life of me I can't find/figure out how to write a formula that references this angle. I mean something like IF (angle<1, ... No matter how many different ways I tried to rephrase the formula, it always returns an error saying 'The following is not a valid family parameter: angle'. I know that 'length' is a valid parameter as I've used it in formulas prior, so why wouldn't 'angle' be?  

 

Any idea how to write this kind of formula? 

 

screenshot001.JPG

 

Many thanks,

0leg

3 REPLIES 3
Message 2 of 4
CoreyDaun
in reply to: omikhailik

When you reference a Parameter in a formula, you have to match the name EXACTLY, including case. So if your Parameter is named "ANGLE", then referencing "angle" in a formula will yield that error.

 

In order to create a "check" like that, you will need two parameters; one that controls the angle constraint (which will have the formula) and one in which the user inputs the desired angle value. The formula would be:

 

if( or( UserAngle < 1°, UserAngle > 179°), 90°, UserAngle )

 

 

Edit: And welcome to the Discussion Groups, by the way!

Corey D.                                                                                                                  ADSK_Logo_EE_2013.png    AutoCAD 2014 User  Revit 2014 User
──────────────────────────────────────────────────────────────────────
⁞|⁞ Please use Mark Solutions!.Accept as Solution and Give Kudos!Give Kudos as appropriate to further enhance these forums. Thank you!
Message 3 of 4
omikhailik
in reply to: CoreyDaun

Thanks CADastrophe, I'll give it a shot.

Message 4 of 4
omikhailik
in reply to: omikhailik

False alarm! I ended up getting the rotation to work such that it doesn't merit limits. I guess it kind of sweeps the issue under the carpet instead of solving it, but alas in interests of meeting a deadline for the time being that will have to do. Thanks a lot for advice anyway :]

 

Cheers!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report


Autodesk Design & Make Report