script to change output of Display Coordiantes

script to change output of Display Coordiantes

RadioRahim
Collaborator Collaborator
636 Views
1 Reply
Message 1 of 2

script to change output of Display Coordiantes

RadioRahim
Collaborator
Collaborator

Greetings, I'm wondering if there's a way I change the output values for coordinate display window at the bottom of the screen to be HEX?.

An example of a typical coordinate display is in float value like this:

X: 13.880514 Y: 0.0112 Z: -9795.024

I need to have the coordinate display window multiply these values by 1000 and then make a simple conversion. Example of conversion:

X = 13.880514 x 1000 = 13880.514

The value of 13880.514 converted to HEX is: 46 58 E2 0E, and is in Big Endian byte order, but I need it in little Endian like this 0E E2 58 46

Is there a script, pluggin, or method I could do to make this work?

0 Likes
637 Views
1 Reply
Reply (1)
Message 2 of 2

drew_avis
Autodesk
Autodesk

Hi there, so it looks like you're asking a couple of things:

- converting decimal numbers to hex

- setting the coordinates display in Max

 

I'll point you to some resources that might help get you going in MAXScript.

 

For converting decimals to hex, you can convert decimal integers to hex using bit.intAsHex.  See this topic for more information: http://help.autodesk.com/view/3DSMAX/2018/ENU/?guid=__files_GUID_B57EA575_DCDE_42F5_9D30_88E3EB41F35...

 

For setting the coordinates display, you can use setStatusXYZ() - see:  http://help.autodesk.com/view/3DSMAX/2018/ENU/?guid=__files_GUID_3EED3E7C_D7BB_4160_99BB_82B7872CA86...

 

Unfortunately, it doesn't look like you provide a custom format, and hex is not supported.  A possible solution would be to creating your own rollup in the UI and display the required hex value there.

 

Hope that helps.

 

Drew



Drew Avis
Content Experience Designer
0 Likes