Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Detailed view information thru NXOPEN 2

Status
Not open for further replies.

man2007

Aerospace
Joined
Nov 6, 2007
Messages
283
Location
IN
Is there any function in NXOPEN that is used to get the Detailed View information like
Detailed View Parent, Label on parent etc. along with other related information.

We are using NX 7.5 & VS2008
 
Here's a quick example:

Code:
[COLOR=blue]Option[/color] [COLOR=blue]Strict[/color] [COLOR=blue]Off[/color]  
[COLOR=blue]Imports[/color] System  
[COLOR=blue]Imports[/color] NXOpen  

[COLOR=blue]Module[/color] Module1  

	Sub Main()  

		Dim theSession [COLOR=blue]As[/color] Session [COLOR=blue]=[/color] Session.GetSession()  
		Dim workPart [COLOR=blue]As[/color] Part [COLOR=blue]=[/color] theSession.Parts.Work  
		Dim lw [COLOR=blue]As[/color] ListingWindow [COLOR=blue]=[/color] theSession.ListingWindow  
		lw.Open()  
		Dim dwgSheets() [COLOR=blue]As[/color] Drawings.DrawingSheet  
		Dim dwgViews() [COLOR=blue]As[/color] Drawings.DraftingView  
		  
		dwgSheets [COLOR=blue]=[/color] workPart.DrawingSheets.ToArray  
		For [COLOR=blue]Each[/color] dwgSheet [COLOR=blue]As[/color] Drawings.DrawingSheet [COLOR=blue]In[/color] dwgSheets  
			dwgViews [COLOR=blue]=[/color] dwgSheet.GetDraftingViews  
			For [COLOR=blue]Each[/color] dwgView [COLOR=blue]As[/color] Drawings.DraftingView [COLOR=blue]In[/color] dwgViews  
				  [COLOR=green]'lw.WriteLine("View type: " & dwgView.GetType.ToString)[/color]
				If [COLOR=blue]TypeOf[/color] (dwgView) [COLOR=blue]Is[/color] Drawings.DetailView [COLOR=blue]Then[/color]  
					lw.WriteLine(dwgView.Name)  
					lw.WriteLine("Located on: " [COLOR=blue]&[/color] dwgSheet.Name)  
					Dim detailViewBuilder1 [COLOR=blue]As[/color] Drawings.DetailViewBuilder  
					detailViewBuilder1 [COLOR=blue]=[/color] workPart.DraftingViews.CreateDetailViewBuilder(dwgView)  
					With detailViewBuilder1  
						lw.WriteLine("Parent View: " [COLOR=blue]&[/color] .Parent.View.Value.Name)  
						lw.WriteLine("Label [COLOR=blue]on[/color] parent: " [COLOR=blue]&[/color] .LabelOnParent.ToString)  
						lw.WriteLine("Is associative: " [COLOR=blue]&[/color] .Associative.ToString)  
						lw.WriteLine("Scale: " [COLOR=blue]&[/color] .Scale.Numerator [COLOR=blue]&[/color] ":" [COLOR=blue]&[/color] .Scale.Denominator)  
						lw.WriteLine("Boundary point 1: " [COLOR=blue]&[/color] .BoundaryPoint1.Coordinates.ToString)  
						lw.WriteLine("Boundary point 2: " [COLOR=blue]&[/color] .BoundaryPoint2.Coordinates.ToString)  
						lw.WriteLine("Alignment method: " [COLOR=blue]&[/color] .Origin.AlignmentMethod.ToString)  
					End [COLOR=blue]With[/color]  
					lw.WriteLine("Rendering style: " [COLOR=blue]&[/color] dwgView.RenderingStyle.ToString)  
					lw.WriteLine("Is [COLOR=blue]out[/color] [COLOR=blue]of[/color] date?: " [COLOR=blue]&[/color] dwgView.IsOutOfDate.ToString)  
					lw.WriteLine("Is active [COLOR=blue]for[/color] sketching?: " [COLOR=blue]&[/color] dwgView.IsActiveForSketching)  
		  
					detailViewBuilder1.Destroy()  
				End [COLOR=blue]If[/color]  
			Next  
			lw.WriteLine("")  
		Next  


	End [COLOR=blue]Sub[/color]  


	Public [COLOR=blue]Function[/color] GetUnloadOption(ByVal dummy [COLOR=blue]As[/color] [COLOR=blue]String[/color]) [COLOR=blue]As[/color] [COLOR=blue]Integer[/color]  
	  
		  [COLOR=green]'Unloads the image when the NX session terminates[/color]
		GetUnloadOption [COLOR=blue]=[/color] NXOpen.Session.LibraryUnloadOption.AtTermination  
	  
	End [COLOR=blue]Function[/color]  

End [COLOR=blue]Module[/color]


www.nxjournaling.com
 
Thank you very much cowski, this is what we were looking for.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top