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

    Posts

    Recent Best Controversial
    • RE: Sketchup8 Geo-location linking to a database via rubyscript

      Does anyone know how the Model Translation Attributes affect the eventual location in Google Earth?

      Im trying to get code to geolocate a model too however just entering a longitude and latitude manually in sketch up is not working. Im getting the long and lat from a place mark in Google Earth but when I put those values in the Sketchup model manually the model is placed far away from that place.

      [Edit: My problem was not converting from the degrees, minutes and seconds format in Google Earth to the decimal format used by Sketchup.
      e.g. https://www.fcc.gov/encyclopedia/degrees-minutes-seconds-tofrom-decimal-degrees]

      Im still interested to know the purpose of these attributes i.e.
      model.set_attribute key, "ModelTranslationX" , -12901579.2256146
      model.set_attribute key, "ModelTranslationY" , -214086056.635273

      Thanks...

      Paul Francis

      posted in Google Earth
      S
      spireup
    • Google Earth gone from Sketchup 6,8

      Hi

      Having problems accessing Google Earth from Sketchup 6,8.

      Have they cut the cord?

      kind regards

      Paul Francis

      posted in SketchUp Discussions sketchup
      S
      spireup
    • RE: [Plugin] HouseBuilder metric 1.2

      @mwm5053 It appears the program generates a walls quantities estimate.. Im sure Ive used it on the PC before.The tool icon is hb_estimate_L.png...

      posted in Plugins
      S
      spireup
    • RE: [Plugin] HouseBuilder metric 1.2

      Does anyone know where HouseBuilder stores the Section List on a Mac? I cant seem to find it.

      posted in Plugins
      S
      spireup
    • RE: Floorplan app on ipad

      I guess my question was whether people thought an application hosted on a desktop and controlled using remote access software from the IPad would be effective. Local IPad developers think it would be too slow.
      \

      posted in Developers' Forum
      S
      spireup
    • Floorplan app on ipad

      Hi

      This underfloor insulator wants an ipad app that he can go onsite, draw a floor plan then harvest take off data into custom reports that show various things.

      Im thinking/dreaming that I could build something in Sketchup and Excel with a remote desktop ipad app.

      So on his Ipad he would effectively be controlling sketchup on a server back at his office and then push a toolbar button in sketchup to export the take off data to generate reports he could view remotely in Excel.

      any thoughts?

      kind regards

      Paul Francis

      posted in Developers' Forum
      S
      spireup
    • RE: Push pull problems/face orientation wobbly

      Thanks Dan. Will do.

      [edit]
      In the end I set up a vector in the direction I wanted the face to go and used "samedirection" to check and used reverse liked you suggested. Initially I tried 'parrallel?' not thinking that that wouldnt catch vectors in the exact opposite direction.

      if not(face.normal.samedirection? correctV3d ) then face.reverse!
      	
      end
      

      This worked.

      posted in Developers' Forum
      S
      spireup
    • Push pull problems/face orientation wobbly

      Hi

      Im creating 3d geometry using the method in the 'Creating Geometry' tutorial at https://developers.google.com/sketchup/docs/tutorial_geometry

      ie specify point then add a face then use push pull to add third dimension.

      Problem is sometimes the push pull is going in the wrong direction. Ive read somewhere thats to do with face orientation. I think whats happening is that when the geometry is being drawn next to existing geometry it is triggering some sort of new face or face orientation linked to the existing geometry that is different to what I would expect if I was drawing in isolation.

      Workarounds Ive thought of are

      1. draw the new geometry outside the models bounding box and bring it into place.
      2. use another way than pushpull to create the extra dimension
      3. build in context awareness to the code so that the face orientation cant be messed up by existing geometry.
      4. find a way to force the face orientation in every case regardless of context.

      Anyway I thought Id put the problem to the group because I imagine this could be quite a nooby way of creating geometry and Id be keen to hear of better ways. Im keen to hear of any better ways to do things/think.

      Thanks for your help.

      Paul

      posted in Developers' Forum
      S
      spireup
    • RE: Level of a component

      @boris vaisman said:

      Hi everybody,

      I'm working on a plugin which exports all the components in a csv file and i need the property that gives the level of the component.

      Hi Boris

      Your English is great however I can think of at least four meanings for the english word "level" that you might mean. If Davids answer doesnt help perhaps you could indicate which(if any) of these you mean?

      1. In a building : "level" can refer to the floor or story of a multistory building. Example "The entrance is on level one, the kitchen is on level two." means the entrance is on the bottom story and the kitchen on the second story/floor.

      2. In a hierarchy : "level" can be used like David has to refer to the how far "up" the hierarchy / tree your object is.

      3. In ?physics/geometry/building : "level" can mean "flat" or perfectly horizontal/vertical. Example "That window ledge is not level" means the window ledge is not perfectly horizontal.

      4 In CAD programs : "level" might refer to a "layer" . Example "Draw your house floorplan on level 0 and then draw 3D elements on other unique layers eg level 1 - 20".

      cheers

      Paul

      posted in Developers' Forum
      S
      spireup
    • Drawing a parallel line

      Hi

      I want to be able to supply a line and a width to a method and have the method draw a rectangle based on that line and a parallel line that width apart.

      I want to use this for drawing the footprints of walls that may be sloped or paths on sloped terrain etc.

      My question is what is the precise transformation required to get this second parallel line? Im considering working either with points perhaps using the offset method or with vectors. Either way I need to figure out the right transformation.

      One thing Im thinking is that a perpendicular line to the original line of length 'width' would be a useful vector. However when I try and calculate that I cant figure out which plane Im meant to rotate in to get it(is it multiple planes)!

      One problem with perpendicular lines is i can see that there are at least two perpendicular lines to any one line ignoring direction.

      thanks heaps for any help!

      Paul

      posted in Developers' Forum
      S
      spireup
    • RE: Iterator problem

      @tig said:

      class Widget
      >   attr_accessor( ;x, ;y, ;z, ;length )###etc
      >   ### rest of methods
      >   ###
      > end
      

      will return the instance variables @x, @length etc that will get set inside other class methods etc, in the form Widget.x or Widget.length etc......

      Thanks TIG. Yes Ive figured out that attr_accessor and was successfully accessing my Classes properties but not in the context of the suggestions of using Arrays or Hashes as super classes.

      Dan illustrates this

      @dan rathbun said:

      class WidgetSet < Array
      > end # class
      > 
      > MyWidgets = WidgetSet.new()
      > 
      > class Widget
      >   attr_accessor( ;x, ;y, ;z, ;length )###etc
      >   def initialize(*args)
      >     # args array can be used here to init
      >     # attribute values @x, @y, etc.
      >     MyWidgets < self # append this instance to set
      >   end
      > end #class
      

      Now Im just trying to get the syntax right for those inner args arrays. eg(not working)

      class WidgetSet < Array
      end # class
      
      class Widget < Hash
        
        attr_accessor ;arg1, ;xPos, ;yPos, ;zPos, ;height, ;width, ;type
      
        def initialize(arg1, xPos, yPos, zPos, height, width, type)
        
          Hash.new["arg1", arg1, "xPos",xPos,"yPos",yPos,"height", height, "width", width,"type", type] 
          @arg1 = arg1  ##etc for each arg
          MyWidgets < self 
        end 
      
      posted in Developers' Forum
      S
      spireup
    • RE: Iterator problem

      @dan rathbun said:

      You need two classes:

      EDIT: you don't actually needs a custom Array subclass, you could do:
      MyWidgets = []
      and just use a normal Array if you don't need to add any custom methods to your Widget collection.

      Yes youre right Dan Ive been reading about Containers at http://www.ruby-doc.org/docs/ProgrammingRuby/ and I see they use two classes Song and SongList in their example.

      posted in Developers' Forum
      S
      spireup
    • RE: Iterator problem

      @dan rathbun said:

      BTW.. if you want your Widgets to persist across sessions.. perhaps Components and attached Attribute Dictionary might be a better solution. (You cannot add custom object class instances to a model's entities.)

      Ok thats an important point. Yes I would like my widgets to persist. But Im wanting to do a lot of analytics on the components so maybe Im going to need to use attribute dictionaries for working within sketchup but hash based classes for doing the analytics.

      I guess Im keen to learn each of the methods that has been suggested so I can choose the right one as I get more familiar with them and the project.

      Could you show me some example code of your earlier suggestion but using Hash as a superclass. Im interested in seeing how the initialize method would look to have say 4 properties xPos, yPos, zPos , type?

      posted in Developers' Forum
      S
      spireup
    • RE: Iterator problem

      @tig said:

      What are these Widget 'properties' ?

      Thanks TIG. Firstly my problem relates to all my classes rather than just one. Ive put Widget is as an example of my problem.

      However most classes will have x,y,z position info as properties plus a bunch of meta info properties such as :windZone, :snowZone, :saltZone, :quakeZone.

      Im mulling Dan and Jims suggestion of a subclass but Im not sure how these proeprties would fit into say a hash or an array. I read somewhere by ?thomthom that hashes perform better so Im going to try and work with them once I bend my head around them.

      posted in Developers' Forum
      S
      spireup
    • RE: Iterator problem

      @chris fullmer said:

      I think this is what you're getting at, translated to ruby syntax, best as I can tell.

      Hmmm. the .length didnt work. Came back undefined method. At the moment Widget is a bespoke class not like what the guys have suggested below.

      posted in Developers' Forum
      S
      spireup
    • RE: Iterator problem

      @tig said:

      Paul

      Your syntax seems to be shot to pieces...
      You seem to be mixing up 'if' and 'each' strangely... can you please explain in 'words' what you want to do and what each 'class/method' does... otherwise we are struggling 😒

      Yes Im miles off!
      What I want to do in words: I have a class called Widget. If there are no Widgets then I want to run a block of code. If there are some Widgets then I want to iterate through them and run a block of code using some or all of each Widgets properties.

      posted in Developers' Forum
      S
      spireup
    • Iterator problem

      Hi

      I would like to use the iterator idea in ruby for my own classes but am struggling.

      Heres an example thats not working

      
      if Widget.each = 0 
        
        then puts "nuo"
        
        else
          for myWidget in Widget.each
      
            puts myWidget.xPos
        
          end
      end
      
      

      Any thoughts?

      thanks

      Paul

      posted in Developers' Forum
      S
      spireup
    • RE: Class struggle

      ThomThom

      thanks so much!

      Paul

      posted in Developers' Forum
      S
      spireup
    • Class struggle

      Hi

      Im very new and struggling to access my first lot of class definitions.

      Ive scoured some online books but cant find the error. Can anyone spot the problem

      class Widget
      def initialize(xPos, yPos, zPos)
      @xPos = xPos
      @yPos = yPos
      @zPos = zPos
      end
      end

      myW= Widget.new(1.1,0,8)
      puts myW.inspect
      puts myW.xPos

      The inspect works fine but i cant access the attributes.

      Thanks

      Paul

      posted in Developers' Forum
      S
      spireup
    • 1 / 1