Toggle between custom length parameter and length type parameter, ease swap

Toggle between custom length parameter and length type parameter, ease swap

Anonymous
Not applicable
2,042 Views
4 Replies
Message 1 of 5

Toggle between custom length parameter and length type parameter, ease swap

Anonymous
Not applicable

So I've got one parameter whose length changes depending on the type, so it is a type parameter. "Type Length"

 

I've got another parameter that the user can enter a custom length with. "Custom Length"

 

Then I have a yes/no type parameter "Is Custom" set to no on all types except the custom length type

 

 

Last: there is a final length parameter that reads the type-based length parameter when the Yes/No is set to No. It reads the custom length when the Yes/No is set to Yes. "Final Length"

formula:

 

if(Is Custom, Custom Length, Type Length)

 

This works fine, however, if a user is drawing with the type based lengths for awhile, then decides to change one family instance to a custom length, the family file adjusts to the default of the Custom Length parameter. In many cases, this is an extreme change and can break the system.

 

 

Is there a way to have Custom Length follow along with the current Type Length until the user decides to have a custom length? That way, when they do swap, there is no immediate change?

0 Likes
Accepted solutions (2)
2,043 Views
4 Replies
Replies (4)
Message 2 of 5

fabiosato
Mentor
Mentor

Hello,

 

Instance parameters uses the default value you set on the family, or the value you input in the parameter before placing the family, and will remember this value for the following placements.

What I suggest is to set the instance value equals to the type value.

Fábio Sato
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature

0 Likes
Message 3 of 5

Anonymous
Not applicable

So the end goal would be an instance parameter that the user can massage, but the instance parameter defaults to the last value active from the type parameter. The problem lies in the fact that I can't provide a default value that is guaranteed to be the same, or roughly similar to the values generated during layout with a type parameter.

 

The swap from type length to default custom length can be incredibly jarring to the system.

 

The above solution would cause the instance parameter to be formula driven, ergo locked out. Less importantly, it would cause a circular reference. Though we could probably get around that.

 

 

For now, I have the custom parameter sitting just below the type parameter so that the user can change the custom parameter to match the type prior to swapping the family type. This works, but seems like it could be more smooth.

 

 

0 Likes
Message 4 of 5

robert.klempau
Advisor
Advisor
Accepted solution

Hello @Anonymous,

 

I made a dynamo script for you that can update the instance parameter "cutsom length" with the 'type length' value for all instances in your project where the 'is custom' parameter is set to NO.

 

I think with this Dynamo script you can manage it.

if you have Revit 2017.1 you can use the Dynamo Player and run the script every time you need it.

 

dynamo script update instance parameter with type parameter.png

 

see video below

I attached the script and sample project to this post.

 

 

 

If my post answers your question, please click the "Accept as Solution" button. This helps everyone find answers more quickly!

Kind regards,
Robert Klempau
Senior Consultant AEC
Cadac Group AEC BV

Message 5 of 5

Anonymous
Not applicable
Accepted solution

rklempau,

You are a kind person. And I believe many people will see this post and put it to good use.

 

As an ADN junkie myself, I considered going a similar route but with C# and an Idling event. And Idling events are very much a "last resort" way to go. The reason I considered this route was because the length parameter is on a piece of duct. When the user turns that parameter from type to custom, it causes an extreme change in the dimensions of that fitting and can cause the whole system to misalign at the time of swap.

 

So retroactive tools can still be used, because prior to swapping to a custom type, you can quickly write from the type to the custom parameter with tools like this, and then safely change.

 

I was hoping that there would be a way to get out-of-the-box Revit to do this as opposed to another layer of customization. I've built a lot of that already, which means more support for users (I think you're likely familiar with this dilemma). Does that make sense? But it looks like this is not the case.

 

I will give this topic a little while to sit, and if there are no suggestions brought up regarding making vanilla Revit do it, I will mark yours as the best response. Simply because I think most users that come across this thread will find your generous work to be a solid fix. I hope they give you a kudos while they're at it.