NX 9 Problem with Datum CSYS feature
NX 9 Problem with Datum CSYS feature
(OP)
Hi
We use a few thousand offset Datum CSYS features in our designs to primarily control hole positions of complex fluid networks, thus it is very important to us that we can quickly and accurately move them around.
Our standard method in NX 7.5 and NX 8.5 was to change the Datum CSYS feature type from offset CSYS to dynamic, move the CSYS to the new positon and then change it back to offset CSYS. This has worked very well especially compared to the work flow in I-deas where we first had to measure and then modify the offset values.
But in NX9 this method has stopped working as the selected reference CSYS is lost when changing the type of the Datum CSYS feature from offset to Dynamic. We have contacted GTAC about this issue (PR 8252994) but have heard nothing for 7 months. I suspect that this is a minor UI issue relating to the update method for the Datum CSYS dialog, but with major consequences for my design department.
My questions to eng-tips are;
Below follows a step by step example first of the desired behavior in NX8.5 and then the undesired behavior in NX9, I have also attached movies showcasing the same in NX7.5, 8.5 and 9.0.
NX 8.5 Step 01 - CSYS Feature that is offset from another Datum CSYS in ABS zero.

NX 8.5 Step 02 - Editing the datum CSYS feature and changing type from Offset to Dynamic to quickly move it.

NX 8.5 Step 03 - Moving the Datum CSYS with the dynamic CSYS tool.

NX 8.5 Step 04 - Changing the type back to offset keeps the reference to the ABS datum CSYS feature.

NX 9 Step 01 - Same Setup as in NX 8.5 Step 01.

NX 9 Step 02 - Editing the offset Datum CSYS feature.

NX 9 Step 03 - Changing the type from offset to dynamic resets the Reference CSYS selection and it is not possible to quickly move the offset CSYS. Selecting a new reference CSYS and all offset values are lost.

I have performed the same test in the following NX versions
NX 7.5.5.4 MP9 - No problem
NX 8.5.3.3 - No Problem
NX 9.0.3.4 MP6 - Problem is present in all N9 Releases
We use a few thousand offset Datum CSYS features in our designs to primarily control hole positions of complex fluid networks, thus it is very important to us that we can quickly and accurately move them around.
Our standard method in NX 7.5 and NX 8.5 was to change the Datum CSYS feature type from offset CSYS to dynamic, move the CSYS to the new positon and then change it back to offset CSYS. This has worked very well especially compared to the work flow in I-deas where we first had to measure and then modify the offset values.
But in NX9 this method has stopped working as the selected reference CSYS is lost when changing the type of the Datum CSYS feature from offset to Dynamic. We have contacted GTAC about this issue (PR 8252994) but have heard nothing for 7 months. I suspect that this is a minor UI issue relating to the update method for the Datum CSYS dialog, but with major consequences for my design department.
My questions to eng-tips are;
- Is this behavior present in NX 10?
- Anybody got ideas for a workaround?
Below follows a step by step example first of the desired behavior in NX8.5 and then the undesired behavior in NX9, I have also attached movies showcasing the same in NX7.5, 8.5 and 9.0.
NX 8.5 Step 01 - CSYS Feature that is offset from another Datum CSYS in ABS zero.

NX 8.5 Step 02 - Editing the datum CSYS feature and changing type from Offset to Dynamic to quickly move it.

NX 8.5 Step 03 - Moving the Datum CSYS with the dynamic CSYS tool.

NX 8.5 Step 04 - Changing the type back to offset keeps the reference to the ABS datum CSYS feature.

NX 9 Step 01 - Same Setup as in NX 8.5 Step 01.

NX 9 Step 02 - Editing the offset Datum CSYS feature.

NX 9 Step 03 - Changing the type from offset to dynamic resets the Reference CSYS selection and it is not possible to quickly move the offset CSYS. Selecting a new reference CSYS and all offset values are lost.

I have performed the same test in the following NX versions
NX 7.5.5.4 MP9 - No problem
NX 8.5.3.3 - No Problem
NX 9.0.3.4 MP6 - Problem is present in all N9 Releases





RE: NX 9 Problem with Datum CSYS feature
www.nxjournaling.com
RE: NX 9 Problem with Datum CSYS feature
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Digital Factory
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.
RE: NX 9 Problem with Datum CSYS feature
If not, perhaps this journal will help. It will prompt you to select a datum csys feature. If the datum csys is associatively offset from another csys, it will convert the chosen datum csys to type 'dynamic' while preserving the parent offset csys.
You will then be able to move the datum csys with the manipulator handles before converting it back to an offset type datum csys.
CODE
Option Strict Off Imports System Imports System.Collections.Generic Imports NXOpen Imports NXOpen.UF Module Module1 Dim theSession As Session = Session.GetSession() Dim theUfSession As UFSession = UFSession.GetUFSession() Dim lw As ListingWindow = theSession.ListingWindow Dim init_proc_ref As UFUi.SelInitFnT = AddressOf init_proc_body Dim filter_proc_ref As UFUi.SelFilterFnT = AddressOf datumCsys_feature_filter Sub Main() If IsNothing(theSession.Parts.BaseWork) Then 'active part required Return End If Dim workPart As Part = theSession.Parts.Work Dim lw As ListingWindow = theSession.ListingWindow lw.Open() Const undoMarkName As String = "datum csys offset to dynamic" Dim markId1 As Session.UndoMarkId markId1 = theSession.SetUndoMark(Session.MarkVisibility.Visible, undoMarkName) Dim myDatumCsys As Features.Feature = SelectDatumCsysFeature("Select datum csys feature") Dim csysTag As Tag Dim originTag As Tag Dim daxesTags(2) As Tag Dim dplanesTags(2) As Tag theUfSession.Modl.AskDatumCsysComponents(myDatumCsys.Tag, csysTag, originTag, daxesTags, dplanesTags) Dim theCsys As CoordinateSystem = Utilities.NXObjectManager.Get(csysTag) Dim soParents As New List(Of SmartObject) GetSmartParents(theCsys, soParents) Dim dcOffset As Offset = GetOffset(soParents) If IsNothing(dcOffset) Then 'datum csys does not have an associative offset Return End If Dim dcParentCsys As CartesianCoordinateSystem = GetCoordinateSystem(soParents) If IsNothing(dcParentCsys) Then 'datum csys is not associated to another csys Return End If Dim markId2 As Session.UndoMarkId markId2 = theSession.SetUndoMark(Session.MarkVisibility.Invisible, "Redefine Feature") Dim datumCsysBuilder1 As Features.DatumCsysBuilder datumCsysBuilder1 = workPart.Features.CreateDatumCsysBuilder(myDatumCsys) Dim originOffset1 As Vector3d = GetOffsetVector(dcParentCsys, datumCsysBuilder1.Csys) Dim trasformMatrix1 As Matrix3x3 = GetTransformMatrix(dcParentCsys, datumCsysBuilder1.Csys) Dim xform1 As Xform xform1 = workPart.Xforms.CreateXformByDynamicOffset(dcParentCsys, originOffset1, trasformMatrix1, SmartObject.UpdateOption.WithinModeling, 1.0) Dim cartesianCoordinateSystem2 As CartesianCoordinateSystem cartesianCoordinateSystem2 = workPart.CoordinateSystems.CreateCoordinateSystem(xform1, SmartObject.UpdateOption.WithinModeling) datumCsysBuilder1.Csys = cartesianCoordinateSystem2 Dim nXObject1 As NXObject nXObject1 = datumCsysBuilder1.Commit() datumCsysBuilder1.Destroy() Dim nErrs1 As Integer nErrs1 = theSession.UpdateManager.DoUpdate(markId2) theSession.UpdateManager.InterpartDelay = False theSession.DeleteUndoMark(markId2, Nothing) lw.Close() End Sub Function SelectDatumCsysFeature(ByRef prompt As String) As Features.Feature Dim response As Integer = 0 Dim objs() As Tag = Nothing Dim user_data As System.IntPtr Dim selDCsys As Tag = Nothing Dim cursor(2) As Double Dim view As Tag = Nothing theUfSession.Ui.LockUgAccess(UFConstants.UF_UI_FROM_CUSTOM) Try theUfSession.Ui.SelectWithSingleDialog("Select Datum Csys: ", prompt, _ UFConstants.UF_UI_SEL_SCOPE_ANY_IN_ASSEMBLY, init_proc_ref, _ user_data, response, selDCsys, cursor, view) Finally theUfSession.Ui.UnlockUgAccess(UFConstants.UF_UI_FROM_CUSTOM) End Try If Not selDCsys.Equals(Tag.Null) Then Dim myDatumCsys As Features.Feature theUfSession.Disp.SetHighlight(selDCsys, 0) myDatumCsys = Utilities.NXObjectManager.Get(selDCsys) Return myDatumCsys Else Return Nothing End If End Function Function init_proc_body(ByVal select_ As IntPtr, _ ByVal userdata As IntPtr) As Integer Dim num_triples As Integer = 1 Dim mask_triples As UFUi.Mask() = New UFUi.Mask(0) {} mask_triples(0).object_type = UFConstants.UF_feature_type mask_triples(0).object_subtype = 0 mask_triples(0).solid_type = 0 theUfSession.Ui.SetSelMask(select_, _ UFUi.SelMaskAction.SelMaskClearAndEnableSpecific, _ num_triples, mask_triples) theUfSession.Ui.SetSelProcs(select_, filter_proc_ref, Nothing, userdata) Return UFConstants.UF_UI_SEL_SUCCESS End Function Function datumCsys_feature_filter(ByVal _object As Tag, _ ByVal type As Integer(), _ ByVal user_data As IntPtr, _ ByVal select_ As IntPtr) As Integer Dim myFeature As Features.Feature = Nothing myFeature = Utilities.NXObjectManager.Get(_object) If myFeature.FeatureType = "DATUM_CSYS" Then Return UFConstants.UF_UI_SEL_ACCEPT Else Return UFConstants.UF_UI_SEL_REJECT End If End Function Sub GetSmartParents(ByVal theSmartObject As SmartObject, ByRef theSmartObjectList As List(Of SmartObject)) Dim numParents As Integer Dim theParentTags() As Tag = Nothing Try theUfSession.So.AskParents(theSmartObject.Tag, UFConstants.UF_SO_ASK_SO_PARENTS, numParents, theParentTags) For Each tempTag As Tag In theParentTags Dim objParent As TaggedObject = Utilities.NXObjectManager.Get(tempTag) theSmartObjectList.Add(objParent) GetSmartParents(objParent, theSmartObjectList) Next Catch ex As NXException lw.WriteLine("error: " & ex.ErrorCode) lw.WriteLine(" " & ex.Message) End Try End Sub Function GetOffset(ByVal theList As List(Of SmartObject)) As Offset For Each temp As SmartObject In theList If TypeOf (temp) Is Offset Then Return temp End If Next Return Nothing End Function Function GetCoordinateSystem(ByVal theList As List(Of SmartObject)) As CartesianCoordinateSystem For Each temp As SmartObject In theList If TypeOf (temp) Is CartesianCoordinateSystem Then Return temp End If Next Return Nothing End Function Function GetXform(ByVal theList As List(Of SmartObject)) As Xform For Each temp As SmartObject In theList If TypeOf (temp) Is Xform Then Return temp End If Next Return Nothing End Function Function GetTransformMatrix(ByVal fromCsys As CartesianCoordinateSystem, ByVal toCsys As CartesianCoordinateSystem) As Matrix3x3 Dim fromOrigin() As Double = {fromCsys.Origin.X, fromCsys.Origin.Y, fromCsys.Origin.Z} Dim fromXAxis() As Double = {fromCsys.Orientation.Element.Xx, fromCsys.Orientation.Element.Xy, fromCsys.Orientation.Element.Xz} Dim fromYAxis() As Double = {fromCsys.Orientation.Element.Yx, fromCsys.Orientation.Element.Yy, fromCsys.Orientation.Element.Yz} Dim toOrigin() As Double = {toCsys.Origin.X, toCsys.Origin.Y, toCsys.Origin.Z} Dim toXAxis() As Double = {toCsys.Orientation.Element.Xx, toCsys.Orientation.Element.Xy, toCsys.Orientation.Element.Xz} Dim toYAxis() As Double = {toCsys.Orientation.Element.Yx, toCsys.Orientation.Element.Yy, toCsys.Orientation.Element.Yz} Dim mtx4Transform(15) As Double theUfSession.Mtx4.CsysToCsys(fromOrigin, fromXAxis, fromYAxis, toOrigin, toXAxis, toYAxis, mtx4Transform) Dim transformMatrix1 As Matrix3x3 transformMatrix1.Xx = mtx4Transform(0) transformMatrix1.Xy = mtx4Transform(4) transformMatrix1.Xz = mtx4Transform(8) transformMatrix1.Yx = mtx4Transform(1) transformMatrix1.Yy = mtx4Transform(5) transformMatrix1.Yz = mtx4Transform(9) transformMatrix1.Zx = mtx4Transform(2) transformMatrix1.Zy = mtx4Transform(6) transformMatrix1.Zz = mtx4Transform(10) Return transformmatrix1 End Function Function GetOffsetVector(ByVal fromCsys As CartesianCoordinateSystem, ByVal toCsys As CartesianCoordinateSystem) As Vector3d Dim fromOrigin() As Double = {fromCsys.Origin.X, fromCsys.Origin.Y, fromCsys.Origin.Z} Dim fromXAxis() As Double = {fromCsys.Orientation.Element.Xx, fromCsys.Orientation.Element.Xy, fromCsys.Orientation.Element.Xz} Dim fromYAxis() As Double = {fromCsys.Orientation.Element.Yx, fromCsys.Orientation.Element.Yy, fromCsys.Orientation.Element.Yz} Dim toOrigin() As Double = {toCsys.Origin.X, toCsys.Origin.Y, toCsys.Origin.Z} Dim toXAxis() As Double = {toCsys.Orientation.Element.Xx, toCsys.Orientation.Element.Xy, toCsys.Orientation.Element.Xz} Dim toYAxis() As Double = {toCsys.Orientation.Element.Yx, toCsys.Orientation.Element.Yy, toCsys.Orientation.Element.Yz} Dim mtx4Transform(15) As Double theUfSession.Mtx4.CsysToCsys(fromOrigin, fromXAxis, fromYAxis, toOrigin, toXAxis, toYAxis, mtx4Transform) Dim theOffset As Vector3d theOffset.X = mtx4Transform(3) theOffset.Y = mtx4Transform(7) theOffset.Z = mtx4Transform(11) Return theOffset End Function Function GetUnloadOption(ByVal dummy As String) As Integer 'Unloads the image immediately after execution within NX GetUnloadOption = NXOpen.Session.LibraryUnloadOption.Immediately End Function End Modulewww.nxjournaling.com
RE: NX 9 Problem with Datum CSYS feature
Cowski: Thanks a lot! Very clever and simple approach.
RE: NX 9 Problem with Datum CSYS feature
John R. Baker, P.E.
Product 'Evangelist'
Product Engineering Software
Siemens PLM Software Inc.
Digital Factory
Cypress, CA
Siemens PLM:
UG/NX Museum:
To an Engineer, the glass is twice as big as it needs to be.