Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF
Module Module1
Dim theSession As Session = Session.GetSession()
Dim theUfSession As UFSession = UFSession.GetUFSession()
Dim lw As ListingWindow = theSession.ListingWindow
Sub Main()
If IsNothing(theSession.Parts.BaseWork) Then
'active part required
Return
End If
Dim workPart As Part = theSession.Parts.Work
lw.Open()
Const undoMarkName As String = "NXJ journal"
Dim markId1 As Session.UndoMarkId
markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, undoMarkName)
For Each tempView As Drawings.DraftingView In workPart.DraftingViews
If TypeOf (tempView) Is Drawings.SectionView Then
If IsSectioned(tempView) Then
lw.WriteLine(tempView.Name & " is sectioned")
Else
lw.WriteLine(tempView.Name & " is NOT sectioned")
End If
End If
Next
lw.Close()
End Sub
Function IsSectioned(ByVal sectionView As Drawings.SectionView) As Boolean
Dim sxSolidTags() As Tag
Dim numSxSolids As Integer
theUfSession.Draw.AskSxsolidsOfSxview(sectionView.Tag, Nothing, numSxSolids, sxSolidTags)
'lw.WriteLine("num section solids: " & numSxSolids.ToString)
Return numSxSolids > 0
End Function
Public Function GetUnloadOption(ByVal dummy As String) As Integer
'Unloads the image immediately after execution within NX
GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately
End Function
End Module
Dim viewLabelTag As Tag
ufs.Draw.AskViewLabel(tempView.Tag, viewLabelTag)
Dim validViewParms As Integer = -1
Dim Labelparms1 As UFDraw.ViewLabelParms = Nothing
validViewParms = ufs.Draw.AskViewLabelParms(viewLabelTag, Labelparms1)