Error when getting the "Ampacity" property of GroundConductorSize

Error when getting the "Ampacity" property of GroundConductorSize

engrodriggo
Participant Participant
376 Views
3 Replies
Message 1 of 4

Error when getting the "Ampacity" property of GroundConductorSize

engrodriggo
Participant
Participant

Hello everyone,

I'm facing an issue when trying to get the "Ampacity" property of a "GroundConductorSize" in my Revit project. Every time I try to access this property through Revit lookup, I receive the following error: "Input string was not in a correct format".

 

The strange thing is that when I try to manually create the "Ampacity" with specific values, it works correctly. However, when trying to access the property via the API, the error occurs.

engrodriggo_0-1689634807842.png

 

I'm a bit lost on what might be causing this error. Has anyone encountered a similar issue or have any ideas on how I can resolve it?

I appreciate any help or guidance you can provide!

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

jeremy_tammik
Alumni
Alumni

You say that you receive an error from RevitLookup saying  "Input string was not in a correct format". However, the image you share displays a completely different error. The Ampacity property simply returns a long value:

  

https://www.revitapidocs.com/2024/ae4fa6d0-70c4-3d32-94e2-9830317f5aad.htm

  

Furthermore, I only see a get method for the Ampacity property, and no set, so I don't see how you might be manipulating it, or what any input string might have to do with such manipulation. More details needed, please, and maybe some sample code snippet.

  

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

engrodriggo
Participant
Participant

Thank you for reply Jeremy!

The error occurs when I try to add a GroundConductorSize to a WireMaterialType using the AddGroundConductorSize method.

https://www.revitapidocs.com/2016/21dcbeef-656d-7a93-144a-a4f65f3395c1.htm

engrodriggo_0-1689680143321.png

 

This part of my code generates the exception "Input string was not in a correct format" but, the variables i'm using in the AddGroundConductorSize method are correct. There is no error with them that could cause this exception.

 

Even when i use RevitLookup to inspect any manually created GroundConductorSize, it still shows the error.

engrodriggo_1-1689680806970.png

 

0 Likes
Message 4 of 4

jeremy_tammik
Alumni
Alumni

Strange behaviour. Please submit a minimal complete reproducible case with exact steps to reproduce for me to ask the development team to take a look at. Thank you!

  

  

Jeremy Tammik Developer Advocacy and Support + The Building Coder + Autodesk Developer Network + ADN Open