Cancel
Showing results for 
Search instead for 
Did you mean: 

How to scale an object without changing position

Creator
Creator

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

Siemens Creator Siemens Creator
Siemens Creator
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

Re: How to scale an object without changing position

Siemens Phenom Siemens Phenom
Siemens Phenom

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

Creator
Creator

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

Re: How to scale an object without changing position

Siemens Phenom Siemens Phenom
Siemens Phenom

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

Creator
Creator

That helped a lot. Thank you!