Is there any way to return the current Scale value in a DC attribute?

Hello Everyone,
I am trying to get an attribute in a DC to indicate if it has been scale by -1 or not at all. Any way to do this?

Thanks!

UMMMMM, anybody?

Try that:

Hey thanks for the reply. What I’m looking to do is scale a 45 degree RIGHT joist hanger through itself by -1to get a LEFT joist hanger. In the description I need to indicate left or right. The scale tool attribute limits the ability to scale but does not report the value of the current scale, -1 or 1. I am looking to get the current actual value of scale into a custom attribute in the DC so I can then CONCATENATE the description to indicate LEFT or RIGHT. I attached the DC, its not finished but you get the idea…Updated in next post

1 Like

This ones done except for the description. The Generate report will itemize different sizes etc…LR HANGER DC.skp (1.7 MB)

You can get the scale value simply dividing the size by the original. However in this case you wish to return a negative value to show the use of -1, this does not happen.
Usually one uses a negative value in the size attribute in which you want the mirror, in your case the parent lenX needs to toggle from positive to negative. However this splits your model, so need to wrap the whole in another component as per the example, I only did the mirror and position for the double, you need to write the other connected attributes and condition “x” for the single.
The component size is a concern 1.7Mb and rising!, I believe you need to consider a different approach to these components.

LR HANGER DC.skp (1.7 MB)

Anyway try to figure how to use the mirror for your components, I hope to check out some simplify approaches and inform you latter of any recommendations

2 Likes

This is great thanks!
in this formula =if(mirror,-8.118918,8.118918) the use of 0 and 1 in the mirror attribute indicates true or false for the if function? Just never seen it done like that, nice, simple.

No need to add position for single it all works fine. Any suggestions on simplification would be great. Thanks again.

LR HANGER DC pcmoor.skp (1.7 MB)

Hi Ryan

The DC is actually 1.341MB, after a purge, but still high. I temporary deleted the fixings, that brought it down to 0.4MB, given that each fixing is about 40KB, 29 unique ones adds up fast.
One can replace them with either a 1.5 or 2.5 screw. By placing the screw in the group parts of the framing bracket, then change their value by = if(parent!hidden,0,1). You could also change their visibility using = if(and(parent!hidden,parent!type=“single”,0,1) for the 1.5 or = if(and(parent!hidden,parent!type=“double”,0,1) for the 2.5. that way you only use 3 types, 0.65MB

The added file is an example, but slightly different formulas that the above recommendation but gives you the general idea, not quite finished
LR HANGER DC pcmoor.skp (822.6 KB)

The amount of detail is a concern, most likely a result from importing CAD files. Although not yet released: https://mindsightstudios.com/skimp/ should help to reduce the file size of the geometry…hard to wait for this, but should be soon. Another tool or idea that should be part of the Sketchup Software, I really hope they, the sketchup team will wake up.

Philip

1 Like

That Extension looks AWESOME! Here is the finished version. Thanks for the help!
SIMPSON SUR:L.skp (686.0 KB)

1 Like