Qestions about HSM Works Tool Library.

monozukuri.daisuki.higucchan
Advocate
Advocate

Qestions about HSM Works Tool Library.

monozukuri.daisuki.higucchan
Advocate
Advocate

I am trying to get tool parameters from the HSMWorks tool library, but I am unable to get values for some parameters.
When I try to retrieve them, I get an "undefined" error.
I have tried to get them with the getParameter function, but it does not work.
For example, I cannot get the values of parameters such as "tool.tipAngle" and "tool.tipLength" in the Center Drill item, and "tool.numberOfTeeth" in the Thread Mill item.
If you know of any solutions, I would appreciate it if you could let me know.

0 Likes
Reply
Accepted solutions (2)
333 Views
4 Replies
Replies (4)

boopathi.sivakumar
Autodesk
Autodesk
Accepted solution

Hi @monozukuri.daisuki.higucchan 

It seems like those parameters are not exposed in the tool object.

 

You can still use getParameter to get the values for tipAngle, tipLength 

 

you can call it like this 

getParameter("operation:tool_numberOfTeeth", 0)

 

You can use the dump.cps file to see the available parameters

boopathisivakumar_0-1683987918756.png

 


Boopathi Sivakumar
Senior Technology Consultant

0 Likes

monozukuri.daisuki.higucchan
Advocate
Advocate

Thanks for the reply.
I tried that method too, but I can only collect default values.
Even if the parameter value of the tool is changed, the default value is returned.
For example,
The "tool_numberOfTeeth" you provided is a parameter used in threading tools, but it has a default value of 0. However, in the Fusion tool library it is set to 1.
It will still return a default value of 0.
Does the getParameter function only return fixed values?
Or does it need to be defined in some other part of the program?
Tool path data and a faulty post processor are attached.
When you post a threading operation, the value of the "NTT=" parameter in the tool table at the head of the program is the relevant part.
The post processor file has 585 lines in the post.

0 Likes

Accepted solution

Hi @monozukuri.daisuki.higucchan 

getToolTable() function don't have the section parameters. to use this method in the onOpen you need to create a logic something like this 

    var numberOfSections = getNumberOfSections();
    for (var i = 0; i < numberOfSections; ++i) {
      var section = getSection(i);
      var tool = section.getTool();

      if (getToolTypeName(tool.type) == "thread mill" ){
        writeln(section.getParameter('operation:tool_numberOfTeeth', 0));
      }
      
    }

Boopathi Sivakumar
Senior Technology Consultant

0 Likes

Thank you very much.

I got it to run in the onSection function and it worked fine, but I also learned a lot from the method you taught me.

I just started post editing and didn't know how to do it, so this is very helpful.

Thanks 😆

0 Likes