Python script error? Reading from CAD

Trying to replicate a pipe to dwg workflow and stuck to line 35 of code. Any ideas on why the error??

Thanks

John

Your end transaction is indented in the for loop.

Un-indent the TransactionTaskDone() and this should fix that issue

The tab!!! Omg Have a long way to go… Thanks

Didnt work error is still the same :frowning:

Oh, and you’re missing a line of code that should read doc = DocumentManager.Instance.CurrentDBDocument

Python this in line 10

Apologies, I’m using my mobile and the screens buggered

What’s the error message?

Same… :frowning:

Ah, you have declared doc as IN[5] (line 30). Try hashing that out

Yes tried that as well; gives diff error

Can you upload your files? I’ll have a look on the pc.

Hi @i.tzivanidis ,

EnsureInTransaction needs a Autodesk.Revit.DB.Document

you’re giving it a Revit.Application.Document

The line doc = DocumentManager.Instance.CurrentDBDocument should fix that though. Doesn’t need a port for document.

1 Like

@Mostafa_El_Ayoubi

will try that as well

That’s actually just what @Daniel_Woodcock1 suggested :slight_smile:

doc=DocumentManager.Instance.CurrentDBDocument
is the right syntax?

Python Script workflow without Doc node.dyn (22.1 KB)

https://1drv.ms/u/s!Anpoj4x5Tow-fi1KZFo2dXTdS7c

Hi @i.tzivanidis,

It runs, but you have an error on line 39 where second point is not capitalised. Problem is that it is still running. The script is doing quite a bit it seems and there are warnings about your lines being too short. I started running this about 5 mins ago and it is still going…