Announcements
Autodesk Community will be read-only between April 26 and April 27 as we complete essential maintenance. We will remove this banner once completed. Thanks for your understanding

Removing an user defined "enum" list from post processor - fanuc mill-turn lathe

guillaume.grelaud
Explorer

Removing an user defined "enum" list from post processor - fanuc mill-turn lathe

guillaume.grelaud
Explorer
Explorer

Hello,

 

I am looking to modify a post processor for my CMZ lathe. I started from the Samsung mill turn post (https://cam.autodesk.com/posts/post.php?name=samsung%20mill-turn%20fanuc) and to modify it for my lathe. Mostly imputting the correct M and G code but also getting rid of the sub-spindle and y-axis fonctionalities, that I don't have on my lathe (C-axis and tailstock only).

 

actually I have removed the "user defined properties" related and gave them a fixed value in the "fixed setting" for all non-necessary choices but the "transfertype" setting.

 

I have removed :

transferType: {
    title      : "Transfer type",
    description: "Phase or speed synchronization for stock-transfer.",
    group      : "preferences",
    type       : "enum",
    values     : [
      "Phase",
      "Speed"
    ],
    value: "Speed",
    scope: "post"
  },

from the user's defined and put :

var transferType = 0;

  in the fixed setting but that give me and error when trying to post process a program, saying transfertype must be either speed or phase.  I have tried "phase" or "speed" instead but I can't use the post processor in these cases, saying the post processor is invalid.

with "0" the error message is :

 

Error: TransferType must be Phase or Speed
Error at line: 730
Failed while processing onOpen().
 

 

anyone got any idea how to solve this ?

Thanks!

0 Likes
Reply
237 Views
2 Replies
Replies (2)

matty.fuller
Collaborator
Collaborator

Have a look at what's going on at line 730 in your post, I expect it will be what is at line 782 in the unmodified post you linked:

  // Copy certain properties into global variables
  showSequenceNumbers = getProperty("showSequenceNumbers");
  transferType = parseToggle(getProperty("transferType"), "PHASE", "SPEED");
  if (transferType == undefined) {
    error(localize("TransferType must be Phase or Speed"));
    return;
  }

 

It is specifically trying to retrieve the property and assign it to the variable. What you've done isn't working because you've just set the variable and removed the property from existence, meaning it reads as undefined and triggers the error.

 

You could remove this section, but then you'll break all the other references to transferType elsewhere in the post, of which there are a few. You can remove those too, or you can just put the working code back and move on with your day.

 

0 Likes

guillaume.grelaud
Explorer
Explorer

Thanks for your reply.

 

I got the post-processor to work by modifying one line in the sequence you showed in your reply to

 

transfertype = 0;

I also removed the "var transfertype" in the fixed setting.

 

thanks for your help

0 Likes