Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

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

Journal Help: select all datum coordinate systems

Status
Not open for further replies.

walkjoe

Mechanical
Joined
Jan 30, 2014
Messages
2
Location
US
Hi all,

I am trying to journal the HORRIFICALLY DIFFICULT task of replacing our old NX6 title blocks with our new NX9 title blocks while keeping links to part attributes in the master model alive. (Siemens need to make this easier!!!! Like add a feature to select a new template in "edit sheet", but I digress) When importing our new drawing template into our old drawings it creates a Datum coordinate systems in the drawing file. In the journal I select the datums and delete them. The trouble comes when an old file has previous entities in its history and the Datum created isn't DATUM_CSYS(1) but is DATUM_CSYS(2) or DATUM_CSYS(3). The journal errors out and says it can't find the object. I need a solution to either skip to end of program and write a message to the user to delete the datums by hand, or a way to select all datum_csys in the drawing no matter how many there are or what they are named in the journal. I was attempting to use IF THEN to skip to the end of the program but the journal would always error out on the "Dim datumCsys1 As Features.DatumCsys = CType(workPart.Features.FindObject("DATUM_CSYS(1)"), Features.DatumCsys)" line saying object not found.

' ----------------------------------------------
' Menu: Edit->Delete...
' ----------------------------------------------

Dim notifyOnDelete7 As Boolean
notifyOnDelete7 = theSession.Preferences.Modeling.NotifyOnDelete

theSession.UpdateManager.ClearErrorList()

Dim markId60 As Session.UndoMarkId
markId60 = theSession.SetUndoMark(Session.MarkVisibility.Visible, "Delete")

Dim objects4(0) As NXObject
Dim datumCsys1 As Features.DatumCsys = CType(workPart.Features.FindObject("DATUM_CSYS(1)"), Features.DatumCsys)

objects4(0) = datumCsys1
Dim nErrs7 As Integer
nErrs7 = theSession.UpdateManager.AddToDeleteList(objects4)

Dim notifyOnDelete8 As Boolean
notifyOnDelete8 = theSession.Preferences.Modeling.NotifyOnDelete

Dim nErrs8 As Integer
nErrs8 = theSession.UpdateManager.DoUpdate(markId60)

' ----------------------------------------------
' Menu: Edit->Delete...
' ----------------------------------------------
 
Ok... that worked. A simple solution for one of the 7 steps needed to replace our title blocks. Thank you. That said I would still like to pose the question WHY is it a 6 step process (was 7)!! And yes importing the new file into the old one works great only if you are not using part attributes from the master model and the new "title block" feature. During import you lose the link to the part attributes and even system attributes like sheet 1 of 1. The "smart" NX9 title block becomes dumb, so I have to create the drafting attribute templates in the old file, import a file with only the tables of the title block with out defining them as a title block, insert a new sheet (this now creates the link to the master model part attributes), delete the sheet I just made, run a part cleanup to make sure all attribute links are refreshed (because they all don't update), define the title block and delete extra lines that are made along the sheet border during import. This is very painful for a standard task that engineering departments have to perform regularly for various reasons. i.e. New company logo or address, new engineer department standards, new versions of the software, etc.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top