Dynamic Component Area


#1

Hi guys,
Just want to check with you a couple of things regarding dynamic components.
I am trying to make a Building block which will report all the necessary information to SketchUp report.

  1. Why FACEAREA() returns area which is 2 times bigger then it supposes to be?

  2. I want a user to be able to select Building Use which will change a colour of the component. It seems straightforward, but how to report not a colour but actual usage?

  3. Also is there a way to have a component name above it? So it easy to see where components with wrong names?

I have attached images so its easier to understand what I want to get.

Thank you!


#2

I have attached a component as well.
BLOCK A.skp (175.3 KB)


#3

When both sides of a face are painted with the same material (or a group or component is painted in its totality), SketchUp reports the total area painted, so both sides count. In a similar situation, I painted all the faces inside my cube component except the top of the “floor” with a non-default material so the material applied to the component affects only that single side of a single face.

Anssi


#4

Hi Anssi,
Yes, I know that. But I don’t have the material applied to my face and I am using FACEAREA() without specifying the material name, so I should get just one face are not x4?
Even if I apply material to the component face material should still be “default” and report a correct area.


#5

With no material passed to find an area you are reporting the area of “all faces” - and since a face has a front and a back-side it comes out x2.
To sidestep the issue use /2 of the area returned, or specify a material special inside the component, applied directly to the front of one face and then get the area of just that…


#6

Hi TIG,

It is what I tried as well. But I still getting area X2 bigger. For some reason I have to divide by 4 to get correct number?
I have plane which 3X3 should get 9, but I am getting 18 )) ?

Thank you


#7

It is funny. I have created a new component with the same formulas and it works ?!
Anyway, could you please help with questions 2 and 3?

Cheers


#8

2: add another attribute which you can select in the report to display . Formula for this attribute would be something like: = IF(Material=“Green”, “Residential”,“Other”)
3: you can display with the interact tool , I think, add an onclick behavior and put in ALERT(“message”)


#9

Cool Thank you, 2 is solved!

But unfortunately I got FACEAREA() problem again, it looks like it doesn’t update when I change a size (LenX and LenY) of a face. LenX and LebY come done from the main component.
I tried to redraw, but still area the same.

Any ideas?


#10

Hi Mike, is there a way to have this label all the time, without onclick ?


#11

No, there is a tooltip which is displayed while hovering but it’s message is not interactive.

The Facearea function is very unpredictable IMO, and since I live in a metric system it doesn’t appeal to me, since the units are in inches…


#12

Yes, something strange happening with Area function. I am converting it to sqm it is not a problem. The actual area is not updating even in sq inches.

Thanks for Alert() command! It is better than nothing )


#13

Haven’t tried, but as with no:2 it might help if you would reference the LenX etc. to another custom attribute, like Width,Depth and Height, let the user change those attributes and reference the LenX etc to them ( LenX=Depth etc)

Edit : Nope… doesn’t work, even the Example of the FACEAREA() function it does not work, it only seems to work when you are actually editing the component, not by changing the LenX in the Component Options dialog…


#14

:)) Why do you need this function then ?? I might use just simple multiplication of LenX to LenY.
I thought FACEAREA() would be more flexible to use. In case I want to change my component from rectangles to circles. or other shapes


#15

OK does anyone knows how to get a correct area from the component using FACEARAE() function?
Redraw command doesn’t update the area after changing component size via “User Text Box”

  • I switched off scale handles
  • User can enter LenX and LenY in a text box
  • After changing the values of LenX and LenY Area is wrong!

#16

Maybe there is a way to write a custom script and attach it to DC?


#17

changing lenx,leny…stretches the material, if you make a component unique (if required) and scale definition from the context menu, the material will reset or rather redrawn(?) hence the calculation of the area of un-stretched would be then correct. (you may need to active the redraw as well)


#18

does not work )


#19

you need to do within the context of the nesting , example attached of one level component

matty.skp (15.7 KB)

after change scale definition. then redraw


#20

Sorry, but it doesn’t work, maybe it is a bug on a Mac version?