hexagon logo

Help with FCF dimension

I have these little OLE programs that I was updating to exe files to get rid of an annoying server busy error. And in some of our programs we have FCF dimensions that are making me crazy since they worked as a basic script but don't work as a exe file. Here is what I have for the code:

If ObjCmd.Type = 184 Then
                If Len(ObjCmd.ID) > 0 Then
                    PrevID = FCFid
                    FCFid = ObjCmd.ID
                End If
                FCFMeas = ObjCmd.GetFieldValue(LINE2_DEV, 1)
            End If


Any ideas on why it worked one way but not now?

And there used to be some examples of FCF coding on here, but I can't find it again. If you have examples you are willing to share, I would appreciate the posting of them so I could learn what you did.

Thanks so much for any help you can provide.
  • There might be an example if you search for something like output to csv
  • 1) what are you trying to do?
    2) what does not work?
  • SABarber, I had this working so that I could export the data collected on our cmms into our data collection system (WinSPC) and then we could run seamless reports of all the data collected both manually and on the cmm. Now, and I am not sure why, but I am getting a null value for all of the FCF dimensions where before our upgrade, I always had the actual value. It is weird.

    dph51, there used to be a few threads on exporting FCFs, but they don't seem to be on the forum any longer. That is where I originally found most of the coding to do what I was able to do previously. Of course I had to adjust it a bit to get what I wanted out of it. We recently upgraded from 4.2 MR1 to 2012 MR1 on all our CMMs, and then on some, we are running 2013. That was an interesting adventure.
  • there have probably been changes to the FCF over the versions. Without having a part program for example and the code you are using to extract the data we cannot know. If the data is on the pcdmis textonly report you can try using my way of determining where the FCF is being stored .

    found in:

    http://www.pcdmisforum.com/showthread.php?27490-Extracting-assignments-from-fcf-s-that-hold-multiple-features


    where instead of using:
    GETTEXT(673,1) <-- will return a string
    you will use
    GetFieldValue(673, 1) <-- will return a data value (string, int, double)
  • looking for this thread?


    /node/18104


    Thank you, yes this was one of them. I really should have favorited those pages on my browser. Slight smile
  • OK So I am really not any closer to refiguring out the FCF dimension output thing. Here is a current version that I have been working with, but I have several different things that I have tried.

    For Each ObjCmd In ObjCmds
    
                If ObjCmd.IsComment Then
                    If ObjCmd.CommentCommand.CommentType = 2 Then
                        If ObjCmd.ID = "C1" Then
                            StrC1 = ObjCmd.CommentCommand.Input
                        End If
                    End If
                End If
                If ObjCmd.IsComment Then
                    If ObjCmd.CommentCommand.CommentType = 2 Then
                        If ObjCmd.ID = "C2" Then
                            StrC2 = ObjCmd.CommentCommand.Input
                        End If
                    End If
                End If
                If ObjCmd.IsComment Then
                    If ObjCmd.CommentCommand.CommentType = 2 Then
                        If ObjCmd.ID = "C3" Then
                            StrC3 = ObjCmd.CommentCommand.Input
                        End If
                    End If
                End If
    
                If ObjCmd.IsDimension Then
                    ObjDimCmd = ObjCmd.DimensionCommand
                    If Len(ObjDimCmd.ID) > 0 Then
                        PrevID = StrDimID
                        StrDimID = ObjDimCmd.ID
                    End If
                    StrDimMeasure = ObjDimCmd.Measured
                    StrAx = ObjDimCmd.AxisLetter
                    StrDev = ObjDimCmd.Deviation
                End If
                If ObjCmd.Type = 184 Then
                    StrDimID = ObjCmd.ID
                    StrDimMeasure = ObjCmd.GetFieldValue(688, 1)
                End If
  • I have been resorting more and more to using the enumeration code since it doesn't require me to declare it and screw up the type of variable it actually is and shut down the whole thing. So the CommentType = 2 is the comment input and 184 is a feature control frame and 688 is line2_meas.

    If you have an insight, I would appreciate it.
  • I suggest that you look at the source code of the PCD2EXCEL wizard (in the Wizards subfolder) - that's the only 'documentation' I have found covering getting data out of FCF:s. There seems to be lots of code for this handling - my export script more than doubled in size when I added FCF:s, and I'm still not finished...

    Sorry, can't share the full source of my export script as it is a product we sell, but here's an extract:


    ...
    Const LINE1_SIZE_TABLE = 1
    Const LINE2_POSITION_TABLE = 2
    Const LINE3_POSITION_TABLE = 3
    Const DATUM_SHIFT_TABLE = 4
    Const SUMMARY_TABLE = 5
    Const NOT_USED = 6
    Const LINE2_ORIENTATION_TABLE = 7
    Const LINE3_ORIENTATION_TABLE = 8
    Const LINE2_BASIC_DIMENSION_TABLE = 9
    Const LINE3_BASIC_DIMENSION_TABLE = 10
    ...
    ' LINE2_BASIC_DIMENSION_TABLE --> most simple FCF dimensions, one or more features
    '
      If cmd.GetFieldValue(RPT_DIMENSION_TABLES, LINE2_BASIC_DIMENSION_TABLE) = 1 Then
    
        For i = 1 To cmd.GetDataTypeCount(LINE2_FEATNAME)
          elValueType = cmd.GetFieldValue(LINE2_FEATNAME, i)
          elAct = cmd.GetFieldValue(LINE2_MEAS, i)
          elNom = cmd.GetFieldValue(LINE2_NOMINAL, i)
          elDev = cmd.GetFieldValue(LINE2_DEV, i)
          elMtol = cmd.GetFieldValue(LINE2_MINUSTOL, i)
          elPtol = cmd.GetFieldValue(LINE2_PLUSTOL, i)
          elOutTol = cmd.GetFieldValue(LINE2_OUTTOL, i)
          elStarted = 1
          PrintLine(fNum)
        Next i
      End If
    '
    


    Edit: I strongly suggest that you should use the enumeration codes. Most of them don't need to be declared, they are defined in the type library.
  • Thanks Anders, I will play around with it and see what I can come up with. I am not a fan of FCFs at all, and what is really weird is that I run my script as a bas file and let PCDMIS handle it, and it works great, but I build it as an exe file and it errors out. It doesn't seem to make any sense at all.