Connectors already Used

Connectors already Used

Anonymous
Not applicable
1,101 Views
4 Replies
Message 1 of 5

Connectors already Used

Anonymous
Not applicable

Hello everyone, 

Sorry iam new here, but i have a problem that hope u guys help me solve it, iam trying to make a revit API that copies fixtures along with their circuits and its parameters from one floor to another, so far i have achieved all of that except for a problem that when i copy with the fixtures with their wires i get the following error : " Some connectors to be added into the system already have been used"  at this line of code : Newelectricalsystem.add(connectorset), which i use to add the rest of the connectors to the new electrical system after it has been created (I add elements to my circuits at connector level not at family instance level because i have fixture with multiple connectors in it) , the only workaround i found was to use method connector.disconnectfrom(connector) to disconnect wire connectors and connect them again later, but the problem here is this causes some offset to the end points of the wire with fixtures intersection, Any Help Please ?

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

jeremytammik
Autodesk
Autodesk

I would research for an optimal solution that produces no warnings and a perfect result manually in the user interface first, before trying to implement anything programmatically. Here are some suggestions on how to research to find a Revit API solution:

 

http://thebuildingcoder.typepad.com/blog/2017/01/virtues-of-reproduction-research-mep-settings-ontol...

 

Cheers,

 

Jeremy

 



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

0 Likes
Message 3 of 5

Anonymous
Not applicable

Thanks for your fast reply, however i tried all your suggestions (to know how it is done with user interface and then dig in the API and Revit lookup tool to know exact classes/parameters that i must use and of course also the building coder posts on connectors) and actually that helped me alot through the whole add-in creation phase and iam almost done except that problem ... why the method electricalsystem.add(connectorset) doesn't connect connectors that are connected to wires ??? ... i can't see any logic contradiction that a connector be connected to the circuit and the wire at the same time (actually the logic says that they must be connected to both) then why the Revit Api gives me that error ???

0 Likes
Message 4 of 5

Anonymous
Not applicable

On another hand you could help me if you tell me how to change the wire end offset (blue circle at end of wire to determine the graphical end point of the wire mot probably we make it end at the perimeter of fixture) with revit api 

0 Likes
Message 5 of 5

Anonymous
Not applicable
Accepted solution

Actually i found the solution, the error was due to that when the first connector connects to the circuit, the other connectors (connected to it by wires) is automatically added by revit to circuit because they are connected by wires, so when i try to connect them again it gives me "used connector" because it was actually and automatically connected, so the solution was only to check if the connector is used or not and if not used connect it and vice versa.