Showing results for 
Search instead for 
Did you mean: 

identify IdSymbols sheet


Hello, buddies!


i have an journal that write numbers inside the IdSymbols, but it write number on whole workpart ( not sheet)


is possible to get idsymbol sheet? (on the "for each")




' NX
Imports System
Imports NXOpen

Module NXJournal
Sub Main

Dim theSession As Session = Session.GetSession()
Dim workPart As Part = theSession.Parts.Work
Dim displayPart As Part = theSession.Parts.Display
Dim markId1 As Session.UndoMarkId

		Dim dwgs As Drawings.DrawingSheetCollection
        	dwgs = workPart.DrawingSheets
        	Dim sheet As Drawings.DrawingSheet

dim tempID as object, i
i = 1
For Each tempID In workPart.Annotations.IdSymbols

Dim idSymbol1 As Annotations.IdSymbol = tempID
Dim idSymbolBuilder1 As Annotations.IdSymbolBuilder
idSymbolBuilder1 = workPart.Annotations.IdSymbols.CreateIdSymbolBuilder(idSymbol1)
idSymbolBuilder1.Origin.Plane.PlaneMethod = Annotations.PlaneBuilder.PlaneMethodType.XyPlane
Dim leaderData1 As Annotations.LeaderData
leaderData1 = workPart.Annotations.CreateLeaderData()
Dim markId2 As Session.UndoMarkId
markId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Identification Symbol")
idSymbolBuilder1.UpperText = i
theSession.SetUndoMarkName(markId2, "Identification Symbol - Text")
theSession.SetUndoMarkVisibility(markId2, Nothing, Session.MarkVisibility.Visible)
Dim markId3 As Session.UndoMarkId
markId3 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Identification Symbol")
Dim markId4 As Session.UndoMarkId
markId4 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Identification Symbol")
Dim nXObject1 As NXObject
nXObject1 = idSymbolBuilder1.Commit()
theSession.DeleteUndoMark(markId4, Nothing)

i = i + 1

End Sub
End Module


Best regards,

Guilherme Manucci


Re: identify IdSymbols sheet

Gears Honored Contributor Gears Honored Contributor
Gears Honored Contributor

Go to the GTAC solution database and search for "nx_api4936" or "report drawing sheet that selected object resides on". This is a code example can be used to determine what sheet your object is on. With this information you can filter out the unneccessary symbols.