sketchucation logo sketchucation
    • Login
    1. Home
    2. DavidBoulder
    3. Posts
    ℹ️ Licensed Extensions | FredoBatch, ElevationProfile, FredoSketch, LayOps, MatSim and Pic2Shape will require license from Sept 1st More Info
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 38
    • Posts 343
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: Don't DC to rotate even if parent component does

      Thanks, that works great, although I'd love an auto-redraw. As is the user has to go back in and change an attribute to do this (or context click/redraw).

      So if I add this component in through a ruby script, can I place an entity observer on it that will redraw it if it is moved rotated (vs. only when the component itself is changed.)

      I need to learn more about observers. If they are global, or tagged to specific entities.

      posted in Dynamic Components
      DavidBoulderD
      DavidBoulder
    • RE: Copying Holes?

      What is interesting about a hole all of the way through is that if you just copy the circles (but the the cylinder wall) both faces are cut by the circles. But if you select the cylinder walls as well (or by itself) then the faces are not cut.

      posted in SketchUp Discussions
      DavidBoulderD
      DavidBoulder
    • RE: How many attributes can be attached to an entity

      Thanks for the input. I'm looking at storing annual operation schedule for equipment with the entity. While a basic schedule might have weekend and weekday on and off times, as well as run settings, an advanced setting could have unique numbers for every day of the year.

      So I'm looking at the feasibility of storing this in SketchUp vs. in an external file. A complex project could have a hundreds of these objects in them. I'll do some tests to see if things behave, and also look into using a lot of small attributes, or a few very large attributes.

      posted in Developers' Forum
      DavidBoulderD
      DavidBoulder
    • RE: How many attributes can be attached to an entity

      So I did a quick test on dumping a lot of data in one attribute. I did this via the text field on a Dynamic Component.

      I copied a file I happen to have handy with 1,700,000 characters and 220,000 words.
      It crunched on this for a minute or two, but didn't have an errors, saved fine.

      As I looked into it, it did truncate the file, but at a much higher number than I expected.
      It took 524,000 character and 69,000 words. Those all exported to the CSV fine (although as you would expect if you use the reports, all one one line, as each entity has one line. Of course that wouldn't matter for my use. My ultimate goal would be to use the SU SDK to extract this out of a file, vs. having a rubyscript handle the export process.

      While I expect nobody ever runs into this, a very minor feature request would be a dialog box alerting me that my input is being truncated 😄

      posted in Developers' Forum
      DavidBoulderD
      DavidBoulder
    • How many attributes can be attached to an entity

      Does anyone know the maximum number of entities that you can store for a single entity.

      Related to that I was also wondering how much data can be stored in a single attribute.

      The reason I ask, is that I have a possible scenario that might have a little over 1000 attributes. Right now the data is stored in an external file, but ideally I'd like to be able to attach it to a SketchUp entity.

      Now if attributes can contain enough data, well maybe I just need a few attributes, with a long text string as one of the attributes. That may actually be the best option.

      posted in Developers' Forum
      DavidBoulderD
      DavidBoulder
    • Don't DC to rotate even if parent component does

      I have two children DC's that I want to always keep their orientation. So if someone rotates the model, I want my DC's to snap back to their original orientation. Kind of like face me, but instead of being tied to the camera, I want them tied to the model orientation.

      Has anyone done this before?

      posted in Dynamic Components sketchup
      DavidBoulderD
      DavidBoulder
    • RE: NetBeans Question

      The syntax checking is a big plus. I've also just setup subversion control on it. Great to easily revert to previous version if I have messed up code. Commit once I know it is good.

      I also really like looking at differences between two versions. I can have both side by side, or on the active version, there is a notation of where I have made changes, and clicking the icon brings up a popup with the old code. I can then revert just that piece back vs. the entire file.

      The global searching is also nice. I'm working on someone else s code on a complex project, and it is great to quickly see where else specific code is being used.

      posted in Developers' Forum
      DavidBoulderD
      DavidBoulder
    • RE: I want text tool to show attributes other than area etc.

      Chris, if you don't mind, that would be great. I've wanted labels to be more dynamic for a long time.

      Looking at the Text class
      http://code.google.com/intl/zh-CN/apis/sketchup/docs/ourdoc/text.html

      It seems like if you create a text object via ruby vs. with the existing text tool you can use this method to apply text
      Text.text=

      I guess you can grab the variable from the attribute_dictionary to use.

      Then if you want to update a set of text labels (within some set of rules for what type of attribute to use for different types of objects) you could have a script iterate through all text objects to update. Maybe I would use layers as a way to determine what type of data I want for a label. The active layer could be used when first creating a text object to determine what I want to show, and then if I move the text object to another layer and re-calculate, it would change the attribute to match the layer. Just thinking . . .

      posted in Developers' Forum
      DavidBoulderD
      DavidBoulder
    • I want text tool to show attributes other than area etc.

      So when you use the text tool as a label you get the following.

      if face then - area
      if edge then - distance
      if component/group then - name

      Has anyone tried to create a similar tool that uses a different entity attribute such as material or a custom attribute field (cost for example).

      Now another issue with these text labels is that they aren't dynamic. It would be great if an observer could update this when entities are changed. Or if nothing else a manual (re-calculate all) button.

      posted in Developers' Forum
      DavidBoulderD
      DavidBoulder
    • RE: NetBeans Question

      Interesting update on this. I originally tested Netbeans on Mac and when I made a project from existing resources, it coppied the files from my plugin folder, so when I made changes, I wasn't really changing my plugin folder.

      I'm running it now on XP, and when I went through the same process to setup a project, it links on its own directly to the real plugin directory. So I can edit in NetBeans, save, and then launch SU and my scripts are ready to use. I'll have to see if I can duplicate this back on my mac.

      As it is setup now, no need to jump through hoops, other than the fact that I can't run the scripts right from NetBeans. It even has some subversion support, but I'm already using another app for that.

      By the way, my quote in post above has nothing at all to do with this post, I guess I have to look at what is on my clipboard. That was a link to Google's new inside streetview, or store view.

      posted in Developers' Forum
      DavidBoulderD
      DavidBoulder
    • RE: [CODE] Camera settings

      I have a script I'm working on where I'm trying to iterate through scenes/pages and look for faces parallel to the camera for each scene. I have the code to iterate through faces and test to see if parallel to the camera, but I could find a way to grab the camera for other scenes to iterate my tests across all scenes.

      I suppose I can change to each scene and then get current camera view, but I would think I should be able to grab the camera from a scene without having to change to that scene. Keep in mind, I don't know the scene names.

      edited content below

      OK, I solved my problem, here is a piece of the code.

      
      # draft script - David Goldwasser
      # find faces parallel to camera and draw lines back to camera
      
      model = Sketchup.active_model
      entities = model.active_entities
      pages = model.pages
      
      faces = []
      entities.each do |n|
       faces.push n if n.is_a? Sketchup;;Face
      end
      
      pages.each do |page|
      camera = page.camera
      eye = camera.eye
       faces.each do |face|
        status = camera.direction.parallel? face.normal
        if status then
        edges = face.edges
        edges.each do |edge|
         pts = []
         pts [0] = eye
         pts[1] = edge.start.position
         pts[2] = edge.end.position
         face = entities.add_face pts
         end
        else
        end
       end
      end
      
      

      The pages.each do is where I was having problems before. I was actually switching to that page and then getting current view, camera etc. But the animation was causing problems, so I had to have a dummy UI.messagebox to get it to behave. Now I don't and it is much cleaner.

      So I have an edges.each nested in a faces.each, nested in a pages.each. My indentation for isn't so clear when previewed here.

      posted in Developers' Forum
      DavidBoulderD
      DavidBoulder
    • RE: NetBeans Question

      @unknownuser said:

      Page not found | Gizmodo

      favicon

      Gizmodo (gizmodo.com)

      On XP/Vista the equivalent was just a shortcut. Many apps create shortcuts to the actual application as an icon on the desktop with the little arrow, but you an shortcut any folder or files.

      posted in Developers' Forum
      DavidBoulderD
      DavidBoulder
    • RE: NetBeans Question

      At first I thought I could just use NetBeans to open a .rb file or drag it on, but as you say, you can't. You can copy your ruby's you want in NetBeans elsewhere, but then you would have to copy them back, unless maybe you set them up as an alias/shortcut in the SU folder.

      Or maybe leave the real files in SU plugin and setup the files you want for NetBeans as alias's outside of the SketchUp plugin folder.

      Another thing to think about. I know if you add files in NetBeans, then of course the files are created in the directory for that project on the computer. If however you add files to a directory manually, I don't know if NetBeans re-scans to find them each time you use it. So in an odd way, you could temporarily more files when you setup your NetBeans project, and then move them right back.

      posted in Developers' Forum
      DavidBoulderD
      DavidBoulder
    • RE: NetBeans Question

      I just started using NetBeans as well. I'm still pretty new to ruby, but digging in quickly. So While NetBeans only has an icon to "run project" vs. "run file" you can hit shift"F6" or go to the menu Run > Run File.

      FYI plain old "F6" without the shift will run the project vs. just a file.

      Now this will work for basic ruby, but not things pulling from SU API. While it would be great to be able to run it directly from here, my thought was to export the files and then test directly in SU. I guess I could place the files in the right place to start with and point NetBeans to it, and I wouldn't even have to export, just maybe quick and re-launch SU.

      posted in Developers' Forum
      DavidBoulderD
      DavidBoulder
    • RE: Different timezone per scene?

      Here is my current setup for showing shadows from different locations. Mainly want to do this to make North facing elevation look better.

      For most project I generally break the project into a few major components that I can export to external files to save versions of the project.

      • Building
      • Site
      • Landscaping (trees site furniture etc)

      For one project in particular I saved all of these together as a master component. There was someone else working on a presentation, and I just had them swap out the master component when the needed it. Also the file had lots of high res photo matches and I was emailing across the country. So rather than re-sending the big file with the scenes, I sent the stripped down component without any scene info.

      This same thing can apply to have the same model shown from different locations or orientations; The trick is I used a separate SU file for each one, and then just imported the master component. Every time I updated the model, I would then update the component instance.

      posted in SketchUp Discussions
      DavidBoulderD
      DavidBoulder
    • RE: Different timezone per scene?

      @thomthom said:

      We often set up sun studies, with top down perspektives, black&white, with shadows at different times of the day as well as well as different times of the year. That means some are within DST and some are not.

      Previously we just set different timezone for each scene. Now I'm concerned these old scenes will be incorrect when we open them again. Something I will need to stress as it can have quite an impact on the project if the shadows are wrong.

      For new ones I could just offset the time by one hour, but this whole change in SU7 really bothers me.

      It would be interesting to open one up and we what happens (with a copy or autosave turned off of course). Seems like for a given scene there are two outcomes.

      A. The shadow is shown properly but the time shown has been altered.
      B. Or the time stays the same but the shadow shows incorrectly

      I'd like A vs. B, but I guess there is an option C as well.
      C. SU 7 while it doesn't allow you to change the time zone by scene does respect old files which already have scenes setup this way. However you wouldn't be able to make new files from scratch like this, and once you change the time zone in your new SU7 file, you may lose the ability to offset again (for that file).

      posted in SketchUp Discussions
      DavidBoulderD
      DavidBoulder
    • RE: View

      If you want them to appear parallel in your view (e.g. not converging up or down), then you need to make sure your camera is level (Camera and Target are at the same height). You can eyeball this if you just want to be close, or start with a camera that is level, and never tilt it up or down.

      posted in SketchUp Discussions
      DavidBoulderD
      DavidBoulder
    • RE: Different timezone per scene?

      So why do you want a different time zone for different scenes. The only reason I can think this would matter is for shadows, and the geometry of the shadows throughout the day is determined by the geo-location. Of course if sunrise is at 6:37am vs. 5:37am or 7:37am is determined by time zone, or DST (which SU doesn't support?).

      Are you going to display the time alongside the shadows? If this will be done through a ruby can you just do some math inside of the ruby to allow for TimeZone or DST adjustment?

      posted in SketchUp Discussions
      DavidBoulderD
      DavidBoulder
    • RE: [plugin request]

      If you were using a very simple primitive (like a box) I would think you could do volume as well. Could even just bey a dynamic component.

      posted in Plugins
      DavidBoulderD
      DavidBoulder
    • RE: Face Me Components in relation to the SUN?

      If all of your faceme objets have shadows that fall onto a flat surfaces (vs. hitting walls, steps, etc.) then maybe you could make a dynamic component with two sub components. One sub-component is the face me object and it faces the camera. The other sub-component is a fake shadow. It is the same object but with translucent gray fill and it is on the ground. Then this would be set to face the sun vs. camera, and ideally would set the length of this to scale based on the hight of the sun angle.

      Maybe an alternative is to swap out your face me objects for real 3d objects just before exporting to Vray. If you don't like the look of these 3d objects you could always make a duplicate rendering with your faceme components and layer in Photoshop to mask these back in. You would just have to make sure the faceme objects are slightly larger than the 3d objects, and you run into issues of seeing the same object from multiple views, don't know how Vray deals with that and faceme objects.

      posted in Developers' Forum
      DavidBoulderD
      DavidBoulder
    • 1 / 1