Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Balloon ID Seach in Drafting 1

Status
Not open for further replies.

cadcamengineerrec

Mechanical
Feb 3, 2006
5
Hi,

I am using NX6.0.2.8 MP7,
I have an Assembly contains nearly 1600 parts and the balloons Id(Call out) is created manualy by 'Id Symbol' for all the parts.
I need to search the "Balloon ID" by entering the balloon ID number and
I need to know, how many times it present in the same drawing sheet.
Is there any possibilities to do this? if any one has any utility please share it?

(Already i raised this query in GTAC,but No Solution)


Thanks in advance,
Suresh G


 
Replies continue below

Recommended for you

I hope this will help to you. Only you must create an array to collect the different id symbols.
Imports System.Collections
Imports NXOpen
Imports NXOpen.Annotations
Imports NXOpen.UF

Public Class report_all_id_symbols
' class members
Private Shared theSession As Session
Private Shared theUI As UI
Private Shared ufs As UFSession
Private Shared lw As ListingWindow

Public Shared Function Main(args As String()) As Integer
theSession = Session.GetSession()
theUI = UI.GetUI()
ufs = UFSession.GetUFSession()
lw = theSession.ListingWindow

Try
Dim idCol As IdSymbolCollection = theSession.Parts.Work.Annotations.IdSymbols
Dim ids As IdSymbol
Dim iEnum1 As IEnumerator = idCol.GetEnumerator()
iEnum1.Reset()
While iEnum1.MoveNext()
ids = DirectCast(iEnum1.Current, IdSymbol)
lw.Open()
lw.WriteLine(vbLf & "Symbol: " & ids.Tag.ToString())

Dim idsb As IdSymbolBuilder = idCol.CreateIdSymbolBuilder(ids)
lw.WriteLine(" Text: " + idsb.UpperText)
lw.WriteLine(" Origin: " & idsb.Origin.OriginPoint.ToString())

Dim lb As LeaderBuilder = idsb.Leader
Dim ldl As LeaderDataList = lb.Leaders
lw.WriteLine(" Number of LeaderData: " + ldl.Length.ToString())
For i As Integer = 0 To ldl.Length-1
Dim ld As LeaderData = ldl.FindItem(i)
lw.WriteLine(" LeaderData No." & i & ": " & ld.ToString())

lw.WriteLine(" Stub Size: " & ld.StubSize.ToString())
lw.WriteLine(" Stub Side: " & ld.StubSide.ToString())
' Perpendicular as of NX7
' lw.WriteLine(" Perpendicular: " + ld.Perpendicular.ToString());
lw.WriteLine(" Arrowhead: " & ld.Arrowhead.ToString())

Dim selection1 As DisplayableObject
Dim view1 As View
Dim point1 As Point3d
ld.Leader.GetValue(selection1, view1, point1)
lw.WriteLine(" Leader view: " & view1.Name)
lw.WriteLine(" Leader view type: " + view1.GetType().ToString())
lw.WriteLine(" Leader point: " & point1.ToString())

If( view1.GetType().ToString() <> "NXOpen.View" ) Then
Dim model_pt(2) As double
model_pt(0) = point1.X
model_pt(1) = point1.Y
model_pt(2) = point1.Z
Dim map_pt(1) As double

ufs.View.MapModelToDrawing(view1.Tag, model_pt, map_pt)
lw.WriteLine(" Mapped Leader point: X=" & map_pt(0).ToString() & " ,Y= " & map_pt(1).ToString() )
End If


lw.WriteLine(" Number of jogs: " & ld.Jogs.Size.ToString())
Dim jogs As SelectObject() = ld.Jogs.GetSelectObjectArray()
For Each jog As SelectObject In jogs
lw.WriteLine(" Jog: " & jog.ToString())
Dim selection2 As TaggedObject
Dim view2 As View
Dim point2 As Point3d
jog.GetValue(selection2, view2, point2)
lw.WriteLine(" Jog point: " & point2.ToString())
Next
Next

idsb.Destroy()

lw.WriteLine(" Number of Associativities: " + ids.NumberOfAssociativities.ToString())
For i As Integer = 1 To ids.NumberOfAssociativities
Dim assoc As Associativity = ids.GetAssociativity(i)
lw.WriteLine(" Assoc No." & i & ": " & assoc.ToString())
lw.WriteLine(" ObjectView : " + assoc.ObjectView.Name)

Dim obj As NXObject = assoc.FirstObject
If obj Is Nothing Then
lw.WriteLine(" FirstObject : null")
Else
lw.WriteLine(" FirstObject : " & obj.ToString())
lw.WriteLine(" Owning Part: " + obj.OwningPart.FullPath)
If obj.IsOccurrence Then
lw.WriteLine(" Owning Component: " + obj.OwningComponent.Name)
End If
End If
Next
End While
Catch ex As NXOpen.NXException
UI.GetUI().NXMessageBox.Show("Message", NXMessageBox.DialogType.[Error], ex.Message)
End Try
Return 0
End Function

Public Shared Function GetUnloadOption(arg As String) As Integer
Return System.Convert.ToInt32(Session.LibraryUnloadOption.Immediately)
End Function

End Class
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor