The
W~ is the old global variable name for
SYMB_ROTANGLE.
SYMB_ROTANGLE is the value in the info box for the object rotation as you place it on plan.
If you want to use that to rotate your object then there is no need to script anything.
Just rotate the object as needed in the info box or object settings dialogue.
How ever if you want an object that can not be rotated then you can add
ROT -W~ to your 2D script.
This is often just used for the text parts of an object so the text is always readable even when the object is rotated.
What you are doing in your object is rotating it by as much again as what you rotate the object by when changing the rotation angle in the info box.
ie 2 times the rotation angle (if 45° then you are rotating 90° which is possibly why you don't notice the change if your object is say a square).
If you want a user parameter for the object (or parts of it) then create an angle type parameter (ie rot_ang) and use this in the script.
ie
ROT2 rot_ang
Not sure if I am helping or confusing you more?
If you can give us some more info on what you are trying to script then we can help some more.
Barry.
One of the forum moderators.
Versions 6.5 to 27
i7-10700 @ 2.9Ghz, 32GB ram, GeForce RTX 2060 (6GB), Windows 10
Lenovo Thinkpad - i7-1270P 2.20 GHz, 32GB RAM, Nvidia T550, Windows 11