Turn off CAD graphs programatically

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Turn off CAD graphs programatically

    UPDATE: I've added the SWITCH variable as it was displaying the dimension result twice.



    This is one of those really niche tips that might help out one maybe two people but I thought it was quite cool. When using the CAD graphs for surface profiles it has always bugged me that they stay active resulting in a messy report after several dimensions. I have found a way to capture the CADGRAPH, display it on the report and then turn it off again afterwards before displaying the next feature

    Code:
    [COLOR=#EE82EE]ASSIGN/COUNT=0[/COLOR]
    SCN1START      =LABEL/
    [COLOR=#EE82EE]IF/COUNT==0
                      ASSIGN/[/COLOR][B][COLOR=#FF0000]TOGGLE[/COLOR][/B][COLOR=#EE82EE]="BOTH"
                      ASSIGN/[/COLOR][B][COLOR=#008000]SWITCH[/COLOR][/B][COLOR=#EE82EE]="BOTH"
                    END_IF/[/COLOR]
    [COLOR=#0000FF]    IF/COUNT==1
                      ASSIGN/[/COLOR][B][COLOR=#FF0000]TOGGLE[/COLOR][/B][COLOR=#0000FF]="OFF"[/COLOR]
    [COLOR=#0000CD]ASSIGN/[/COLOR][B][COLOR=#008000]SWITCH[/COLOR][/B][COLOR=#0000FF]="NONE"
                    END_IF/[/COLOR]
    
    SCN1           =FEAT/SET,CARTESIAN
                    THEO/<21.723,21.584,2.446>,<0,0,1>
                    ACTL/<21.677,21.586,2.247>,<0,0,1>
                    CONSTR/SET,BASIC,P8--(1),P9--(1),P10--(1),P11--(1),P12--(1),P13--(1),,
    
        FCFPROF1 =SURFACE PROFILE : SCN1
                    FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES
                    CADGRAPH=[B][SIZE=14px][COLOR=#FF0000]TOGGLE[/COLOR][/SIZE][/B],REPORTGRAPH=OFF,TEXT=OFF,MULT=10.00,ARROWDENSITY=100,OUTPUT=[SIZE=14px][B][COLOR=#008000]SWITCH[/COLOR][/B][/SIZE],UNITS=MM
                    COMPOSITE=NO,
                    CUSTOMIZED DRF=NO
                    STANDARDTYPE=ASME_Y14_5
                      PRIMARY DIMENSION/PROFILE OF SURFACE,1,UNEQUAL TOLERANCE ZONE,0.7,A1,<dat>,<dat>
                      NOTE/FCFPROF1
                    FEATURES/SCN1,,
                    COMMENT/REPT,
    
    SCNVIEW1       =VIEWSET/
                    RECALL/VIEWSET,SCNVIEW1
    [COLOR=#EE82EE]IF/COUNT==0
                      DISPLAY/METAFILE, "", TO FIT, GOOD
                    END_IF/[/COLOR]
    [COLOR=#0000FF]IF/COUNT==0
                      ASSIGN/COUNT=COUNT+1
                    GOTO/SCN1START
                  END_IF/[/COLOR]
    This allows you to use CADGRAPH and end up with a clean and crisp report that only shows one profile on each screen capture.


    Warning: I use this in a program that has 84 surface profile callouts, while it works perfectly it does dramatically increase saving and loading time.
    Last edited by JackMido; 10-04-2018, 07:02 AM.
    Clearance is clearance.

  • #2
    Can't you just use the (reportgraph) and not create a viewset to do the same thing? That is what I do and it gives me one profile for each output. But the code looks pretty cool.
    Time for the Trolls to leave.

    Comment


    • #3
      I'll be honest, other than at my training I have never used reportgraph (we used to use legacy a lot so analysis view was our go to), AFAIK reportgraph doesn't show the CAD model? I'm basically doing this to have an overlay on the cad so even "morons/" engineers/customers can understand the results.
      Clearance is clearance.

      Comment


      • #4
        That might be a better way having the CAD there.
        Time for the Trolls to leave.

        Comment


        • #5
          I thought this was a clever workaround.
          Here is the code re-posted with the formatting fixed.

          ASSIGN/COUNT=0
          SCN1START =LABEL/
          IF/COUNT==0
          ASSIGN/
          TOGGLE="BOTH"
          ASSIGN/
          SWITCH="BOTH"
          END_IF/

          IF/COUNT==1 ASSIGN/TOGGLE="OFF"
          ASSIGN/SWITCH="NONE"
          END_IF/


          SCN1 =FEAT/SET,CARTESIAN
          THEO/<21.723,21.584,2.446>,<0,0,1>
          ACTL/<21.677,21.586,2.247>,<0,0,1>
          CONSTR/SET,BASIC,P8--(1),P9--(1),P10--(1),P11--(1),P12--(1),P13--(1),,

          FCFPROF1 =SURFACE PROFILE : SCN1 FEATCTRLFRAME/SHOWPARAMS=YES,SHOWEXPANDED=YES CADGRAPH=TOGGLE,REPORTGRAPH=OFF,TEXT=OFF,MULT=10.00,ARROWDENSITY= 100,OUTPUT=SWITCH,UNITS=MM COMPOSITE=NO, CUSTOMIZED DRF=NO STANDARDTYPE=ASME_Y14_5 PRIMARY DIMENSION/PROFILE OF SURFACE,1,UNEQUAL TOLERANCE ZONE,0.7,A1,<dat>,<dat> NOTE/FCFPROF1 FEATURES/SCN1,, COMMENT/REPT,

          SCNVIEW1 =VIEWSET/
          RECALL/VIEWSET,SCNVIEW1
          IF/COUNT==0 DISPLAY/METAFILE, "", TO FIT, GOOD END_IF/
          IF/COUNT==0 ASSIGN/COUNT=COUNT+1 GOTO/SCN1START END_IF/


          Comment


          • #6
            3D pdf's were supposed to solve some of this, but they have enough bugs of their own.. this is pretty cool stuff.
            sigpicTAU ALPHA PI INDIANA DELTA CHAPTER
            "Due to the highly confidential nature of my job, I am not allowed to know what I am doing" - author unknown

            Comment

            Related Topics

            Collapse

            • M1chaelx
              Headpiece Question
              by M1chaelx
              good afternoon

              I always start my program with a headpiece to fill in the customer and drawing number and so on as below

              my...
              04-06-2018, 04:56 AM
            • Rploughe
              Expression information pulling with VB Script
              by Rploughe
              Hello all,

              Some little things I was curious about. Can't really figure our the syntax of.

              Code:
              Sub[SIZE=2][COLOR=#000000] Main[/COLOR]
              [/SIZE][SIZE=2][COLOR=#007f00][SIZE=2][COLOR=#007f00]'PCDMIS[/][/][/][/]
              ...
              06-20-2014, 01:39 PM
            • vpt.se
              Fetch assignments from file
              by vpt.se
              The code below retrieves lines from a textfile and adds the contents of the lines read as assignments to your active partprogram.

              Best way...
              08-27-2009, 04:08 AM
            • mrnoname
              radio button validation
              by mrnoname
              I have been trying to create a form to gather some information from the operator. I have created a form with 3 different categories that the operator...
              01-22-2018, 01:29 PM
            • Rploughe
              Operator Login
              by Rploughe
              here is a basic script for a simple operator login.

              Code:
              Sub[SIZE=2][COLOR=#000000] Main[/COLOR]
              [/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Begin[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#000000] [/COLOR][/SIZE][SIZE=2][COLOR=#0000ff][SIZE=2][COLOR=#0000ff]Dialog[/COLOR][/SIZE][/COLOR][/SIZE][SIZE=2][COLOR=#000000] DIALOG_1 50,10, 300, 125, oOPERATORINPUT[/COLOR]
              GroupBox[/]
              ...
              01-21-2014, 01:52 PM
            Working...
            X