Author: bugman Date: Tue Jul 1 11:11:25 2014 New Revision: 24367 URL: http://svn.gna.org/viewcvs/relax?rev=24367&view=rev Log: Fixes for the cone geometric representation in the internal structural object. The representation can now be created if the given MoleculeContainer object is empty. Modified: branches/frame_order_cleanup/lib/structure/represent/cone.py Modified: branches/frame_order_cleanup/lib/structure/represent/cone.py URL: http://svn.gna.org/viewcvs/relax/branches/frame_order_cleanup/lib/structure/represent/cone.py?rev=24367&r1=24366&r2=24367&view=diff ============================================================================== --- branches/frame_order_cleanup/lib/structure/represent/cone.py (original) +++ branches/frame_order_cleanup/lib/structure/represent/cone.py Tue Jul 1 11:11:25 2014 @@ -61,7 +61,9 @@ """ # The atom numbers (and indices). - atom_num = mol.atom_num[-1]+1 + atom_num = 1 + if hasattr(mol, 'atom_num') and len(mol.atom_num): + atom_num = mol.atom_num[-1]+1 # Add an atom for the cone apex. mol.atom_add(pdb_record='HETATM', atom_num=atom_num, atom_name='APX', res_name=res_name, res_num=res_num, pos=apex, segment_id=None, element='H') @@ -252,7 +254,7 @@ # The first atom number. start_atom = 1 - if hasattr(mol, 'atom_num'): + if hasattr(mol, 'atom_num') and len(mol.atom_num): start_atom = mol.atom_num[-1]+1 # The axis. @@ -266,7 +268,9 @@ # Generate the cone outer edge. print("\nGenerating the cone outer edge.") - edge_start_atom = mol.atom_num[-1]+1 + edge_start_atom = 1 + if hasattr(mol, 'atom_num') and len(mol.atom_num): + edge_start_atom = mol.atom_num[-1]+1 cone_edge(mol=mol, cone_obj=cone_obj, res_name='EDG', res_num=start_res+2, apex=apex, R=R, scale=scale, inc=inc, distribution=distribution) # Generate the cone cap, and stitch it to the cone edge.