cancel
Showing results for 
Search instead for 
Did you mean: 

identify IdSymbols sheet

Experimenter
Experimenter

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")

 

code:

 

' NX 6.0.0.24
' NUMERA AUTOMATICAMENTE
'
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()
idSymbolBuilder1.Leader.Leaders.Append(leaderData1)
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)
idSymbolBuilder1.Destroy()

i = i + 1
next
'msgbox(i)

End Sub
End Module

 

Best regards,

Guilherme Manucci

1 REPLY

Re: identify IdSymbols sheet

Phenom
Phenom

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.