Only able to export Property Set Data after removing File References

So I am using the dynamo script that is in the sample folder AutoCAD_Python_PSet_DumpPropertySetValuesToCSV.dyn to export property set data from a specific Dwg file. The script would run fine for all Dwg file that I have except for one which I am guessing that something is wrong with the Dwg file itself and not the script.

I played around with the file, checked few things and found out that if I remove file references (these files are marked ‘Not Found’) from External Data the script would then execute fine. I am not really sure why this is causing an error with the script because there are other Dwg that would run fine even if the file references are displayed as ‘Not Found’.

Why is file references causing the script to fail? Below is the error that dynamo show for that file:

Warning: TypeError : No method matches given arguments for OnExit: (<class 'Autodesk.AutoCAD.ApplicationServices.DocumentLock'>, <class 'type'>, <class 'TypeError'>, <class 'traceback'>) ['  File "<string>", line 29, in <module>\n', '  File "C:\\ProgramData\\Autodesk\\C3D 2022\\Dynamo\\samples\\Data\\AutoCAD\\pset\\pset_utils.py", line 307, in dump_ps_values_csv\n    writer.writerow(temp)\n']

My guess is that the unfounded documents which are referenced is causing the block; Try pathing those references to files which are found and see if that resolves the issue.

Hi @Gauzdx, are you sure that no special characters with accents are used in the titles?
My guess is that this is encoding/decoding problem in Python code. I recommend to use Civil3DToolkit nodes and export to Excel.

@Drbohlav I am newbie with Civil3D. By title do you mean the entire drawing or the defined property set?

I had this problems with property set definitions names with characters like řščň…

Also had this problem with special characters, you can tweek the orignal pset_utils.py code to be able to read the characters.

Adding this worked for me :

# coding: latin1

1 Like

I was able to correct this issue using a Dwg Cleaner. I wasn’t able to exactly pin-point what caused the issue but after cleaning it ran perfectly fine.

1 Like