Override Pipe Fitting Selection Handler

Override Pipe Fitting Selection Handler

ankofl
Advocate Advocate
266 Views
3 Replies
Message 1 of 4

Override Pipe Fitting Selection Handler

ankofl
Advocate
Advocate

Hi! I will be grateful for any help!
I have two pipes, when I try to connect one end to the other, the fitting selection process starts, and if, for example, it was found in the trace settings, it is inserted into the right place with the right transformation and connected to the right connectors.
How can I override this process through the API under certain conditions, for example, when the types of pipes to be connected have a specific name?

0 Likes
267 Views
3 Replies
Replies (3)
Message 2 of 4

MarryTookMyCoffe
Collaborator
Collaborator

you can use updater, but in it you can connect connector or
you can make flag in DocumentChanged and make change in event Idle.

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

ankofl
Advocate
Advocate

Thanks for the answer!

But this is a little bit not what I need. With this approach, I will replace the element already created by fitting selection, but can I respond to some FittingSelectionHandler, and if the pipes connected in it meet my criteria, then I redefine the operations in its transaction, and if not, it just continues its execution?

0 Likes
Message 4 of 4

MarryTookMyCoffe
Collaborator
Collaborator

updater is tricky and maybe you could do it there, in theory it is for changing while some transaction of object is happening, but from practice it was a lot of work and it is hard to test it.
The events for me are safer, what I do in my apps is to make parameters in fitting that show if size of fitting is in csv table and if not, I modified it. I'm not gonna lie it will be a lots of work, lord have mercy on.
Usually it is better to remove fitting that revit provide to what should be there.
just as tip there is a bug with changing connector radius if you use ',' as a decimal separator in windows you will get exception so make sure to change culture to UK.

-------------------------------------------------------------
--------------------------------|\/\/|------------------------
do not worry it only gonna take Autodesk 5 years to fix bug