3 Replies Latest reply on Oct 25, 2015 4:58 PM by Oleg Bezyaev

    What exactly does this code from Help?

    Oleg Bezyaev
      ' Define two types
      Type DoubleRec
         dValue As Double
      End Type
      
      Type Long2Rec
          iLower As Long
          iUpper As Long
      End Type
      
      ' Extract two integer values out of a single double value,
      ' by assigning a DoubleRec to the double value and
      ' copying the value over an Long2Rec and
      ' extracting the integer values.
      Function ExtractFields (ByVal dValue As Double, iLower As Long, iUpper As Long)
          Dim dr As DoubleRec
          Dim i2r As Long2Rec
          ' Set the double value
          dr.dValue = dValue
          ' Copy the values
          LSet i2r = dr
          ' Extract the values
          iLower = i2r.iLower
          iUpper = i2r.iUpper
      End Function
      

      2015 SOLIDWORKS API Help - Dimension Edge in Drawing Example (VBA)

       

      vCurveParam:

      [0]   0.59999999999999987

      [1]   0.039999999999999959

      [2]   0  

      [3]   -0.60000000000000009

      [4]   0.039999999999999959

      [5]   0  

      [6]   -1.2

      [7]   0

      [8]   6.36810936868678E-311

      [9]   1.65940070853484E-311

      [10] 1.12199579096527E-314

       

      Out results:

      ExtractFields vCurveParam(9), nDummy, nTag ' nDummy = 0 nTag = 782