Dev to hire for simple script creation?

The first line in the “desks” file has the number of desks and the dimensions to be used for each desk (x,y). In this case, there are five desks. The next five lines have the x and y locations of the lower-left corner of each desk. Unless your desk layout changes, this file should stay the same. The “activity” file, in this case, contains five characters on a line (one for each desk) where the first character is the status of the first desk, the second is the status of the second, etc. (I used “A” for active and “I” for inactive). Each line in the activity file represents one time period. If there are 288 time periods, then there should be 288 lines in the “activity” file.

The format of the files was something I made up for simplicity in illustrating how you might approach a solution to this problem. I’m not sure what’s causing the error you’re getting, but my earliest version had some issues that I’ve addressed … you might try downloading the current version. The newer version uses component instances instead of many groups and has much better performance than the previous versions.

Oh! Now I get it!
I thought that the dimensions of the desks where elsewhere. So I will download the newest one and will give it a try. To make it as a prism I only have to add a face pushpin in the points drawing part.
Maybe I can output a different activity file each time I run the queries and so coping with the variable number of periods.

Thanks!

Works Superbly!!! You are a genius, not because it works but because I even almost understand how to use it!

Could I export all the scenes seen from a same point of view as a series of PNGs or as a movie? How?

aOffice Layout_jcb.skp (607.7 KB)
although you appear to have a solution in hand, I re-jigged your skp, and ran some test code…

open skp and run this in Ruby Console…

   comps = Sketchup.active_model.entities.grep(Sketchup::ComponentInstance)
    comps.map{|e|  e.layer = "on"} # you can run the top on it's own to rwset the test
    off_desks = [12,3,24,15,26,32,43,21,50]
    off_desks.each{ |d|
    comps.map{|e|  e.layer = "off"  if e.name.include?(d.to_s)}}

it is easy enough to open the skp and run new code with different values, save an image and add it to a movie or gif…

john

Thanks John! I see it clearly now and I will also test this method. What I like from Jim’s one is that it creates the shapes and I will have to do it lots of times. Maybe I can combine both ways.

I can’t see why from your ‘breif’…
you have one floor-plan and one set of desks, so you can reload the same skp over and over?
it’s only the stae that needs updating…
am I missing something?
john

yes! That this is for one floor in one building and I hope to have to do it in lots of places :smile:

But in reality I can create the shapes and floor plans for each building and then use your way. What I also like about Jim’s is the way I load the activity data. Think that I will be doing queries on a huge SQL database, extract active computers each 15 minutes and then save this to do the drawing of states. To be able to create a file with one row per activity results is really conveniente. Maybe I should use that input with your ideas. I should output the PC Names that are a match, in a line, and then create a multiline text file that is read by your steps. Would this be too hard with your code?

if you make a txt file e.g. [14,25,46,42,34,19]
you can use eval to input the changes,

    comps = Sketchup.active_model.entities.grep(Sketchup::ComponentInstance)
comps.map{|e|  e.layer = 'on'}
off_desks = eval(IO.read("/private/tmp/desks.txt"))
off_desks.each{|d|
comps.map{|e|  e.layer = 'off'  if e.name.include?(d.to_s)}}

or you could just write the entire code as a temporary rb
and use
Sketchup.load("/path/to/temp/ruby.rb")

My approach would be to have one skp per office [with the 2 on/off Layers and set for ‘color by layer’]
if you have an actual list of computer names you can use those for your component names [not the definition name]

from the data base generate a ruby file with the computer name and state if it is off, and use that to open the skp, change the layers, save the image, close the skp [without saving changes]

I’m a mac person so the details for doing it on a windoze cmd script allude me, but i know it can be done…

food for thought
john

LOL John, I’ve been using Macs and Macs only since 1989 so my current setup before Sketchup is:

FileMaker Pro queries getting data from MS SQL Server via ODBC, AppleScript generated drawing code using FileMaker Scripts to command OmniGraffle, Omnigraffle output as JPGS that are joined as movies with Automator…

I’m seeing the light at the end of the tunnel but Sketchup will save my life soon :smile:

I’d like to generate the locations and draw the actual computers’ locations and name them from the output of the database instead of placing them manually. I’ve done it that way in the file I’ve sent you. How can the name of each instance be set when I draw them?

the one in this thread, or am I missing a PM…

with the one in this thread i just named all your existing ‘desks’ using

    @i = 0
 comps.map{|e|i = @i+1; e.name = "desk_#{i}"}

but, @i could be replaced with a list of names…

I think you may be totally under utilising the power that SketchUp could bring to the party…

can you post one your current movies to show the state of play?

I don’t use filemaker, or omnigraffle as i mainly program for SU, however Applescript, osascript, bash, and ruby can do most of what you describe…

you can set a shell script to run every fifteen minutes, open SU, open the ‘office’ do the update, take a snap, add it to a movie, close it…
john

Thanks john. The problem is that I have to name the computers matching the name with the real coordinates of each one. In your case you only named them by order. That’s why I think the way to do it is to draw an instance and assign a name in the same act. If you see close to the bottom of this page, you will see what I’m using this for.

What I essentially do is use desktops activity level (I don’t measure computer power state but user’s activity) as a proxy for human presence, so I save the presence detectors and I can analyse space usage.

http://leantricity.com/projects/barcelona-workplace-optimisation/

had a look at the site, very impressive…
what are you hoping SU will add to your current output, I think it could be quite expansive…
far more than a straight swop for OmniGraffle…
john

One link is worth a thousand words :wink:

That’s really cool! I was kind of curious why the data was being collected and envisioned several scenarios.

The approach I took creates one scene per time slice. The assumption was that you would be using the animation feature within SketchUp to create the output. When I first looked at this, my initial thoughts were that SketchUp wasn’t the best solution for this. However, it’s workable and, as John has pointed out, can be dressed up even more to create an eye-catching format.

Where I work, I have a vbscript on the Windows boxes that inserts a time-stamp into a database at logon and then updates that record at logout. I do the same with our Macs, but use a perl script instead. The data is generally queried with a web interface that gives different users different views of the summary data depending on their needs. Our main use of this data is for identifying peak times and trends for staffing purposes. These two sets of charts seem to make most of our interested parties happy (taken from three of our buildings):

Last week, I showed some of our folks a sample animation I made using one of our floor plans and coloring the desk locations as rectangles. They found it interesting, but not particularly useful for our needs. Our local champion of mounting sensors at every desk was pretty hyped by it, however.

Haha, you finally get it. After 8 years doing huge power management projects in big networks (my biggest customer has 30.000 PC in 70 places) I realised that if I were powering down the computers when users where absent, why couldn’t I expand on this “situational knowledge” to do 2 things:

  1. Identify weird or inefficient usage patterns. The typical one is “Ms Martha Syndrome”: showing this activity by 15 minutes movies data plotted to a customer I saw a single dot active at 8PM to 10PM in a whole empty floor, that means that this “dot” had to be lit, ventilated, etc. The IT guy jumped off the seat and said “this must be Ms Martha!”. It results that Ms Martha was just a data entry lady being at that single active spot each day because of inertia. Moving her to the floor below could save them light, ventilation and other building services costs, easily. So,if you multiply this case by hundreds, you can find, analysing PC activity data (and NOT login times but what happens with the users’ active usage in discrete moments) that lots of desks are seldom used, that lots of persons have a jumping in and jumping out way of working and could be grouped in a shared space, etc. Our FIRST approach with my partners was to sell this knowledge, with the fastest and lowest cost way of capturing the data because we don’t make you buy anything but we use your computers with a dedicated software agent. BUT, if you go to a big company and present a case to “better” “manage” “the workplace” each one of this words scares them out so imagine all of them at once! Enter the second approach I have with this. Instead of power managing the computer, we power manage THE OFFICE. It is long to explain here, but essentially what we have is a web services based power managing system were we define scenes that are an association between computers and building controls, and rules of occupancy (or lack of activity in this case) that can trigger changes in building services (like lights, ventilation, etc). It is my idea so it is not good to define this as genius, but the core is to get pretty high value for a low cost sunk cost sensor everywhere present: the PC!

So, replying John: what I like about Sketchup is that it facilitates “inter floor analysis”. I can spot really on the fly active dots at weird hours in separate floors. The way I work in this optimisation proposals is to analyse work patterns, then shuffle people around based on matching time and intensity of work. If I do it in a same floor I have a certain capacity, but imagine how it expands taking a whole view of a building.

As Ferran Adriá said, “you are innovating when people is not understanding you”… so I’m preparing my next level rig with Sketchup for the future, while we concentrate on connecting the building controls to our system. I’m sure your sensors guy would love this, he gets “almost” the same in a fraction of the time!

I find that besides the location data, something we can do really fast is identify users’ profiles by type of intensity, so you can think about who is a candidate to go “to the tablet’s lounge”, who could share a PC, who is not needing a desk, etc.

This graph’s Y axis plots minutes (max is 15) of activity and X axis is hours of the day. This graph is the addition of several ones for each day, with transparency. The leftist one is someone that definitely works mornings only, and the right down is someone that seldom is at the office. This four graphs belong to 4 different people representing the main profiles we classify the people in.

from an aesthetics pov I immediately thought of hooking it in with LightUp to grab rendered images with lighting levels…

i.e show 3d desk spaces in pools of light and dim them when not in use, visually representing potential saving in energy consumption…

but, i do Special Effects for movies so maybe that’s why i saw that…

john

Specifically, as I’ve mentioned in Jim’s reply, I can analyse several floors at once and do animations between scenes to better show the findings. Also, working with the Z axis I can vary the “desks” height to convey some value (like user activity level, etc). Also, as I will use the system to control building systems, I can set up a 3D model with lights and simulate the results after my controlling system is in place.

I don’t do special effects for movies but I was exactly looking at it this afternoon. My hope is to be able to: associate a set of lights with a zone, and set them off when a given amount of computers linked to them are OFF, and to also do the math about the savings so the customer can predict exact ROI. This is Tooooo hard for me because I’m not an engineer nor a programmer, I just learn the least amount needed to advance my ideas, that’s why the title of my post was “dev to hire”. I love to do things myself but I have to confess that I’m impressed and I feel non capable of doing the quality work that people around here does!

Adam who develops the LighUp extension is very good at all this stuff, I’ll try pinging him @AdamB,
as I think he could add value here, I’ll send him an email as well, so maybe he’ll pipe up…

john

Thanks! Beware of my newbie status with all of this. The first thing I have to do is to decide which approach to finally settle with. I like your color by layer idea and I also like Jim’s one scene per time slice one.
What I was expecting to have is only a movie with a frame for each period, showing the active desks in it, but I don’t realise if having a scene per period (as Jim does) adds more power to the way of communicating the status of things.

I’m modifying my databases to spit out a list of device names that can be used to decide which ones are on or off per period (as your idea). But I’m not sure about creating the desks once and then just colouring by layer or going the scene’s way.

I guess that having a scene per period is more powerful to go back and forth if I’m discussing this with a prospect. I can show Ms Martha’s syndrome on the fly :smile: