I was able to capture the path of a circuit in Revit. Now I want to convert this data to line and insert a family of Detail Line. But look what is written in Revit API 2018
"The list of the electrical system circuit path node position is not valid. The length of the list should be more than one, the first node should be the position of the panel where the circuit begins at, the adjacent nodes should not be too close , and should be on the same level or on the same vertical line, to keep each segment of the circuit path always horizontal or vertical Also note that the first node position should be the position of the connector (the one connects to the circuit) of the panel, but not the origin of the panel instance. "
Get rid of your try except and you will see an exception and might even be able to resolve this yourselfâŚnever use try except indiscriminately otherwise all you end up doing is sweeping your problems under the carpet âso-to-speakâ, and suppressing otherwise useful exception messages which hinders your ability to debug - its one of the worst habits Iâve seen emerging in the Dynamo community. My advice; never use try catch unless youâve exhausted every other option.
I am not sure I would say âneverâ. I would probably say, if you will use try and except then at least use some sort of logging to output the error:
try:
errorReport = None
except:
import traceback
errorReport = traceback.format_exc()
if None == errorReport:
OUT = 0
else:
OUT = errorReport
I did caveat that with ânever use try catch unless youâve exhausted every other optionâ so we are in agreement. And sure - just donât use try except as âfix-allâ, or for flow control in general, especially when other statements are more appropriate and donât carry the overhead nor suppress useful exceptions. It sets a bad precedent if developers donât learn why allowing exceptions to occur is so useful. My point is to use try except only when there is no other option, not as a default go-to
Just wondering if this code issue was ever resolved, or how it was resolved? I am new to dynamo and as of right now coding is foreign to me, but I am looking at doing something similar. Please use the path below to see my post on a similar topic.
@ggiavoni,
As you may see in this thread I am trying to get a similar Dynamo to work. I have been playing with this on and off over the past couple of months and am having issues. I did seem to get your python to work but I am not sure what you have on the input side of the âList Createâ node. This is my current Dynamo in progress. I am currently working thru multiple scenarios to try and get it to work. Can you advise?