Dynamic user input

Dynamic user input

Anonymous
Not applicable
2,059 Views
10 Replies
Message 1 of 11

Dynamic user input

Anonymous
Not applicable

Hi All, 

 

I'm creating a utility for the end-user. I'm trying to re-create some of the workflows that I used in AutoCAD using VB, so the user can dynamically input some parameter through the methods:

 

Utility.InitializeUserInput

Utility.GetString

 

In Revit, is it possible to create this workflow? I created other routines using the static Windows.Form with success, but now I'm looking for a User Interface that communicates with the user "on the march".

 

For example, I create a rebar according to some parameters. When created, I want to put the next rebar using the position of the last bar and some of their parameters.

 

Any tip or advice will be very appreciated.

 

Cheers!

0 Likes
2,060 Views
10 Replies
Replies (10)
Message 2 of 11

MarryTookMyCoffe
Collaborator
Collaborator

there is a many way you can do it, you can use event or even a revit elementUpdater.
or you can use:
Snippet

activeUIdoc.PostRequestForElementTypePlacement(elementType)

and then after that put another elements like that next to it.

-------------------------------------------------------------
--------------------------------|\/\/|------------------------
do not worry it only gonna take Autodesk 5 years to fix bug
0 Likes
Message 3 of 11

jeremytammik
Autodesk
Autodesk

Revit itself does not have a console like AutoCAD, and the user interface paradigm is completely different.

 

You should not try to reproduce your AutoCAD workflow in Revit.

 

They are different animals:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.41

 

If you wish to interact live with Revit, you might want to take a look at how the RevitPythonShell provides a console interface and implements a real-time read–eval–print loop to enable in-depth interactive programming:

 

https://en.wikipedia.org/wiki/Read%E2%80%93eval%E2%80%93print_loop

 

http://thebuildingcoder.typepad.com/blog/2013/11/intimate-revit-database-exploration-with-the-python...

 

https://github.com/architecture-building-systems/revitpythonshell

 

Before programming, ensure that you understand the basic product paradigms and the user workflow really fits in with that.

 

If your user interface ideas are AutoCAD based, they will not fit well in Revit... you will struggle to implement them and frustrate your users.

 

Cheers,

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 4 of 11

MarryTookMyCoffe
Collaborator
Collaborator

I'm gonna call bull**** on this, there is plenty of things that could be used just like in autocad. For know it look like some crazy person decide, we can't take anything from autocad.
We end up with broken UI that have a questionable solution.
revit is like Bethesda games, the moders have to fix issue.

-------------------------------------------------------------
--------------------------------|\/\/|------------------------
do not worry it only gonna take Autodesk 5 years to fix bug
0 Likes
Message 5 of 11

Anonymous
Not applicable

Thanks @MarryTookMyCoffe. I'll try what you recommend! Hope this fits what I'm looking for. Thanks!

0 Likes
Message 6 of 11

Anonymous
Not applicable

@jeremytammik Thanks a lot for your response!. I'll read the links you mentioned. I have come to the same conclusion that they are two different animals. Already I'm thinking in a different workflow for my solution, heading for the end-user use.

 

Thanks a lot!

0 Likes
Message 7 of 11

jeremytammik
Autodesk
Autodesk

My pleasure entirely.

 

You can use the entire range of user interface gadgets provided by the .NET Windows.Forms library, and also WPF.

 

It is easiest if you can keep your form modal. 

 

If you want modeless interaction, i.e., to keep the form open and continue working with other Revit functionality at the same time, things get much more complex, but it is still possible to do:

 

http://thebuildingcoder.typepad.com/blog/about-the-author.html#5.28

 

I look forward to hearing how you solve this.

 

Thank you!

 

Good luck!

 

Jeremy



Jeremy Tammik
Developer Technical Services
Autodesk Developer Network, ADN Open
The Building Coder

0 Likes
Message 8 of 11

Anonymous
Not applicable

Thanks for the advice. I'll keep it in mind. I think I'll look for the modaless solution, because I want to interact with revit menawhile.

 

CHeers!

0 Likes
Message 9 of 11

Anonymous
Not applicable

Hi @jeremytammik

 

Finally, I used the modaless Form option where I set the parameters according to the needs. Also made a few checks (if-else/switch statements) to gather the desired information in every possible situation. And for the information of the previous element created, I created a different class that stores all the info I needed to rescue. For last, I played with calling the ElementId of the previous element to check if it is still in my document. 

 

Thanks a lot for the suggestions. I finally re-invented the workflow here.

 

CHeers!

0 Likes
Message 10 of 11

dmaughan25
Enthusiast
Enthusiast

Did you ever figure out how to do this? I would love to have a dynamic input in Revit. Any information would be helpful.

0 Likes
Message 11 of 11

jeremy_tammik
Alumni
Alumni

The RevitPythonShell implements a modal as well as a modeless command line that interacts with the Revit API, in case that is of any use to your use case:

 

https://github.com/architecture-building-systems/revitpythonshell

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes