API help

Jul 12, 2006 2 Replies

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


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" a écrit dans le message de news: snipped-for-privacy@35g2000cwc.googlegroups.com...

Thanks for the answer, couldn't make things work. Will do it manualy.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required