I don't understand dynamic component scaling
-
@quantj said:
I couldn't get the "x" in, so I made mine refer to another value which I then put in x. I also used INT to force round the numbers. If want fractions, maybe there's another formula for that...
I think you just need to put quotes around the x when using Concatenate so it treats it as a string. Yeah, I could use INT to clean it up too. The whole redraw thing is what I find really frustrating. Why doesn't it read the LenX property when typing in an absolute value? Why do you have to redraw?
I mean, it seems like this was done on purpose *(why else would there be an option in the context menu to redraw?)*but I don't understand WHY?? When would you ever NOT want a dynamic component to redraw? Shouldn't it do it automatically every time?
-
Yea I tried adding quotes and it just didn't work.
I don't why it won't redraw automatically. I have same problem with my models.I have a dynamic table with option for amount of chairs to appear (Copy function), however if I scaled/change the the table height, the main chair height will scaled proportionally, but all the copy chairs won't. Very frustrating, my only way is to choose table height first before choosing chairs amount.
-
use two variables
length =current("LenY")
wide =current("LenX")Summary =length & " x " & wide
this should force the redraw
-
@pcmoor said:
use two variables
length =current("LenY")
wide =current("LenX")Summary =length & " x " & wide
this should force the redraw
So you're saying that by referencing the LenX and LenY values indirectly using custom variables, it forces a redraw? I'll have to try that. I noticed that's what the SketchUp team did in their dynamic windows, but I just assumed it was overly organized or something.
-
IIRC, it's not so much using a proxy variable that makes it work - it's the use of the 'current()' function.
As an example, consider you made a DC where the equations only allowed a component to be an exact number of feet long - very common for models of kitchen units, building supplies etc. When you resize it, things happen something like this...
- You resize your component by whatever method - which changes, say, LenX. We didn't bother snapping to anything because we know the component only allows valid sizes.
- The calculations are done by sub-components inside the DC to calculate their sizes - this causes a new value of LenX to be calculated, conforming to the 'whole units' constraint.
- But if LenX just got calculated to a new value, different than the one supplied by the scale tool, that means that the DC just got resized again.
- If SU were allowed to see that change as another re-scaling, it could set all the calculations running again - and with a very complex DC, this might just go on and on forever, with every calculation triggering yet another re-scale.
The 'current()' function is used to resolve this problem - it's guaranteed to read the value either before the calculations start, or after they have all finished (which one, or both, I can't quite remember). It ensures that you receive a nice stable value, and that the maths has a proper beginning, middle and end, with each resize only calculated once.
PS) Technically, that's probably nothing like what really happens! But I found that keeping that idea in my mind really helped me get my first few DCs working.
-
I just tried using the =current() function, and it still doesn't redraw when I use the Scale tool then type in a precise measurement.
- Scale the component an arbitrary distance = shows correct size after scaling
-Scale the component an arbitrary distance, then type in a precise distance/ENTER = size shows the original dimensions, not the new dimensions.
-
-
I downloaded your file. Same problem. If I scale the rectangle, then immediately type 200cm ENTER, the summary display is wrong. I just don't understand why it would behave this way.
-
You have a misunderstanding of the scale tool, the scale is changed by the factor you enter, if you move with scale tool then enter 2, the result would be 2 times the previous size, or 0.5 would be half.
if you made a unit size, say 1 inch, then entering 25.75 then it would be 25.75 inches,
or say 1000mm then entering 3.45 makes the side 3450mm
-
@pcmoor said:
You have a misunderstanding of the scale tool, the scale is changed by the factor you enter, if you move with scale tool then enter 2, the result would be 2 times the previous size, or 0.5 would be half.
if you made a unit size, say 1 inch, then entering 25.75 then it would be 25.75 inches,
or say 1000mm then entering 3.45 makes the side 3450mm
The Scale tool has always allowed scaling to dimensional values in the Measurements box. In your example, you could also enter 2" which would result in the object being "scaled" to exactly 2"
It's a bug in DC's that they are not redrawn when using the Measurements box.
-
thanks Jim, I learnt another thing about this amazing program, hopefully 2015-16 will bring about a revamp of DCs
Advertisement