cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X

Matrix for iso view

msteffke
12-Amethyst

Matrix for iso view

Fellow Customizers,
I'm creating in iso view in a drawing using ProGeneralViewCreate. I
cannot figure out how to get the view to be shown in isometric like the
default view in Pro/E. I found this matrix in testdrwview.c and it puts
the view in the drawing in TriMetric.

ProMatrix def_matrix =
{
{ 0.921061, 0.000000, 0.389418, 0.000000},
{-0.305042, 0.621610, 0.721492, 0.000000},
{-0.242066, -0.783327, 0.572541, 0.000000},
{ 0.000000, 0.000000, 0.000000, 1.000000}
};

I have also tried to get the matrix from an existing view, and apply it
to a new view but it would just error out the view creation.
Does anyone have an iso matrix they are willing to share, or is there a
way to calculate an Iso matrix?
Thanks,

Mark Steffke


This thread is inactive and closed by the PTC Community Management Team. If you would like to provide a reply and re-open this thread, please notify the moderator and reference the thread. You may also use "Start a topic" button to ask a new question. Please be sure to include what version of the PTC product you are using so another community member knowledgeable about your version may be able to assist.
2 REPLIES 2

Mark,

Here is a function that I use to create a drawing and place a view on it
that is oriented to a view contained in the solid. You should be able
to tailor this code to your needs. I do some scaling of the view which
you can adjust or just remove entirely.



/*

Mark,

Here is the simplest solution I could think of. Find the view name "DEFAULT" and normalize the matrix:

----

void Assembly::getDefaultOrientation(ProMatrix orientation) const
{
ProName wName;
ProStringToWstring(wName, "DEFAULT");

ProView defaultView = 0;

ProError status = ProViewNameToView(getProAssembly(), wName, &defaultView);

if (status != PRO_TK_NO_ERROR || !defaultView)
{
throw Error ("DEFAULT view not found.");
}

ProMatrix viewMatrix;

status = ProViewMatrixGet(getProAssembly(), defaultView, viewMatrix);

if (status != PRO_TK_NO_ERROR) throw Error("ProViewMatrixGet()", status);

ProVector xVector = { 0.0, 0.0, 0.0 };
ProVector yVector = { 0.0, 0.0, 0.0 };
ProVector zVector = { 0.0, 0.0, 0.0 };
Pro3dPnt origin = { 0.0, 0.0, 0.0 };

ProUtilTransfToVectors(viewMatrix, xVector, yVector, zVector, origin);

ProUtilVectorNormalize(xVector, xVector);
ProUtilVectorNormalize(yVector, yVector);
ProUtilVectorNormalize(zVector, zVector);
origin[0] = origin[1] = origin[2] = 0.0;

ProUtilVectorsToTransf(xVector, yVector, zVector, origin, orientation);
}

---

Good Luck,

Michael


Top Tags