Skip to main content
16-Pearl
July 15, 2025
Question

CREO JS API pfcViewOwner.GetCurrentViewTransform() and pfcViewOwner.SetCurrentViewTransform()

  • July 15, 2025
  • 3 replies
  • 1111 views

Hello, I'm having troubles using this two funcitons. 

Effect I'm expecting using this two functions one after each other. I see the same thing without changes by getting actual transformation and applying it to the model. 

Now let's see what's actually happens

 

let model = pfcGetCurrentSession().GetCurrentModel()
let transform = model.GetCurrentViewTransform()
model.SetCurrentViewTransform(transform)

This code retrieves transformation from opened model and i expect this transformation to be correct because I do actually see it in model and there is no errors in it. But:
 

Uncaught Error: pfcExceptions::XToolkitBadInputs in ProViewMatrixSet at <anonymous>:3:7


Is there any extra step needed to repair transformation gained directly from model?


3 replies

18-Opal
July 15, 2025

Normalize?

16-Pearl
July 16, 2025

Is there a function for that so users don't have to do it by hand? 

As i can see C++ toolkit has it but no mention about this function in JS API.

Next question is about used documentation from programmers point of view there has to be at least a mention about necessity of normalization if i read documentation.


I've tried for like a couple of hours trying to input pfcTransform3D into SetCurrentViewTransform and didn't succeed but for some reason if i input Matrix Property of pfcTransform3D it works. Like WHYYYYYY?!?!?!?!?!?!? documentation says: give me pfcTransform3D

ilyachaban_0-1752644995358.png



let's follow with normalization:
that is a view I'm getting when i input any kind of matrix. Even normalized 

ilyachaban_1-1752645090537.png



this is view it has to give to me  

ilyachaban_2-1752645130783.png



i suspect i'm getting some kind of generic view in camera coordinate system so it doesn't thorow exception even if matrix is invalid

Community Manager
July 23, 2025

Hello @ilyachaban,

 

You have some responses from a community member. If any of these replies helped you solve your question please mark the appropriate reply as the Accepted Solution. 
Of course, if you have more to share on your issue, please let the Community know so other community members can continue to help you.

Thanks,
Vivek N.
Community Moderation Team.

16-Pearl
August 2, 2025

This issue has been recreated by PTC Support and now it has SPR ticket