×
INTELLIGENT WORK FORUMS
FOR ENGINEERING PROFESSIONALS

Log In

Come Join Us!

Are you an
Engineering professional?
Join Eng-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Eng-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

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

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

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

(OP)
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 --> VBA

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

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

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

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

(OP)
Thanks! That ought to do the trick.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Eng-Tips Forums free from inappropriate posts.
The Eng-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Eng-Tips forums is a member-only feature.

Click Here to join Eng-Tips and talk with other members!


Resources