Showing results for 
Search instead for 
Do you mean 
Reply
Solved! Go to solution

How to scale an object without changing position

Hello,

 

I am using the function UF_MODL_create_uniform_scale to scale the object but it changes position. Any idea how to avoid this? I try to use move_feature to bring the object back to its previous position but it goes somewhere else.

Also, I tried to solve the problem by using UF_MODL_create_scale and setting a smart point as an origin of the scaling to keep the object stable, but I dont know how to use smart point. Any ideas?

 

Thank you

5 REPLIES

Re: How to scale an object without changing position

Check out the UF_SO_create_point-* methods to create a smart object point to be used by that function. The UF_SO_create_point_offset seems the simplest method.

If you can use the NXOPEN functions (instead of the C/C++) routines, then journal the NX session while scaling the object. For example I journaled a session to SCALE a body using the SCALE BODY function with inputs of UNIFORM object and selecting an EXISTING POINT. The journal output shown the APIs you would need to do the task.

Dave
Dave Figurski

GSS / Siemens Industry Sector
Solution
Solution
Accepted by topic author Dora87
‎09-27-2016 04:44 AM

Re: How to scale an object without changing position

The old-fashioned way is to use NXOpen.UF.UFTrns.CreateScalingMatrix. One of the inputs is an "origin" point -- this is the point that will remain fixed when the transformation is applied.

 

Or, if you have a SNAP license, you can use  Snap.Geom.Transform.CreateScale. The SNAP Reference Guide includes thorough documentation and example code.

山田
yamada

Re: How to scale an object without changing position

I have tried to use NXOpen.UF.UFTrns.CreateScalingMatrix, the object remain fixed but it doesn't scale. No change happens at all. Trying to figure out why. Thanks anyway Smiley Happy

Solution
Solution
Accepted by topic author Dora87
‎09-27-2016 04:44 AM

Re: How to scale an object without changing position

Probably no scaling happens because the object is associative, so its geometry is dictated by its parents. You could try a "copy" transformation, instead of a "move". Then delete the original if you no longer need it.

山田
yamada

Re: How to scale an object without changing position

That helped a lot. Thank you!