API: 2nd posting please help! [was API: Eeeek! "Ghost" on edges of generated drawing w/properties]

Discussion in 'SolidWorks' started by plh, Feb 16, 2004.

  1. plh

    plh Guest

    Hello everyone,
    I am creating a utility which generates formatted drawing sheets from a user
    form. The problem I am having is that when the form appears on the screen, the
    image does not seem to fill the whole window pane. The left and top edges have a
    kind of "ghost" on them. If anyone wants to help I will be glad to send a screen
    (scream?) shot. There is about a 1/4" margin on the top and left hand sides that
    acts as if the drawing is not filling it. If I "ALT/TAB" to another window, then
    back, when I go back the margins contain left over image from the previous
    window. If I maximize and then go back to partial size, the band goes away on
    the top but remains on the left. I have tried it on two different computers, one
    Win2000 and one WinXP. Same thing. If I minimize then maximize again, it returns
    to the top and the left as well. The drawing itself seems to "work" OK, but
    those edges just look nasty.
    The part of the code that actually generates the drawing is below. There are
    other routines that take user input from a form to set up the properties. I
    thank in advance everyone who offers any help!
    -plh

    Private Sub cmbMakeItSo_Click()
    Dim bolRtn As Boolean

    Set swApp = Application.SldWorks

    Select Case intSize
    Case 0
    Set swDrawing = swApp.NewDocument(A_FORMATSHEET, swDwgPaperAsize, 0#, 0#)
    Case 2
    Set swDrawing = swApp.NewDocument(B_FORMATSHEET, swDwgPaperBsize, 0#, 0#)
    Case 3
    Set swDrawing = swApp.NewDocument(C_FORMATSHEET, swDwgPaperBsize, 0#, 0#)
    Case 4
    Case Else
    MsgBox ("Unexpected result in Case Else @ cmbMakeItSo_Click()")
    End Select
    Set swDoc = swApp.ActiveDoc
    swDoc.SummaryInfo(swSumInfoAuthor) = strAuthor
    swDoc.SummaryInfo(swSumInfoComment) = strTitle
    bolRtn = swDoc.AddCustomInfo2("Material", swCustomInfoText, strMaterial)
    bolRtn = swDoc.AddCustomInfo2("Revision", swCustomInfoText, strRev)
    'swDoc.FileSummaryInfo

    End Sub

    I keep hitting "Esc", but I'm still here!
    (If "123" is in the email address that's and anti-spam thing - remove it)
     
    plh, Feb 16, 2004
    #1
  2. plh

    TheTick Guest

    perhaps set the form's autoredraw property to 'True'...
     
    TheTick, Feb 17, 2004
    #2
  3. plh

    B Waggoner Guest

    I have seen the ghost border you are talking about. The only time I
    get it is if I try to open a sheet format thru windows explorer. If
    you do a new drawing and then pick the sheet format that you want, I
    don't get the ghost image. I would recommend doing it this way. We
    were able to recreate this problem on another machine doing the same
    process.
    I hope that helps.
     
    B Waggoner, Feb 17, 2004
    #3
  4. plh

    Gabe Osten Guest

    plh,

    Perhaps you should try using a different SW function. We have a very
    similar system here - the user selects a drawing size from a custom form,
    then the program generates the drawing, adds the standard three views, and
    saves the file with the correct file name and in the correct location. We
    use the following line to create the drawing:

    Set swDwg = swApp.OpenDoc2(Buffer & ".drwdot", swDocDRAWING, True,
    False, True, errLong)

    -Gabe
     
    Gabe Osten, Feb 17, 2004
    #4
  5. plh

    rocheey Guest

    I am creating a utility which generates formatted drawing sheets
    Ok, so when you say "Sheets" you are rfeferring to SolidWorks. and
    when you say "Form" you are referring to VB/A UserForm ?

    Again, if you mean the 'ghost' is on the userform, then it sounds like
    you
    are using the OLE control?
     
    rocheey, Feb 17, 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.