NewMechanicalSystem - baseConnector ArgumentException

NewMechanicalSystem - baseConnector ArgumentException

phague
Explorer Explorer
441 Views
1 Reply
Message 1 of 2

NewMechanicalSystem - baseConnector ArgumentException

phague
Explorer
Explorer

Hello,

I am writing an add-in where I want to assign the base equipment to a mechanical system (duct). The equipment that I want to add to the system is already associated with the system in question. It, however, is not listed as the BaseEquipment. The mechanical equipment family instance can found under system.elements. From my understanding, this is where all of the air terminal family instances are located. A user can manually assign the piece of equipment to the system, effectively making it the BaseEquipment for that system, by using the UI. This is done by selecting an element on the desired system, and then switching to the "Duct Systems" contextual ribbon tab. From there the command "Select Equipment" will allow the user to manually designate equipment for that specific system.

 

So I know what I am trying to do is possible. But perhaps not through the API...

 

From the API docs, it appears that MechanicalSystem.BaseEquipment is read-only, so I cannot directly assign an element (Mechanical Equipment) as the BaseEquipment. I thought maybe, I could do this via the BaseEquipmentConnector, but upon assigning the connector like so:

 

system.BaseEquipmentConnector = baseConnector;

I get an exception indicated that the connector is already in use. 

 

I've also tried deleting the system, and then creating a new system using:

doc.Create.NewMechanicalSystem(baseConnector, connectors, sysType);

However, I get the same exception error listed above about the connector already being in use. I even went as far as using one transaction to delete the system, and then another to create the new one. 

 

If anyone could provide some insight or even a solution that would be great!

 

Thanks

0 Likes
Accepted solutions (1)
442 Views
1 Reply
Reply (1)
Message 2 of 2

jeremytammik
Autodesk
Autodesk
Accepted solution

Dear Patrick,

 

Thank you for your query.

 

It appears that the base equipment is required, or at least it was in 2010:

 

https://thebuildingcoder.typepad.com/blog/2010/06/mep-system-creation.html

 

From that old post, it also appears that specific requirements apply to the base equipment connector.

 

That post does show how to create a new system, so you should be able to use that to recreate your system as well.

 

I hope this helps.

 

Best regards,

 

Jeremy

 



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