Hello! Tell me how to work with UI on WPF app.

Hello! Tell me how to work with UI on WPF app.

danila_kharitonov1999
Explorer Explorer
777 Views
2 Replies
Message 1 of 3

Hello! Tell me how to work with UI on WPF app.

danila_kharitonov1999
Explorer
Explorer

I recently switched from the Dynamo environment to Visual Studio to start writing more interesting things and immediately had some questions:

 

1. Is there any clearer documentation on RevitAPI instead of the official one? There are a lot of things that are not needed, and what is needed is poorly described (the same revitapidocs).

 

2. Is there an opportunity in Revit to replace the geometry of an element? Let's say I have a class that looks for the intersection of the surface of an element with a wall edge, if such an element is located, then an object of the DirectShare class remains from it, and the originally lying object of the FamilyInstance class is deleted. Can I call DirectShare to Solid, and then turn to the element and tell it to take this geometry instead of its own? Or is there some other way? The main thing for me is that after pruning there remains an element of the same family lying earlier, but of a different shape. In Dynamo, such an algorithm is implemented using a deep analysis of the geometry and recording the values obtained in the parameters of the family.

 

3. I have a solution that contains 2 projects. The first is the "initializer" it contains the structure of the Revit tab, panels, buttons, as well as commands for miniprograms, according to the type of trimming that do not require an interface and a command to launch the second project. The second one assumes advanced functionality due to its own interface and commands described inside this project (working independently of the first one, but closely related to it), written in WPF and C#. So here's the question: how can I transfer Revit documents and attributes to a project with WPF to do all the calculations there, and not constantly refer to the first project? And is such a structure appropriate?

 

Perhaps there is some event that allows you to transfer the document to another project and work through it. Looking at Revit Lookup, this is quite real. I'm work in Revit 2021. 

 

Thank you so much in advance for the answers.

0 Likes
778 Views
2 Replies
Replies (2)
Message 2 of 3

jeremy_tammik
Alumni
Alumni

Let's start with question 2... I can address that best:

  

> Is there an opportunity in Revit to replace the geometry of an element?

  

No.

  

> Can I call DirectShare to Solid, and then turn to the element and tell it to take this geometry instead of its own?

  

No.

  

> Or is there some other way?

  

No, not really.

  

Well, yes, of course, everything is possible if you try hard enough.

  

> The main thing for me is that after pruning there remains an element of the same family lying earlier, but of a different shape. 

  

I once discussed with wood structure specialists who implemented very advanced Revit add-n for wooden framing.

  

They were forced to use Revit beams and columns for the Revit part of the functionality., but the geometry was totally inadequate, since they were modelling the results of CAD/CAM generated framing connections.

  

So, they added their own DirectShape geometry and maintained that in parallel with the standard Revit elements, and synchronised at all times.

  

It enabled a perfect super professional solution.

  

I imagine it took less than ten man-years to implement and fine tune.

  

I very much look forward to hearing how you end up solving your challenging tasks.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
Message 3 of 3

danila_kharitonov1999
Explorer
Explorer

Okay, what about point 3? Is he real?

image.png