Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

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

Delete Datum_CSYS

Status
Not open for further replies.

niedzviedz

Mechanical
Apr 1, 2012
307
0
0
PL
Hello everyone,

I have assembly with many parts, and in each part there is one Datum_CSYS, which I wanna delete. I write some code, based on recorded journal, but it didn't delete it.

Code:
		For Each datumCsys1  As NXOpen.Features.DatumCsys In myPart.features

			Dim markId2 As NXOpen.Session.UndoMarkId = Nothing
			markId2 = theSession.SetUndoMark(NXOpen.Session.MarkVisibility.Visible, "Delete")

			Dim objects1(0) As NXOpen.NXObject
			objects1(0) = datumCsys1
			Dim nErrs1 As Integer = Nothing

			nErrs1 = theSession.UpdateManager.AddToDeleteList(objects1)
			Dim notifyOnDelete2 As Boolean = Nothing
			notifyOnDelete2 = theSession.Preferences.Modeling.NotifyOnDelete

			Dim nErrs2 As Integer = Nothing
			nErrs2 = theSession.UpdateManager.DoUpdate(markId2)

		next
Any suggestions?


With best regards
Michael
 
Replies continue below

Recommended for you

Why don't you just change the reference set to solid or hid the layer that the datums are on?

"It is impossible to make anything foolproof because fools are so ingenious."
 
Yes after recording, Datum_CSYS is deleted. Orginaly it's this code:

Code:
Dim datumCsys1 As NXOpen.Features.DatumCsys = CType(workPart.Features.FindObject("DATUM_CSYS(0)"), NXOpen.Features.DatumCsys)

So I change it to loop.
Like I write before, this assemblies has multiple parts, so I wanna delete them by journal, instead manually delete each of them. I know, I can hide them, but they still exists in parts.



With best regards
Michael
 
Status
Not open for further replies.
Back
Top