ds-blue-logo
Preview  |  SOLIDWORKS USER FORUM
Use your SOLIDWORKS ID or 3DEXPERIENCE ID to log in.
NTNick Tanner05/10/2021

I'm trying to write (plagiarize) a macro that amongst other things sets all views in turn to use the correct line for tangent edges. It would be great if I could skip any views where tangent edges are hidden. Is there a check I can run that returns the current status?

Going round in circles trying to follow the SW manuals so thought I'd reach out.

Current routine (based on one found in an old forum):


Sub Tangent_Routine()

Set swApp = Nothing
Set swModel = Nothing
Set swDrawDoc = Nothing
Set swView = Nothing
Set swApp = Application.SldWorks
Set swModel = swApp.ActiveDoc
If swModel Is Nothing Then Exit Sub
If swModel.GetType = swDocumentTypes_e.swDocDRAWING Then
iDisplayIn = swDisplayTangentEdges_e.swTangentEdgesVisibleAndFonted
Set swDrawDoc = swModel
lViewCount = swDrawDoc.GetViewCount
vSheets = swDrawDoc.GetViews

For lSheetCount = LBound(vSheets) To UBound(vSheets)

vViews = vSheets(lSheetCount)

For lViewCount = LBound(vViews) To UBound(vViews)
vViews(lViewCount).SetDisplayTangentEdges2 (iDisplayIn)
Next
Next
End If

End Sub