View Information to String
View Information to String
(OP)
HI,
I need a journal to get a drafting view information(Ctrl +I) text to string (VB) to perform a check...How to get that... I am using NX 7.5..
I need a journal to get a drafting view information(Ctrl +I) text to string (VB) to perform a check...How to get that... I am using NX 7.5..





RE: View Information to String
An example of using .DisplayObjectDetails() can be found in thread:
thread561-386198: Deleting unused Planes
See the post dated: 11 May 15 20:08
www.nxjournaling.com
RE: View Information to String
My Intention is to check that whether the view have Solid section curve or not (Drafting curve Type). If they Don't have I need to change the view label as VIEW "X" else it should be SECTION "X", I have found a method to get to the Viewlabelparms for editing the label prefix but unable to segregate the views, that they are projected from outside (using section method) or they are truly sectioned. The only difference I found is the true section views have the "solid section Line" other one is not (If I am not wrong).
RE: View Information to String
CODE
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 Modulewww.nxjournaling.com
RE: View Information to String
I got this approach earlier but I have used some wrong references (I guess), It didn't worked for me..... Thanks for giving the correct code... I will update once it is verfied...
RE: View Information to String
I am unable to tag the view label for the temp view which u have highlighted a small help will be helpful...
For Each tempView As Drawings.DraftingView In workPart.DraftingViews
If TypeOf (tempView) Is Drawings.SectionView Then
Dim Tag1 As NXOpen.Tag = ' Need to tag the tempview label
Dim Labelparms1 As UFDraw.ViewLabelParms = Nothing
ufs.Draw.AskViewLabelParms(Tag1, Labelparms1)
If IsSectioned(tempView) Then
Labelparms1.view_label_prefix = "SECTION"
Else
Labelparms1.view_label_prefix = "VIEW"
End If
ufs.Draw.SetViewLabelParms(Tag1, Labelparms1)
End If
Next
RE: View Information to String
CODE
www.nxjournaling.com
RE: View Information to String
For Each tempView As Drawings.DraftingView In workPart.DraftingViews
If TypeOf (tempView) Is Drawings.SectionView Then
Dim viewLabelTag As Tag
ufs.Draw.AskViewLabel(tempView.Tag, viewLabelTag)
Dim Tag1 As NXOpen.Tag = viewLabelTag ' Need to tag the tempview label
Dim Labelparms1 As UFDraw.ViewLabelParms = Nothing
ufs.Draw.AskViewLabelParms(Tag1, Labelparms1)
If IsSectioned(tempView) Then
Labelparms1.view_label_prefix = "SECTION"
Else
Labelparms1.view_label_prefix = "VIEW"
Labelparms1.scale_label = False
End If
ufs.Draw.SetViewLabelParms(Tag1, Labelparms1)
End If
Next