API help

Discussion in 'SolidWorks' started by Jean Marc, Jul 12, 2006.

  1. Jean Marc

    Jean Marc Guest

    Newbie on all these matters:
    I am trying to write a macro that change on existing drawings all tangent
    edges from "visible" to "with a style" -SetDisplayTangentEdges2 1- (not
    sure how it is said in English), and some other things.

    Anyway I got that:

    '
    ******************************************************************************
    ' C:\WINDOWS\Temp\swx3648\Macro1.swb - macro recorded on 07/12/06 by
    jmbrun18
    '
    ******************************************************************************
    Dim swApp As Object
    Dim Part As Object
    Dim SelMgr As Object
    Dim boolstatus As Boolean
    Dim longstatus As Long, longwarnings As Long
    Dim Feature As Object
    Sub main()

    Set swApp = Application.SldWorks

    Set Part = swApp.ActiveDoc
    Set SelMgr = Part.SelectionManager
    boolstatus = Part.ActivateView("Vue de mise en plan1")
    boolstatus = Part.Extension.SelectByID2("Vue de mise en plan1",
    "DRAWINGVIEW", 0.1920120113314, 0.09432764872521, 0, False, 0, Nothing, 0)
    Part.SelectionManager.GetSelectedObject3(1).SetDisplayTangentEdges2 1
    ....

    End Sub


    From that point, what do I need to keep on that code, and how to select all
    the views to change them

    TIA

    JM
     
    Jean Marc, Jul 12, 2006
    #1
  2. Jean Marc

    Tin Man Guest

    There is an example macro included with SW2006 that should do you what
    you're asking for, it's called "Activate Each View on Current Sheet
    Example (VB)".

    Also, if you're unfamiliar with the API help, it is in SolidWorks under
    the Help menu...you want to choose "SolidWorks and Add-Ins API Help
    Topics".

    And a good place to go for example macros is the API Help (mentioned
    above), Contents tab, SolidWorks API Help/Examples and Projects/Visual
    Basic(VB) Examples and the examples are ordered alphabetically. For the
    macro I mentioned in the first sentence of this post...I looked under D
    for Drawings and it was right there.

    Ken
     
    Tin Man, Jul 12, 2006
    #2
  3. Jean Marc

    Jean Marc Guest

    Thanks for the answer, couldn't make things work. Will do it manualy.
     
    Jean Marc, Jul 19, 2006
    #3
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.