diff --git a/dxf_to_csv/dxf_to_csv.py b/dxf_to_csv/dxf_to_csv.py index cfd77e5..978c158 100644 --- a/dxf_to_csv/dxf_to_csv.py +++ b/dxf_to_csv/dxf_to_csv.py @@ -24,10 +24,6 @@ Convert specific layer: """ -__author__ = "D. Howe" -__version__ = "0.2.0" -__email__ = "d.howe@wrl.unsw.edu.au" - import os import sys import numpy as np @@ -96,6 +92,13 @@ def convert(dxf_name, layer_name): # Add to dataframe points = pd.DataFrame(data) + # Ensure dataframe is not empty + if points.shape[0] == 0: + if layer_name: + raise ValueError('No objects found on layer {}'.format(layer_name)) + else: + raise ValueError('No objects found.') + # Check if there are z coordinates if 'z' not in points.columns: points['z'] = np.nan