Navisworks API selection null reference exception

Navisworks API selection null reference exception

rade_tomovic
Advocate Advocate
308 Views
1 Reply
Message 1 of 2

Navisworks API selection null reference exception

rade_tomovic
Advocate
Advocate

I asked the same question on stack overflow, without answers, so I will link it here. Basically, I'm getting null reference exception on this code:

_doc.CurrentSelection.CopyFrom(selection);

but neither _doc, CurrentSelection or selection are null or empty. 

0 Likes
309 Views
1 Reply
Reply (1)
Message 2 of 2

niels_deboer
Participant
Participant

selection is a List<ModelItem> object type and not ModelItemCollection. It is not the same, see below. If you change the GroupIntersectingClashResults object type to this it could solve your problem.

 

C#
public class ModelItemCollection : NativeHandle, 
	ICollection<ModelItem>, IEnumerable<ModelItem>, IEnumerable
0 Likes