×
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

Expression update

Expression update

Expression update

(OP)
Ha All,

I've got my standard part file tweaked to filter the document number, revision number and description. See the image beneath. These separate info is used to fill the title block. To make the expression accurate i've to use the 'update for external change' the get te accurate info. This causing the whole assembly to update. This takes to much time.

Can this update be done without the "update for external change" ?
and can this expression update be done automaticly?







Lars
NX11.0.1.11 native
Solid Edge
Inventor

RE: Expression update

(OP)
Anybody please?

Lars
NX11.0.1.11 native
Solid Edge
Inventor

RE: Expression update

Hello,

Do You wanna update date or what? I have similar problem few years ago, and in DRW file I created new attribute "DATE". It contain date from when I created those standard. When I create PDF, the journal automatically update it to time when I run this code. I have also journal to update every DWG file in folder.

With best regards
Michael

RE: Expression update

(OP)
Michael,

I want to update line 24 to 26. These are expressions which fill my title block.

Lars
NX11.0.1.11 native
Solid Edge
Inventor

RE: Expression update

Can You upload some model?

With best regards
Michael

RE: Expression update

How You change the values?

With best regards
Michael

RE: Expression update

I think, that if You change part name, the expressions still rimember old value - ug_askCurrentWorkPart(). Here is the same problem described: http://www.eng-tips.com/viewthread.cfm?qid=341667

What I can advise You - instead of using expressions, use part attributes and journal to update / change.

With best regards
Michael

RE: Expression update

Below is some code to create part atributes:

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 markId1 As Session.UndoMarkId
	markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Edit Properties")

	Dim MyTimeStamp As string
	Dim Filename as String = workpart.name

	Dim x_order_nr as String
	Dim y_rev_nr as String
	Dim Z_title as String
	Dim File_string() as String

	Dim Lw as listingwindow = theSession.ListingWindow

	'lw.open

	MyTimeStamp = System.DateTime.Now.Tostring("dd.MM.yyyy")
	'MyTimeStamp= System.DateTime.Now.Tostring("yyyy-MM-dd")

	file_string = filename.split("_")

	x_order_nr = file_string(0)
	Y_rev_nr = file_string(1)
	z_title = file_string(2)
	
	workPart.SetUserAttribute("MyTimeStamp", -1, MyTimeStamp, update.option.now)
	workPart.SetUserAttribute("x_order_nr", -1, x_order_nr, update.option.now)
	workPart.SetUserAttribute("Y_rev_nr", -1, Y_rev_nr, update.option.now)
	workPart.SetUserAttribute("z_title", -1, z_title, update.option.now)

	theSession.DeleteUndoMark(markId1, Nothing)
	'lw.close

End Sub
End Module 

With best regards
Michael

RE: Expression update

(OP)
Micheal,

This wil help I think. When I add the save command to this yournal I can use this journal to save the file always with the latest data.

Thnx.

Lars

Lars
NX11.0.1.11 native
Solid Edge
Inventor

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