Post processor "entityClosed" always returning zero

Having problems with or questions about SheetCam? Post them here.
Post Reply
mancavedweller
Posts: 161
Joined: Tue Feb 25, 2014 6:53 am

Post processor "entityClosed" always returning zero

Post by mancavedweller »

Hi Les,

I've been at this several hours trying to figure out what I'm doing wrong.

Could you give me some guidance on how to use the Sheetcam variable "entityClosed".

I believe this is supposed to test whether the next path is open or closed. Variable is 1 if path is closed and 0 if path is open.

My test part has one external cut and 17 internal cuts. 5 of these internal cuts are open lines and the rest are closed lines.

In the post I'm testing cut length, and also if the cuts are open or closed. Cut length is a doddle and does what I want. However, "entityClosed" is always having a value of 0, indicating open paths.
The attached screenshot shows the returned messaged when running the post (you might have to download the image to see it at full size, it's reduced it's size in this post. Or right click in it and open it in a new tab to get full size).
The following code is what I've written. However I have tried the code outside of "function OnNewEntity()" too, and "entityLength" works but "entityClosed" is still always at zero. Am I doing something wrong ?

Code: Select all

function OnNewEntity()
  if entityLength > 80 then
      post.Message("PATH LONG entityLength == ", entityLength)
   else 
      post.Message("PATH SHORT entityLength == ", entityLength)
   end
   
  
   if entityClosed == 1 then
	post.Message("PATH CLOSED entityClosed == ", entityClosed)
   else
     post.Message("PATH OPEN entityClosed == ", entityClosed)
   end
end
PP MESSAGES & PART.jpg
PP MESSAGES & PART.jpg (243.63 KiB) Viewed 741 times
User avatar
Les Newell
Site Admin
Posts: 3661
Joined: Thu May 11, 2006 8:12 pm

Re: Post processor "entityClosed" always returning zero

Post by Les Newell »

As far as the post is concerned the lead in and lead out are part of the shape so if you have leadins or leadouts the shapes aren't closed.
mancavedweller
Posts: 161
Joined: Tue Feb 25, 2014 6:53 am

Re: Post processor "entityClosed" always returning zero

Post by mancavedweller »

Ah I see.

Thanks for that Les. Good job I didn't keep trying, wouldn't have got very far :lol:
Post Reply