×
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

Isometric And Trimetric view of current WCS?
2

Isometric And Trimetric view of current WCS?

Isometric And Trimetric view of current WCS?

(OP)
Hi everyone, that's my first thread.

I have no idea how to write a journal that sets Isometric or Trimetric view of current WCS.
Default views are assigned with Csys. I can get the matrix of the Isometric view by recording a journal, but I don't know how to translate the matrix from main csys to wcs.

Any ideas?



RE: Isometric And Trimetric view of current WCS?

(OP)
For example Matrix3x3 for Trimetric View looks like:

matrix.Xx = 0,63121905864763
matrix.Xy = 0,775604602874429
matrix.Xz = 0
matrix.Yx = -0,291176881826266
matrix.Yy = 0,236971772169955
matrix.Yz = 0,926855114181588
matrix.Zx = 0,718873092756943
matrix.Zy = -0,585048612676443
matrix.Zz = 0,375419228750255

And my WCS matrix3x3 is:

WCS.Xx = 0
WCS.Xy = 1
WCS.Xz = 0
WCS.Yx = 0
WCS.Yy = 0
WCS.Yz = 1
WCS.Zx = 1
WCS.Zy = 0
WCS.Zz = 0





RE: Isometric And Trimetric view of current WCS?

orient the view to current wcs,
goto PNT open the view navigator rmb on the modelview container create a new view set - activate the projections you like to have from the current view

RE: Isometric And Trimetric view of current WCS?

To get the trimetric view of the work coordinate you need to matrix multiply the work coordinates matrix times the trimetric view matrix to get the new view matrix.

For the simple position of your wcs example which is such that the wcs x axis is the abs z axis, the wcs y axis is unchanged as the abs y axis and the wcs z axis is the abs x axis. Therefore in this case you need only interchange the trimetrc row 1 and row 3 in the trimetric matrix. Doing the matrix multiplication (in the correct order) will show you that you get the above result.

Is this what you are looking for or did you want the journal code?

Frank Swinkels

RE: Isometric And Trimetric view of current WCS?

(OP)
Thanks a lot!
I wrote a journal and it works fine, here is a code:

CODE -->

Option Strict Off
Imports System
Imports NXOpen
Imports NXOpen.UF

Module NXJournal
Sub Main
Dim theSession As Session = Session.GetSession()
Dim theUFSession As UFSession = UFSession.GetUFSession()
Dim displayPart As Part = theSession.Parts.Display

Dim workPart As Part = theSession.Parts.Work
Dim lw As ListingWindow = theSession.ListingWindow

Dim myWcs As CoordinateSystem = theSession.Parts.Display.WCS.CoordinateSystem

Dim myMtx As Matrix3x3 = myWcs.Orientation.Element
Dim currentView As View = displayPart.Views.WorkView()
Dim myMatrix As Matrix3x3 = currentView.Matrix()
Dim resultMtx As Matrix3x3
Dim TriMatrix As Matrix3x3

TriMatrix.Xx = 0.63121905864763
TriMatrix.Xy = 0.775604602874429
TriMatrix.Xz = 0
TriMatrix.Yx = -0.291176881826266
TriMatrix.Yy = 0.236971772169955
TriMatrix.Yz = 0.926855114181588
TriMatrix.Zx = 0.718873092756943
TriMatrix.Zy = -0.585048612676443
TriMatrix.Zz = 0.375419228750255  

resultMtx.Xx = TriMatrix.xx*myMtx.xx + TriMatrix.xy*myMtx.yx + TriMatrix.xz*myMtx.zx
resultMtx.Xy = TriMatrix.xx*myMtx.xy + TriMatrix.xy*myMtx.yy + TriMatrix.xz*myMtx.zy
resultMtx.Xz = TriMatrix.xx*myMtx.xz + TriMatrix.xy*myMtx.yz + TriMatrix.xz*myMtx.zz
resultMtx.Yx = TriMatrix.yx*myMtx.xx + TriMatrix.yy*myMtx.yx + TriMatrix.yz*myMtx.zx
resultMtx.Yy = TriMatrix.yx*myMtx.xy + TriMatrix.yy*myMtx.yy + TriMatrix.yz*myMtx.zy
resultMtx.Yz = TriMatrix.yx*myMtx.xz + TriMatrix.yy*myMtx.yz + TriMatrix.yz*myMtx.zz
resultMtx.Zx = TriMatrix.zx*myMtx.xx + TriMatrix.zy*myMtx.yx + TriMatrix.zz*myMtx.zx
resultMtx.Zy = TriMatrix.zx*myMtx.xy + TriMatrix.zy*myMtx.yy + TriMatrix.zz*myMtx.zy
resultMtx.Zz = TriMatrix.zx*myMtx.xz + TriMatrix.zy*myMtx.yz + TriMatrix.zz*myMtx.zz


displayPart.ModelingViews.WorkView.Orient(resultMtx)
displayPart.ModelingViews.WorkView.Fit()


End Sub
End Module 

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