Showing results for 
Search instead for 
Do you mean 
Reply

Block UI Styler - Clear Selected Bodies

Hello,

 

I am trying to clear the Body Collector block by using an Action Button in the Block UI Styler interface but can't get it to work. Based on another post I read, I tried the code below but get a Null Reference Exception when it's exectuted.

 

Dim emptyVector() As TaggedObject = Nothing
selObject.SetSelectedObjects(emptyVector)

 

Any thoughts?

2 REPLIES

Re: Block UI Styler - Clear Selected Bodies

You can't set the emptyVector to Nothing. You MUST have emptyVector set to a zero length array.

I don't use VB so I can't recall how to do that, but in Java it would be something like:

TaggedObject[] emptyVector = {};
Graham Inchley Snr R&D Engineer (Systems Development), Sandvik Coromant
Lenovo ThinkPad W540, Win7, 16GB. Developing in: Java | C | C# | KF
Production: NX8.5.3.3 MP11 64bit Testing: NX9.0.2.5

Re: Block UI Styler - Clear Selected Bodies

Replacing Nothing with {} did the trick.

 

Thanks for your help.

 

Cheers