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

    installtechireland

    @installtechireland

    10
    Reputation
    1
    Profile views
    10
    Posts
    0
    Followers
    0
    Following
    Joined
    Last Online

    installtechireland Unfollow Follow
    registered-users

    Latest posts made by installtechireland

    • RE: Syntax error + no sleep + crummy suspension = please help!

      hmm, so I've used

      **face1 = container.add_face ( [0,0,80.mm],[l+160.mm,0,80.mm],[l+160.mm,0,180.mm],[0,0,180.mm],[0,0,80.mm] )
      face1.material = mat1**
      

      but what happens is that sketchup makes face1, doesn't give it a texture, and then leaves out everything after that point, i.e. the rest of the model...

      is my material spec wrong?

      mats = Sketchup.active_model.materials
      mat1 = mats.add "Wood_Plywood_Knots"

      do i need to add a file path? like "library/googlesketchup/materials/Wood_Plywood_Knots" or something?

      posted in Developers' Forum
      I
      installtechireland
    • RE: Syntax error + no sleep + crummy suspension = please help!

      can I leave out the ()'s altogether and just write:

      face1 = container.add_face [0,0,80.mm],[l+160.mm,0,80.mm],[l+160.mm,0,180.mm],[0,0,180.mm],[0,0,80.mm]
      face1.material = mat1

      posted in Developers' Forum
      I
      installtechireland
    • RE: Syntax error + no sleep + crummy suspension = please help!

      ah, sweet, I didn't spot the (lack of) space in front of the ()'s, cheers for that. Also, didn't know about using two separate lines.

      Thanks for the advice. At least the truck has stopped moving now, waiting to get on a ferry at Holyhead, I might get this one finished in the time available now!

      Many thanks,

      Cathal

      posted in Developers' Forum
      I
      installtechireland
    • RE: Syntax error + no sleep + crummy suspension = please help!

      Ok, so this is what I have at the moment:

      at the start of the plugin I have:

      mats = Sketchup.active_model.materials
      mat1 = mats.add "Wood_Plywood_Knots"

      and then later I have:

      face1 = container.add_face ( [0,0,80.mm],[l+160.mm,0,80.mm],[l+160.mm,0,180.mm],[0,0,180.mm],[0,0,80.mm] ) face1.material = mat1

      and this is the error I get:

      Error Loading File test.rb
      /Library/Application Support/Google SketchUp 8/SketchUp/Plugins/test.rb:44: parse error, unexpected tIDENTIFIER, expecting kEND
      face1 = container.add_face ( [0,0,80.mm],[l+160.mm,0,80.mm],[l+160.mm,0,180.mm],[0,0,180.mm],[0,0,80.mm] ) face1.material = mat1
      ^

      so what am I doing wrong?

      posted in Developers' Forum
      I
      installtechireland
    • Syntax error + no sleep + crummy suspension = please help!

      Ok, so I'm currently bouncing across north Wales in a truck, trying to finish a ruby plugin. The lack of sleep, coupled with a bouncy truck is making it difficult, and I have come up against a wall (figuratively speaking).

      I have all the faces I want in my model. Now I want to add textures. Specifically, I want to add two different textures, one to only 6 or so faces and one to all the rest (about 40). Every time I add in code to do this it fails. Can someone point me in the direction of what I should be doing?

      I'm guessing I need to call a material as a default and then just add the other one as it's needed but I can't get it right.

      Any help greatly appreciated.

      Cathal.

      posted in Developers' Forum
      I
      installtechireland
    • RE: Huh? Units? WTH?

      ...

      ah yes. I was using "a-20mm", not "a-20.mm", wondering why it didn't work...

      thanks πŸ˜„

      posted in SketchUp Discussions
      I
      installtechireland
    • Huh? Units? WTH?

      So, I have this code:

      def create_entities(data, container)

      a = data["a"].to_l
      w = data["w"].to_l
      h = data["h"].to_l
      
      pts = [[0,0,0], [a,0,0], [a,w,0], [0,w,0], [0,0,0]]
      base = container.add_face pts
      

      Obviously, that's not the whole thing. It makes a box eventually, based on the points defined above.

      Now, I want to alter the box to mae one side shorter than the other.

      The default Length "a" is 1000mm. When I replace point [a,0,0] with [a-20,0,0] I get a weird result. I expect a-20 to be 980mm, but I end up with a side that is 492mm, which implies Sketchup is taking off 20 inches, not mm. How do I tell it to read all units as mm? I am using the Engineering (mm) template if that makes any difference.

      Any help appreciated.

      Regards,

      Cathal

      posted in SketchUp Discussions sketchup
      I
      installtechireland
    • RE: Import csv data using ruby

      That's fantastic, thanks so much.

      posted in SketchUp Discussions
      I
      installtechireland
    • RE: Import csv data using ruby

      Hi, thanks for replying so fast.

      I'll post an error code as soon as I can find it again: I'm on a different machine right now.

      Regarding making faces, I was simply using:

      pt1 = [0,0,0]
      pt2 = [0,1,0]
      pt3 = [1,1,0]
      pt4 = [1,0,0]

      face = Sketchup.active_model.entities. add_face pt1, pt2, pt3, pt4

      I can continue to do that with the rest of the points. But how do I tell it that the first line of the csv file defines "pt1", the second line defines "pt2", etc?

      Apologies if this is very basic stuff, I only started with Ruby last week 😞

      Cathal

      posted in SketchUp Discussions
      I
      installtechireland
    • Import csv data using ruby

      Howdy folks, I'm hoping someone can help me out. I want to do three things, can anyone cleverer than me tell me whether this is possible?

      1: Using the ruby window, access xyz data in a csv file

      2: define each xyz co-ordinate as a point

      3: draw a face between the points.

      I can define points and draw the face no problem. But when I try to access the csv file I just get error messages. Is there somewhere I need to put the csv file? Even better, does anyone know a plugin that will do this for me?

      Regards,

      Cathal

      posted in SketchUp Discussions sketchup
      I
      installtechireland