Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations IDS on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

Solidworks API VBA broken view Help

Status
Not open for further replies.

shotime

Mechanical
Feb 6, 2012
1
Hello,

I'm looking for help coding a break in a drawing view. The code below is what I have so far. It will only add the lines but not in the proper location.

Any help would be appreciated.

Thanks

Dim longstatus As Long, longwarnings As Long
Dim FeatureData As Object
Dim Feature As Object
Dim Component As Object
Dim BreakLine As Object
Dim SelMgr As SelectionMgr
Dim vPos As Variant
Dim xPos1 As Double
Dim xPos2 As Double
Dim retval As Boolean

Sub main()

Set swApp = Application.SldWorks

Set Part = swApp.ActiveDoc
boolstatus = Part.Extension.SelectByID("Drawing View1", "DRAWINGVIEW", 0, 0, 0, False, 0, Nothing)
Part.InsertBreakVertical

xPos1 = 0.15
xPos2 = 0.2
boolstatus = BreakLine.SetPosition(xPos1, xPos2)

Part.EditRebuild3 (swCurrentSheetDisp)

End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor