Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Creating PMI notes of part attributes with NX Open (7.5.4.4) 1

Status
Not open for further replies.

evsa

Electrical
Dec 6, 2011
10
Hello,
I currently have a method for adding a PMI note to reference a part attribute which requires the user to select the piece, search for the attribute, and place the note + leader.
This process takes a few too many steps, so I'd like to simplify it by auto-generating the note text (not necessarily the placement) via NXOpen, and have the user simply select a piece, hit a button, and get his PMI Note window pulled up with the correct text for a particular attribute.

Code:
Option Strict Off
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 nullAnno As Annotations.SimpleDraftingAid = Nothing
	Dim noteBuild As Annotations.PmiNoteBuilder
	Dim noteText(0) As String
		noteText(0) = "<W!63161@PART_ATTRIBUTE_HERE>"
	noteBuild = workPart.Annotations.CreatePmiNoteBuilder(nullAnno)
         noteBuild.Text.TextBlock.SetText(noteText)

End Sub
End Module

While the above code doesn't actually do anything without some more to it, I believe it highlights the issue. Having "W!63161@" before the part attribute will only select a particular piece, and can't be used for the rest of the assembly. How do I make this work for any part?

Thank You
 
Replies continue below

Recommended for you

I presume when you say select a particular piece you are selecting a component. If this is so then in your code you simply need to have your user select the component. The component.Tag is the number to insert into the note ie "<W!" & component.Tag.ToString & "@" & PART ATTRIBUTE & ">"

Hope this helps

Frank Swinkels
 
Thanks! That ought to do the trick.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor