Done with pdf moving on to dxf

Discussion in 'SolidWorks' started by ronsharo, Mar 10, 2009.

  1. ronsharo

    ronsharo Guest

    Hi All,

    With your help Ive succeeded and more importantly I understood how to
    make a macro that save's a drawing sheet as pdf.

    Now I'm moving on to a dxf.

    The only thing that matters to me is that the scale is 1:1

    I tried that:

    if swapp.DxfOutputScaleFactor<>1 then
    swapp.DxfOutputScaleFactor=1

    but got an "Object does not support this property or method" error

    What am I doing wrong?

    Thanks
    Ron.
     
    ronsharo, Mar 10, 2009
    #1
  2. ronsharo

    Mike Guest

    Ron,

    DxfOutputScaleFactor is not an API object or method. You can
    retrieve its value using the GetUserPreferenceDoubleValue method and
    save it using SetUserPreferenceDoubleValue.

    Use this:
    Dim bResult As Boolean
    If swApp.GetUserPreferenceDoubleValue(swDxfOutputScaleFactor) <> 1
    Then
    bResult = swApp.SetUserPreferenceDoubleValue
    (swDxfOutputScaleFactor, 1)
    If bResult = False Then
    MsgBox "Failed to set 'swDxfOutputScaleFactor' to 1",
    vbCritical
    End If
    End If

    Mike
     
    Mike, Mar 11, 2009
    #2
  3. ronsharo

    ronsharo Guest

    Got it all except the vbcritical...

    Thanks.
     
    ronsharo, Mar 11, 2009
    #3
  4. ronsharo

    ronsharo Guest

    Now I got it - its part of the MsgBOX

    Thanks
     
    ronsharo, Mar 11, 2009
    #4
  5. ronsharo

    Mike Guest

    Ron,

    This is a pretty good group but for API questions I would use the
    SolidWorks-API google group or SolidWorks hosted forums instead. They
    are focused on API related info while this one is very generic.

    Mike
     
    Mike, Mar 12, 2009
    #5
  6. ronsharo

    ronsharo Guest

    Thanks Mike

    See you There :)
     
    ronsharo, Mar 13, 2009
    #6
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.