VB: MathVector

Discussion in 'SolidWorks' started by George, Apr 28, 2004.

  1. George

    George Guest

    Does anyone know how to create a MathVector for SolidWorks?

    I thought it was an arrary of three Doubles
    "Dim myVector(3) As Double...", but that doesn't seem to work.

    Could anyone help me out?
     
    George, Apr 28, 2004
    #1
  2. apihelp.chm, select the MathVector topic, check the "accessors" link :
    you get MathUtility::CreateVector.

    a MathVector is a COM object which contains 3 doubles, but also methods.
    Those Math... beasts were introduced in SW2003 only
    Many older APIs use variants of 3 doubles instead.
     
    Philippe Guglielmetti, Apr 29, 2004
    #2
  3. George

    TV Guest

    I have used:

    Dim MathUtil As MathUtility
    Dim MathP As MathPoint
    Dim MathV0 As MathVector
    Dim PointCoords(2) As Double 'Remember that "0" is the first
    coordinate so I have 3 values


    Set MathUtil = swApp.GetMathUtility
    Set MathP = MathUtil.CreatePoint(PointCoords)
    Set MathV0 = MathP.ConvertToVector

    It is probably not the bedst way, but it was effektive for my purpose.

    Thomas
     
    TV, Apr 29, 2004
    #3
  4. Philippe,
    Sorry for taking so long to reply.
    I was wrong above.
    Fourth & fourth? It's usually a 3 X 4 matrix. For geometry ...
    translation.

    Scaling:
    "The canonial form of the matrix which scales the units in the
    secondary
    coordinate system is obtained by multiplying the unit vectors
    representing
    the secondary axes by the scale factor"(s).

    IE,
    2,0,0,0
    0,2,0,0
    0,0,2,0

    Each axes can have a different scale applied.

    Example:
    2,0,0,0
    0,3,0,0
    0,0,1,0

    Hope I got something right <g>. The memory fades ....
     
    Cliff Huprich, Apr 29, 2004
    #4
  5. George

    George Guest

    Thomas,
    Thanks a bunch!
    That worked perfectly. I'm now able to move parts in my assembly.

    Hopefully I'll be able to finish this VB program soon.
     
    George, Apr 29, 2004
    #5
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Similar Threads
There are no similar threads yet.
Loading...