Announcements

We are currently experiencing an issue impacting some Autodesk Products and Services - please refer to the Autodesk Health Dashboard for updates.

NewElectricalSystem Specify Voltage & Poles

NewElectricalSystem Specify Voltage & Poles

bxw
Enthusiast Enthusiast
5,851 Views
45 Replies
Message 1 of 46

NewElectricalSystem Specify Voltage & Poles

bxw
Enthusiast
Enthusiast

 

I'm trying to create an electrical system on an element when the Voltage & Poles parameters are instance parameters.  The following works when those parameters are Type parameters, however the voltage is set to 0V when voltage is an instance parameter.  The Voltage parameter on an electrical system is read only.  Is there a way to do this?  

 

//Works when Voltage & Poles are type parameters, returns 0V & 1 Pole when Volts & Poles are instance parameters

// es is an electrical fixture 

newCircuit = doc.Create.NewElectricalSystem(es, ElectricalSystemType.PowerCircuit);

 

 

In the UI when Voltage & Poles are instance parameters you have this dialog to choose the value. 

 

 

specifyCircuitInformation.PNG

 

 I would like to use the value of the Voltage & Poles instance parameters. I have looked around the MEPmodel, ConnectorManager, etc but can't seem to find a way to specify the voltage & poles?  

 

 

Any input would be appreciated.  Thanks.

 

 

0 Likes
5,852 Views
45 Replies
Replies (45)
Message 21 of 46

jeremy_tammik
Alumni
Alumni

I asked the devteam for you...

 

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

jeremy_tammik
Alumni
Alumni

We can never make any forward-looking statements or promises at all, ever, so it is hard to even provide a hint.

 

However, here is the take of the devteam:

 

We cannot guarantee when to release the fix. When it is ready, I see no reason to prevent it from being integrated into prior release, depending on the team's evaluation.

  

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

crapai
Advocate
Advocate

Thanks for the reply.

0 Likes
Message 24 of 46

David_Robison
Advocate
Advocate

For anyone following this thread, I have created a wish list entry for it to be fixed. You can indicate your support at the following link:

https://forums.autodesk.com/t5/revit-ideas/set-electricalsystem-voltage-when-set-as-instance-paramet...

Message 25 of 46

ricaun
Advisor
Advisor

Hello, the issue still happens on Revit 2023 at least on the Revit Api.

 

Here is the code I'm using on the video.

 

using Autodesk.Revit.Attributes;
using Autodesk.Revit.DB;
using Autodesk.Revit.DB.Electrical;
using Autodesk.Revit.UI;
using Autodesk.Revit.UI.Selection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;

namespace RevitAddin.VoltageZeroBugTest.Revit.Commands
{
    [Transaction(TransactionMode.Manual)]
    public class Command : IExternalCommand
    {
        public Result Execute(ExternalCommandData commandData, ref string message, ElementSet elementSet)
        {
            UIApplication uiapp = commandData.Application;

            UIDocument uidoc = uiapp.ActiveUIDocument;
            Document document = uidoc.Document;

            Selection selection = uidoc.Selection;

            var elements = selection.GetElementIds().Select(id => document.GetElement(id));

            if (elements.Any())
                using (Transaction transaction = new Transaction(document))
                {
                    transaction.Start("Create ElectricalSystem");
                    try
                    {
                        var electrical = CreatePowerCircuit(document, elements);
                        MessageBox.Show($"Name: {electrical.Name}\nVoltage: {electrical.Voltage}", "ElectricalSystem");
                    }
                    catch (Exception ex)
                    {
                        MessageBox.Show($"{ex}", "Error");
                    }
                    transaction.Commit();
                }

            return Result.Succeeded;
        }

        public ElectricalSystem CreatePowerCircuit(Document document, IEnumerable<Element> elements)
        {
            return ElectricalSystem.Create(document, elements.Select(e => e.Id).ToList(), ElectricalSystemType.PowerCircuit);
        }

    }
}

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

Message 26 of 46

crapai
Advocate
Advocate

Can we please just fix this so that voltage is consistently handled. I thought the dev team wants to focus on consistency. Well if that's the case, voltage is a very oddly shaped bump and is integral to the design process. It needs to be smoothed out.

Message 27 of 46

challstrom
Enthusiast
Enthusiast

Just want to pipe in that there's those of us in the shadows that are waiting for this to be fixed @jeremy_tammik . Don't leave us hanging!

Message 28 of 46

jeremy_tammik
Alumni
Alumni

Thank you for your updates, interest and perseverance with this! I updated the development ticket REVIT-180706 [API ElectricalSystem.Create() cannot specify voltage and poles -- 11747417, 18748199] and asked the development team about its current status for you.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 29 of 46

David_Robison
Advocate
Advocate

For everyone waiting for a fix, I did create an official idea to request that it be fixed. So far, two people have voted for it. I am sure it would help Jeremy lobby on our behalf if there were more votes for the idea.

 

Take a moment and click "Vote" on this page:

https://forums.autodesk.com/t5/revit-ideas/set-electricalsystem-voltage-when-set-as-instance-paramet...

Message 30 of 46

Martin.Servold_MEE
Contributor
Contributor

@jeremy_tammik 
It seems like 2/3 of this problem is resolved in 2023 (or possibly 2023.1). 
Create system with type & instance connectors, connect to panel, delete type connector element, disconnect from panel. <------ This is working now, it retains its voltage value with only the instance element.
Create system with type & instance connectors, do not connect to panel, remove type element from circuit, delete type element. <------ This works now! NOTE: you have to remove the type element from the circuit for this to work, you cannot just delete the type element.

What is still not working:
Create system with instance connectors <--- Voltage set to 0V.

Message 31 of 46

jeremy_tammik
Alumni
Alumni

Dear @David_Robison,

 

Thank you for creating the wish list entry.

 

Dear @Martin.Servold_MEE,

 

Thank you for your analysis and clarifying update.

 

The Revit development team reacted to update of the development ticket REVIT-180706 [API ElectricalSystem.Create() cannot specify voltage and poles -- 11747417, 18748199] and says:

 

I read through the forum post and think the remaining request now is to support setting Voltage and Poles when creating a circuit using API, correct?

 

As far as I can tell, the current UI behaviour is to get the LL/LG voltage from the distribution systems defined in the current project for the selected Number of Poles when you create the power circuit. From your conversation with the 3rd party developers, do you know whether they would like the exact same behaviour for the circuit creation API? Or, do they just want to input the values without knowing the currently available ones set in the project?

  

Thanks!

   

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

ricaun
Advisor
Advisor

@jeremy_tammik wrote:

 

The Revit development team reacted to update of the development ticket REVIT-180706 [API ElectricalSystem.Create() cannot specify voltage and poles -- 11747417, 18748199] and says:

 

I read through the forum post and think the remaining request now is to support setting Voltage and Poles when creating a circuit using API, correct?

 

As far as I can tell, the current UI behaviour is to get the LL/LG voltage from the distribution systems defined in the current project for the selected Number of Poles when you create the power circuit. From your conversation with the 3rd party developers, do you know whether they would like the exact same behaviour for the circuit creation API? Or, do they just want to input the values without knowing the currently available ones set in the project?

   


The best approach should be to create an electrical circuit with any voltage/poles, no matter if I have distribution or not.

 

One thing that could be amazing is instead of choosing a voltage/pole when creating the electrical system, instead the feature to change the voltage/poles when the electrical circuit is already created.

 

In the Autodesk.Revit.DB.Electrical.ElectricalSystem updates the Voltage and PolesNumber with the set propriety.

 

public double Voltage { get; set; }
public int PolesNumber { get; set; }

 

Just enable this when the ElectricalSystem is electrical and is not connected to a panel.

 

I know a lot of Electrical users sometimes need to change the voltage in all the circuits in the project and at the moment the only way is to delete the ElectricalSystem and create a new one.

 

And for some reason, the bug zero voltage happens I could change the 0 voltage to something else.

 

When creating a Conduit, I need to change the diameter to the size I what after the Conduit is created.

 

Make sense to do some similar with ElectricalSystem.

 

Edit: Instead of changing the propriety to set, make it possible to set the parameters: RBS_ELEC_VOLTAGE and RBS_ELEC_NUMBER_OF_POLES.

 

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

Message 33 of 46

jeremy_tammik
Alumni
Alumni

Thank you for your valuable input! I added it to the ticket.

  

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

bxw
Enthusiast
Enthusiast

When I tried to do this & started this thread I expected the system would use the parameter values that were mapped to the Poles & Voltage on the connector element whe the electrical system is created.  I think it could be useful to set them explicitly as mentioned by Ricaun, but it seems the most intuitive way would be to use the parameter values.  Thanks for your efforts on this & in general it has been a big help to me.  

0 Likes
Message 35 of 46

David_Robison
Advocate
Advocate

 I added my thoughts to the idea request. I'll mention them here too.

https://forums.autodesk.com/t5/revit-ideas/set-electricalsystem-voltage-when-set-as-instance-paramet...

 

This functionality works if the voltage is a type parameter. I would expect it to work in the exact same way for instance parameters. Revit should handle the setting of the voltage, just using an instance parameter instead of a type parameter.

Message 36 of 46

jeremy_tammik
Alumni
Alumni

Thank you all for your perseverance and patience getting this addressed.

 

The development team completed work on the ticket REVIT-180706 [API ElectricalSystem.Create() cannot specify voltage and poles].

 

The updated behaviour is ready for review in the development version of Revit. You will be able to test it in an upcoming Preview Release.

 

I asked whether it can be made available sooner, in an update of the current release.

 

They answer: We just implemented it. We need to validate the results with more users before we can say it’s ready for a ship integration. Do you think people who requested this can access our Preview Release build in the coming months to help us test it?

 

So, that is the question: would you like to register for the Preview Release and try it out as soon as it becomes available? Please do and provide feedback on it in the Preview Release forum.

 

If everybody confirms the behaviour is useful, it may be possible to integrate REVIT-180706 [API ElectricalSystem.Create() cannot specify voltage and poles] into an update of the current release as well.

 

Thank you!

 

Cheers,

 

Jeremy

 

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 37 of 46

ricaun
Advisor
Advisor

Cool! Would be great to make some tests in the Preview Release.


If gonna be available in the next Preview Release I definitely gonna test it and give some feedback.

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils

Message 38 of 46

bxw
Enthusiast
Enthusiast

Thanks, for the update.  I will keep an eye out and give it a try.  

0 Likes
Message 39 of 46

jeremy_tammik
Alumni
Alumni

Dear all, 

 

I have good news on this issue. The development team moved the release forward, from the next major Revit release to the next update release of Revit 2024. The date is not yet fixed, but it will be earlier than the next major release, in any case:

  

https://www.autodesk.com/support/technical/article/caas/tsarticles/ts/1BlfQlbA9wWd1JmijceW6d.html?us...

  

P.S. This statement is being made as of today, and we assume no obligation to update this forward-looking statement to reflect events that occur or circumstances that exist or change after the date on which it was made. If this statement is reviewed after this date, it may no longer contain current or accurate information.

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open
0 Likes
Message 40 of 46

ricaun
Advisor
Advisor

I have tested it in the Preview and works as intended. If this fix/enhancement gonna be in the next hotfix for Revit 2024 good, I only gonna think to use it in the next Revit 2025.

 

Now I wonder why it took so long for this problem to be fixed. And how we can make this process faster, this forum is the best place for this kinda problem or the Preview gonna be better.

 

This post was created in 2016 only 7 years. 😑

Luiz Henrique Cassettari

ricaun.com - Revit API Developer

AppLoader EasyConduit WireInConduit ConduitMaterial CircuitName ElectricalUtils