hexagon logo

Assign variable, PCdmis or Inspect running?

Hello!

Fast question! Is it possible to assign a variable that will let us know if it is run by pcdmis directly or through inspect (be 0 if run by inspect for example and 1 if run through pcdmis)? Thanks in advance!
Parents
  • Inspect has an option (in the settings area) to create a temporary copy of the routine rather than run it directly. The temporary routines are saved in the following location...

    C:\Users\ account name\AppData\Local\Temp\Hexagon \Inspect\TempExecutionLocation

    If you turn that setting on, you should be able to use the the GETPROGRAMINFO("PARTPATH") function to distinguish between a routine which is being run from the temporary location and one that isn't. This would therefor provide a way for you to know if the routine was run from Inspect (temporary location) or from Operator mode (usual location). You would need to add something similar to this to each routine...

    ASSIGN/V1=GETPROGRAMINFO("PARTPATH")
    ASSIGN/V2=INDEX(V1,"TempExecutionLocation")
    ASSIGN/RUN_FROM_INSPECT="FALSE"
    IF/V2>0
    ASSIGN/RUN_FROM_INSPECT="TRUE"
    END_IF/​
    



    This is the Inspect setting that you'd need to turn on...
    {"alt":"Click image for larger version Name:\tScreenshot 2022-10-04 110758.png Views:\t0 Size:\t422.8 KB ID:\t521345","data-align":"none","data-attachmentid":"521345","data-size":"custom","height":"539","title":"Screenshot 2022-10-04 110758.png","width":"958"}


    Wow this is indeed cleaver! A followup question if you could please answer me... I will be running this command from within an external subroutine. When inspect runs the copy, does it also do this temp copy for the subroutine?

    I am more interested actually to learn in general how toggling this on makes inspect behaves towards external subroutines
  • I'm not sure. Inspect should make a temporary copy of any routine that is run and all of it's dependent files that have the same name but a different extension. Your subroutine will have a different name than the routine it is being called from so I'm not sure how Inspect would handle that. You could test it out by adding the assignments and an operator comment that displays the RUN_FROM_INSPECT variable to your sub-routine and see what it displays when everything is is executed.
Reply
  • I'm not sure. Inspect should make a temporary copy of any routine that is run and all of it's dependent files that have the same name but a different extension. Your subroutine will have a different name than the routine it is being called from so I'm not sure how Inspect would handle that. You could test it out by adding the assignments and an operator comment that displays the RUN_FROM_INSPECT variable to your sub-routine and see what it displays when everything is is executed.
Children
No Data