Community
HSM Post Processor Forum
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"job-description" and Selecting Multiple Setups

1 REPLY 1
Reply
Message 1 of 2
jonathanBUCVS
54 Views, 1 Reply

"job-description" and Selecting Multiple Setups

Specifically regarding the Excel setup sheet, I have been trying to duplicate the behavior of the workOffset variable that displays either the workOffset(if one setup is selected)  or "Multiple" (if more than one setup  is selected). 

 

//in the getProgramInfo() function
for (var i = 0; i < numberOfSections; ++i) {
    var section = getSection(i);
if (workOffset == undefined) {
      workOffset = section.workOffset;
    } else {
      if (workOffset != section.workOffset) {
        multipleWorkOffsets = true;
      }
    }
.....
// then output here
result["workOffset"] = multipleWorkOffsets ? "Multiple" : workOffset;

 I noticed in the documentation that getGlobalParameter() only grabs the first instance, so I did try to implement onParameter(). Ive tried a bunch of methods and locations, but Im out of ideas now and I dont think I understand the root cause of the issue to get to the exact answer. 

 

Im not necessarily looking for an exact solution, even a few ideas to play around with would be great.

 

 

 

1 REPLY 1
Message 2 of 2

Hi. Just some insights, how it works.

"job-description" is specified for the first section in the setup.

getProgramInfo function is called from onOpen before any section is specified.

You can use onParameter function to update current setup name. As I see, this function is defined in excel setup sheets already and collects all parameters. So, "job-description" should be already in cachedParameters for first section in setup. Not exactly, as for first setup it will go into programInfo.

Anyway, you can check, if there is "job-description" in cachedParameters in onSection callback and set 

programInfo["program.jobDescription"] to "Multiple", if it is. Or you can add new "job-description" to it, if you want to collect all setup names there. Also, you can add new property "setup" for sections.

Viacheslav Shapilov
Developer Technical Services
Autodesk Developer Network


Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report