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?

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
Lars
NX11.0.1.11 native
Solid Edge
Inventor
RE: Expression update
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
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
With best regards
Michael
RE: Expression update
See the uploaded file here
Lars
NX11.0.1.11 native
Solid Edge
Inventor
RE: Expression update
With best regards
Michael
RE: Expression update
What I can advise You - instead of using expressions, use part attributes and journal to update / change.
With best regards
Michael
RE: Expression update
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 ModuleWith best regards
Michael
RE: Expression update
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