hexagon logo

output code to basic to learn coding

I am working on some code that requires creation of generic features.

So, I remember what the Hex guys say, "Just export the code you need to learn as basic, and glean all the knowledge".

So, I output this generic circle as a basic to learn the code that describes it.

A generic circle with a DIAMETER of 2.

CIR1       =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
            NOM/XYZ,<0,1,0>,$
            MEAS/XYZ,<0,1,0>,$
            NOM/IJK,<0,0,1>,$
            MEAS/IJK,<0,0,1>,$
            DIAMETER/2,2


This is the code it exports.

  Set DmisCommand = DmisCommands.Add(GENERIC_CONSTRUCTION, True)
    DmisCommand.Marked = True
    retval = DmisCommand.PutText ("0", THEO_X, 0)
    retval = DmisCommand.PutText ("1", THEO_Y, 0)
    retval = DmisCommand.PutText ("0", THEO_Z, 0)
    retval = DmisCommand.PutText ("0", THEO_X2, 0)
    retval = DmisCommand.PutText ("1", THEO_Y2, 0)
    retval = DmisCommand.PutText ("0", THEO_Z2, 0)
    retval = DmisCommand.PutText ("0", THEO_I, 0)
    retval = DmisCommand.PutText ("0", THEO_J, 0)
    retval = DmisCommand.PutText ("1", THEO_K, 0)
    retval = DmisCommand.PutText ("2", THEO_DIAM, 0)
    retval = DmisCommand.PutText ("0", MEAS_X, 0)
    retval = DmisCommand.PutText ("1", MEAS_Y, 0)
    retval = DmisCommand.PutText ("0", MEAS_Z, 0)
    retval = DmisCommand.PutText ("0", MEAS_X2, 0)
    retval = DmisCommand.PutText ("1", MEAS_Y2, 0)
    retval = DmisCommand.PutText ("0", MEAS_Z2, 0)
    retval = DmisCommand.PutText ("0", MEAS_I, 0)
    retval = DmisCommand.PutText ("0", MEAS_J, 0)
    retval = DmisCommand.PutText ("1", MEAS_K, 0)
    retval = DmisCommand.PutText ("2", MEAS_DIAM, 0)
    retval = DmisCommand.PutText ("CIR1", ID, 0)
    retval = DmisCommand.SetToggleString (4, GEN_FEAT_TYPE, 0)
    retval = DmisCommand.SetToggleString (1, GEN_ALIGN_TYPE, 0)
    retval = DmisCommand.SetToggleString (1, COORD_TYPE, 0)
    retval = DmisCommand.SetToggleString (1, INOUT_TYPE, 0)


So, silly me, I think if I just import this code, it will work.

This is what I get.

CIR1       =GENERIC/CIRCLE,DEPENDENT,CARTESIAN,OUT,$
            NOM/XYZ,<0,1,0>,$
            MEAS/XYZ,<0,1,0>,$
            NOM/IJK,<0,0,1>,$
            MEAS/IJK,<0,0,1>,$
            [SIZE=2][COLOR=#ff0000]RADIUS[/COLOR][/SIZE]/2,2

A generic circle with a RADIUS of 2. Angry

i guess PCDMIS looks at the generic circle and finds the 'hardcoded' primary radio button value and exports it. i.e. RADIUS is the default selection that you manually change to DIAMETER.

I love workarounds.Rolling eyes
Parents
  • I have run into BASIC exports missing little bits of required information, for example the ID of an Xactmeasure dimension.

    I'm looking at the Edit window, and I see what the issue is. Diameter and Radius are not blue and editable like Feature Type, Coord Type, etc, so it is not a variable field that gets a SetToggleString.

    FWIW, I have always thought it lame to make Radius the default when 99% of circles In Real Life are defined and dimensioned as Diameters.
Reply
  • I have run into BASIC exports missing little bits of required information, for example the ID of an Xactmeasure dimension.

    I'm looking at the Edit window, and I see what the issue is. Diameter and Radius are not blue and editable like Feature Type, Coord Type, etc, so it is not a variable field that gets a SetToggleString.

    FWIW, I have always thought it lame to make Radius the default when 99% of circles In Real Life are defined and dimensioned as Diameters.
Children
No Data