Announcements
Welcome to the Revit Ideas Board! Before posting, please read the helpful tips here. Thank you for your Ideas!
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Option to preserve connectors when disconnecting

Option to preserve connectors when disconnecting

Good morning,

 

This is in reference to an issue I am currently working on for the following post:

Reconnect tap connectors after disconnect from external event

 

Basically, from what I understand about connector behavior at the moment, when you place a tap or otherwise manually connect one part to another, a connector is added to the host part, if it doesn't already exist in the family, with an id = part max connector id + 1.

 

When Connector.DisconnectoFrom() is called, the connector that was automatically inserted gets deleted, and any references to it become invalid. Therefore, it is impossible to reconnect directly through the connectors themselves.

 

I am going to attempt impersonating a mouse click/drag to mimic what happens when a user clicks the tap connector and drags it close to another part - it snaps back in place and the missing id is recreated (assuming there is only one tap - disconnect may reduce all other extra ids by one, i have not verified that yet, that could complicate the problem further, though a workaround for that would be to save off the max connector id beforehand, but if someone is dealing with multiple taps with inserted ids that could be dangerous for integrity purposes).

 

Still, impersonating the mouse is way more complicated than just disconnect/reconnect.

 

Having an optional parameter on DisconnectFrom() to allow for preserving the host connector as is would make this process very smooth.

 

Other applications I could guess might apply to this is any other part connected to the automatic connectors, or say someone wanted to add something between an existing connection - they would run into the connector id issue as well if they tried to connect using connectors alone. I'm sure in some or most cases, the function to place whatever it is would handle the connector insertion (I would hope, anyway).

 

Just a thought, thanks

 

Thanks

 

 

2 Comments
Anonymous
Not applicable
Turns out - a piece of information was missing for me.

Apparently, straight duct and pipe do not have family definitions.

I am going to backtrack to a function i tried first and see.
Anonymous
Not applicable

Alright, so I was able to accomplish the task I need with PlaceAsTap(), but only partially - now I have to do a bunch of trig calculations to make sure the tap is in the exact spot it was before when calling this function.

 

It would save a lot of time and code, and reduce the risk of a slight miscalculation changing something in the drawing, if I could force it to leave the connector in place because, in my case anyway, I am not moving the tap at all and it is already in the orientation I want - no need to do any math.

 

Of course, giving this option could potentially result in some bloat...

 

I'm sure there must be something in the background that flags the connectors generated when a tap is placed on a straight as temporary. 

 

If you tap a straight, click the connector on the tap and move it away from the straight it breaks the connection and the connector on the straight disappears. But if you then click the connector on the tap again and move it close to where it used to be, it appears to give you the option to snap it back into the old position, so the information must be there somewhere... I need to verify, of course, that this wasn't just because maybe there is another tap directly across from where the old one used to be, but that is what I saw when I watched my client do it manually.

 

Any temporary connector information that hasn't been reconnected to anything could be erased at any point, on document close or open or whatever, so that might help.

 

So I still think the idea is a good one for cases like mine, so i am going to leave this idea on here.

 

Thanks

 

 

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

Submit Idea  

Autodesk Design & Make Report