Notifications
Clear all

[Closed] Get fragments after Procutter

Hi!

I stuck with Procutter.
In scene i have a Box and Plane.
I want to cut box on two pieces and after that get them to make selection set.

ProCutter.CreateCutter #(cutterObj) 3 true true false true true 
ProCutter.AddStocks cutterObj #(stockObj) 3 1

After this I check the objects names. For example.

arr = for o in objects where matchpattern o.name pattern:("$Plane*") collect o

It return nothing. arr.count = 0. But this command work normal in listener.
Ok so i add callback that check objects creation and send them to function where i print their names.But what it return is “Object001″“Object001”. Actually that not right names of created chunks.
So wtf is happen in Procutter and how to get this pieces in script body?

2 Replies

probably it has to be:

arr = for o in objects where matchpattern o.name pattern:("Plane*") collect o

Yes , sorry im make mistake when typing. In script itself code without $
Ok maybe on example it will be better visible:

  (
rollout rltMainTPViewer "test"  
(button  btnTPUpdate "Update" pos:[5,5] height:37 width:45  
on btnTPUpdate pressed do  		
( ProCutter.CreateCutter #($Box001_Frag_) 3 true true false true true
  ProCutter.AddStocks $Box001_Frag_ #($Box001) 3 1  		
arrFrags = for o in objects where matchpattern o.name pattern:("Box001_Frag_"+"*") collect o  			
format "arr:%" arrFrags  )  		  
)    	
createdialog rltMainTPViewer 150  150   	  	  	)

Here a box with name “Box001” and CutPlane – “Box001_Frag_”.
When i run code above – array contain only plane object.
If i run three line of code line by line in listener , then array contain plane and fragments. So what the difference ?