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

    Posts

    Recent Best Controversial
    • RE: Ruby Version for Sketchup 8.0 M1 on Mac ??

      @dan rathbun said:

      @wdbao said:

      i try to use CSV class, but it fails.

      See this post: http://forums.sketchucation.com/viewtopic.php?f=180&t=34381&p=302974#p302974

      Thanks again! Dan!
      you are a very good helper. and fast.
      you have showed me this load path code before. i just couldn't understand it fully then. now with more ruby reading, it all make sense to me.
      it feels great to be in a such nice community.
      i will keep read on.

      posted in Developers' Forum
      W
      wdbao
    • RE: Ruby Version for Sketchup 8.0 M1 on Mac ??

      i want to extend the build_in sketchup interpreter too.
      from the release note post by google here http://cfcl.com/twiki/bin/view/Projects/SketchUp/RE_Library_Use
      Su 8.0 on pc has a 1.8.6 and a 1.8.5 on mac
      the new 8.0 M1 release note says nothing about the ruby version. so i assume it is still the same.
      here http://cfcl.com/twiki/bin/view/Projects/SketchUp/RE_Library_Use
      Main.RichMorin post sth interesting. He also try to extend ruby inside su to other parts of the library, gems, etc.
      it semms that he hasn't work it out yet.
      but it's worth a try.
      and i hope some gurus follow this path and somebody find a way eventually
      note that even on pc it is 1.8.6 all right, but it has very limited access to the standard library and gems.
      i try to use CSV class, but it fails.

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      @dan rathbun said:

      @wdbao said:

      but i want to parse the data into hash.
      then i can access the data in a natural way.

      OK posted a second example that outputs record Hashes, same thread.
      [code] reading a CSV file

      Dan, you are marvellous! this will do.

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      thanks again.
      it is not a question.
      your help is greatly appreciated.
      the example code you posted is good for separating the header.
      but i want to parse the data into hash.
      then i can access the data in a natural way.

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      @dan rathbun said:

      To talk more about your CSV File question, I thought TIG posted an example here somewhere on the forums.

      It's not that hard.
      As each line of the file is read ( f = file.readline ) the var contains a string, so you'd use the String method .split and specify the character to split by.
      record = f.split(',')
      At that point the var record is an Array of String values.

      It's up to you if you wish to convert each record to Ruby data, line by line; or just collect an Array of record Arrays, close the file, then do your conversions all at once with a nested loop.

      thanks Dan
      it is easy to get the data on csv file this way. or any other files

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      i mean CSV library as one of the Ruby Standard Library
      http://forums.sketchucation.com/viewtopic.php?f=180&t=29544&start=0&hilit=ruby+library

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      it seems to me that Sketchup Ruby API don't have the CSV library.
      should i just use the File class
      or should i add the csv module to it
      and how?

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      @minguinhirigue said:

      wdbao, any improvment in this big project of yours ?

      progress has been slow
      now i still looking for ways to read csv files from inside the ruby script
      and make use of the data in csv files

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      @chrisglasier said:

      Also for the Ruby part see Automatic Sketchup which is reviewed in this topic.

      been busy with a lot of stuff
      now i am reading the automatic sketchup, since the author make the pdf file public.
      it's a really great work.
      and only now i truely understand the important of hirarchy chris have told me about.

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      I am actually glad you move this into public discussion
      if not boring you, i want to introduce myself more for better understanding:
      i am one of the only two college graduates in my small company and the other one hate English.
      so i am all alone on this.
      and i don't really have a lot of free time. Now i just work as a ordinary builder(one of the construction crews ). so a lot of hard labour and working overtime.
      But i still have a strong desire to learn new things.
      now i just put my original ideas on the table when i have a little free time.
      no more thorough thoughts,
      cause as times move on, i can never keep up with chris on this discussion.
      my original ideas are simply.
      i just want to model the whole building(mainly structural parts) with ruby codes.using scripts i can kill all the boring repeated modelling job once in all. Cause the main components in a concrete structure( the main building structure here in china), like reinforced columns, beams and slabs, are very similar in nature. they all follow some regional Coding( we have our Chinese Designing Coding for concrete) which can be totally represent in scripting codes. and then i can get the information which set the particularity of each component in a special project from the design institute( i am looking this at a construction standpoint).For example, a table of column which contain all the information about columns in a project.
      so it is all set. all i need to do is write the script which respect the Designing Code once, and make sure the data from design institute are readable for my script.
      When i get my model in sketchup for my project. there are three main things i want to do ( Chris, you are right. I really want to "be able to incorporate your research into your day to day work ")
      First, I can use this model to detect any problem before construction from the blueprint passed from the design institute. I believe they call it Collision Detection.
      Second, I can import this model into Synchro or Virtual Builder for construction Management.
      Third, I can use this model to illustrate some construction process.

      I had never been involved with complex data in programming or building design which you need " 3D spreadsheets". Chris, sorry that i still can't fully understand your way of handling complex data. why not just more columns? and information about components are not just 3 dimensionals. Just adding the timeline
      it will turn into 4D.

      i am working in a residential construction site. the structure is simple. so my original idea is to have two different models. One represent the design, one for the building actually constructed. you know for future comparison. and the data of different component are in separate spreadsheet in excel. My starting point is from Piling foundation. I have already have data on spreadsheets which contain the information about the pressed piles, like the actually length, diameter, the date constructed and so on. this is actually a construction record which i asked another college to put it into computer. and i have another file which contain all the coordinate of the piles. originally i use this mainly for surveying and setting out using total station. with this two i think i can construct the piles in sketchup. But i haven't finish the script yet. cause i need to finish my ruby tutorial first and i have some structural analysis to do.
      i think i all i need is a csv reader and the code using this data to form the geometry in sketchup.

      About the nameset. Chris, i download the file. but i don't think it working properly for me. or it just a hmtl problem of my browser. all i see is sth like Cgscsene which helps me to navigate the scene. i didn't see sth like Figure 3 or Figure 4 in your Essay. Never mind, i have read your essay about nameset.
      i believe your main purpose is organize "information that is assembled to direct a physical outcome". I think it's great idea. It really blow my mind. i never think that the information around building can be organize in such a way.
      But i think you need to form a whole new workflow to implement your ideas. i have read some articles about BIM. i think all those new solution is really good for different aspects of the design team to better understanding each other and limiting errors. But they haven't form a good workflow. the old paper oriented method did have its merits. Like some other BIM system, your nameset treat all the information as a unity. But in the specific step of the construction process, we just need a fraction of the information. Like in the setting out stage, we just need one or a few paper to set the position. i know we can extract that part of the information. But that would lead us back into the old workflow. what i mean is we need to consider the overall workflow.

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      @thomthom said:

      If you're starting out SU scripting you might find this sticky post interesting: http://forums.sketchucation.com/viewtopic.php?f=180&t=10142

      It is a great post
      thank you

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      @chrisglasier said:

      Just a few points you might like to consider.

      Objects are used in JavaScript rather than classes but hierarchies of both are important. So are the hierarchies of whatever you are trying to model. For example, does a wall belong to a room or to a floor? It also could belong to a concrete mix or a structure subcontract; a time period or a submission ... To make your data useful it needs to accept multiple links.

      To achieve this in spreadsheets is just too difficult. While in 1989 they became three dimensional with multiple sheets, they never really satisfactorily harboured 3d data. The solution I found was to simply lay down column and row headings side by side in columns. Each column has its own axis; while presented in 2D it actually represents 3D. A column of floor numbers is like a section, an adjacent column of room names like a plan. These columns move so that you can navigate to and manipulate large amounts of data and create as many links and cross links as you need.

      Data in spreadsheets can easily be converted into delimited plain text. If you have many you can create a macro to automate it somewhat. What I mean is that because data is in a spreadsheet don't assume the solution is limited to it. Really plain text is king because it is common to all proprietary and open source applications ... and humans!

      Input can always be done by non-professionals.

      I would suggest you think about a web based application with a Ruby file to work Sketchup.

      i have read some document about BIM
      and i just read some of webpages about your "namesets"
      the whole thing is a little bit hard for me to grasp all at once, considering i am a not a programmer and i just read some fraction of ruby tutorial
      but i find your ideas very fascinating
      i would definitely look into it

      your ideas about BIM is definitely the way for the future
      but right now i want to improve my existing work flow in my construction business.
      more over i need to come up with sth fast and consolidate myself confident to continue my work and my dream for the future

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      @chrisglasier said:

      I suggest you first review your understanding of the structure of coding in order to align your work to it. Think in terms of hierarchies of objects ... slabs, columns, beams ... beams, concrete, rebar ... then add qualifiers and activities as their properties/attributes/methods. You need to think about unique identities and navigation. You will need to automate your navigation as well as the devices that make the calculations and size and position the objects in Sketchup.

      thank you for your suggestion
      I am working in a construction right now. so i am very busy.
      and i am struggling to find time to learn ruby
      but i did have some new ideas for my project
      "Hierarchies of objects" i haven't think of that
      but i think i can define classes like pile\column\beam\slab with the needed property in it, some methods to get the position of the component in a three dimensional world etc.
      more importantly, i want my classes i defined above could access data in spreadsheet.
      in real projects, we may have a lot of spreadsheets from the design institute or the construction company
      and we could totally use those data to automated our work
      anyway using spreadsheet is a faster way to input all the data we needed and it could be done by non-professionals.
      right now i try to take the data about piles which my college put in a spreadsheet and turn it into a model in sketchup which contain all the information needed about the piles of our project.

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      but i like doing it in the bare ruby code
      cause dynamic component is kinda slow
      try to calculate the steel inside a multi-span beam, say six spans
      you will need a super computer for that
      dynamic component certainly make sth more easy to do
      but i am looking for some methods so that i can automated my work

      posted in Developers' Forum
      W
      wdbao
    • RE: Can i draw the whole building structure with code?

      thank you jim
      that helps a lot! i will dig into it.
      i always find this community's friendlyness
      but i am surprised for a reply so fast and so detailed
      thanks

      posted in Developers' Forum
      W
      wdbao
    • Can i draw the whole building structure with code?

      Hi
      I am a structural engineerer
      I have been using sketchup for some time
      and now i am looking into ruby (really fond of it)
      http://www.ibm.com/developerworks/opensource/library/os-eclipse-sketchup1/index.html
      follow this tutorial i set up the eclipse platform
      and through the sketchup bridge i can execute code writen in eclipse then get the model i want in sketchup
      i still spinning my head around this
      but can anyone tell me if i could draw the whole building structure (column beam wall floor and even steel)
      in this way? and organise everything in place like using the skethcup button? ( assigning different geometry in the right group or component with the according name)

      i have been reading a lot of docs about ruby and sketchup api
      i have know how to add stuff
      but how do you make sure that every time you draw some entities and it goes to the right named component.
      everywhere i look is this example

      Grab a handle to the currently active model (aka the one the user is

      looking at in SketchUp.)

      model = Sketchup.active_model

      Grab other handles to commonly used collections inside the model.

      entities = model.entities
      it looks like to me it grab all the entities in the model.
      i may want to draw a column and then assign it to a named component and draw some more and assign it to another one.
      how do i keep track of everything i draw? is the observer gonna do the trick?

      any word on this will be really appreciated

      posted in Developers' Forum
      W
      wdbao
    • RE: Making virtual worlds with sketchup

      what a great tutorial
      it's like playing games

      posted in SketchUp Tutorials
      W
      wdbao
    • RE: Free form script w/ structure tutorial

      great tutorial
      but what is the 2cyl.rb what a strange name
      i've never heard it
      please tell me where i can find it

      posted in SketchUp Tutorials
      W
      wdbao
    • RE: [SP2]Basic Tutorial Posted (Moved & Improved) 5/11/08

      very nice tutorial

      posted in SketchyPhysics
      W
      wdbao
    • 1 / 1