Using either scale function or user input to set LenXYZ

Is there a way to use either an input value or the scale tool to set the Len value of a DC?

So the problem is that if you are needing to set values for attributes XYZ or LenXYZ and particularly if you need to use a formula to do that but you do not want them to be fixed.

For example: sometimes the X position needs to be defined based on user input but you still want the user to be able to move the object without it snapping back to the defined X position.

… Or be able to scale it without snapping back to the defined LenX

The answer as best as I was able to determine is that any components that need those attributes fixed should be placed as a sub component where the parent has floating values

It is also possible to make the XYZ or LenXYZ user editable by using the visible option window but you can not make it equal some other variable -for example var =5 LenX =var+2 would lock LenX to 7

But if LenX was user editable it would work as the primary parent

So for example, you want to scale a table, and after everything inside will move/scale automatically?
-You can have all your nest components to related to the Parent!LenX, no?

For example:
If I have a table that has a lenX scale handle
and also has a variable length which can be set by user
the legs are a separate component and move in relation to LenX either way

If LenX=userinputvalue
then LenX seems to be locked to that value and the scale tool will not function.

It seems like somehow lenX needs to be a floating value.

Here is the DC:
2x4 Interior Wall Group.skp (28.9 KB)

I tried here to use Current() but have not got it too work.

It looks like if the userinput value is set to blank then the scale tool will work.
This would require the user to delete the userinputvalue before scaling though.

Hmm, I’ve never tried Current() with scaling.
I have this: DC-Curtain.skp (1.7 MB)
it’s not exactly the same as your issue, but maybe bits of it will help. I used Current () to lock Z, and have options to LenX and Scaling will modify LenX as well.
i remember current being an issue for me well, I think making a new attribute for Current and another attribute to link to it worked.

1 Like

Excellent thank you very much,

Yes the curtain height has an input value and can also be scaled
-it looks like I just need to move the input box to the LenX attribute.

…yes that worked.


Here is the corrected DC:
2x4 Interior Wall Group.skp (30.7 KB)

I have a similar problem with my Interior Door DC.

I added the ability to flip the door side but did not realize that it locks the axis and position.

The problem here is that in order to flip the door I have to determine the current rotz and add 180 to it
Then I tried to reverse that by taking the current rotz and subtracting 180

So I made a list box that has two selections:
Flip Door?
Yes =current(“RotZ”)+180
No =current(“RotZ”)-180

But this crashes SU
if I just make RotZ =current(“RotZ”)+180 though it works

so it seems like SU does not like the formula in a list box.

The other problem with using the list box is that in order to flip in place -I need to change the X and Y positions also.

So three attributes need to be changed with one list selection.
I could for example let the user enter the rotZ value but I see no way I could flag that and make X or Y change

I do not see a way of doing that.

DoorSet1.skp (515.3 KB)

Oh, I see what I am doing wrong.
-using the equal sign locks the value

so LenX =somevariable

locks LenX


LenX somevariable

leaves it unlocked

Crashes ? Do you get a BugSplat! window ? Or the Windows Error Reporter ?

Hmmm, I was wrong about removing the equal sign.

Hi DanRathbun,
Well SU just hangs as if it is stuck in a loop -I can hit X in the top right corner and force it to stop.

Well then I’d consider this a DC bug if it hangs.

ping @tt_su

Seems like a reasonable assessment.

Anyway, I might have found the answer.

the top level Parent component can not have fixed values (=) or formulas for XYZ if it is to be moved
or for LenXYZ if it is to be scaled

Well this scenario needs to be accounted for in the DC code, so no “hang” occurs.