sketchucation logo sketchucation
    • Login
    1. Home
    2. winzard
    ℹ️ 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 7
    • Posts 17
    • Groups 1

    winzard

    @winzard

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

    winzard Unfollow Follow
    registered-users

    Latest posts made by winzard

    • RE: How can import and locate the components by ruby script?

      The information is vrey important .And I want to import some components into coordinates by ruby scripts and locate the components by parameter form the user,What methods need to refer? Please give me some suggestions.Thanks!

      The size of components add a lot of difficulties,because space of the components need to taken in my ruby script.Now ,I have trouble to deal with that. Does some solutions be gave?
      😒

      posted in Developers' Forum
      W
      winzard
    • How can import and locate the components by ruby script?

      Everyboby ,I want to have the method relating to import and location of the components.Please give me help .Thanks!

      posted in Developers' Forum
      W
      winzard
    • RE: Does the method related long of models or components exist?

      @chris fullmer said:

      Hi winzard, yes you can controol those things. It is all in Transformations.

      Or if you you just want the z height of something, you can also iterate through all vertices and compare their heights. Take the highest and loset z values and compare them to see how tall the object is. Do the same for lengths.

      Or you can also get the bounding box of an object and then use the boundingbox methods to get the length and size of the bounding box.

      More info would help narrow down the best answer,

      Chris

      Thanks !The information is great help to me.

      posted in Developers' Forum
      W
      winzard
    • Does the method related long of models or components exist?

      Everyone,I want to know that whether some methods which control the long(wide or height) of the model or components is exist. If have,please give me the methods.Thanks!

      posted in Developers' Forum
      W
      winzard
    • RE: Why can not draw the geometric by the ruby script?

      The ruby script can not run in sketchup 6,but can run in sketchup 7. 😳

      posted in Developers' Forum
      W
      winzard
    • RE: What tools can help to debug?

      I find the answer in the community forums.

      posted in Developers' Forum
      W
      winzard
    • What tools can help to debug?

      I ues SciTE to compile ruby script πŸ˜• ..Because I need to sketchup ruby API.I find that the tools is difficult to debug.And please give some suggestions. 😳 Thanks!

      posted in Developers' Forum
      W
      winzard
    • Why can not draw the geometric by the ruby script?
      require 'sketchup.rb'
      def create_model()
      
        @lengthl=100.m if not @length1
        @widthl=50.m if not @widthl
        @number=4 if not @number
        @blength=10.m if not @blength
        @bwidth=5.m if not @bwidth
        @bheight=5.m if not @bheight
        @spacing=5.m if not @spacing
        prompts=["Length of Land; ","Width of Land; ","The Number of Building; ","Building Length; ","Building Width; ","Building Height; ","Building Spacing; "]###
        defaults=[@lengthl,@widthl,@number,@blength,@bwidth,@bheight,@spacing]
        input=UI.inputbox(prompts,defaults,[],"Create Model")
        return nil if not input 
        @lengthl,@widthl,@number,@blength,@bwidth,@bheight,@spacing=input
        amount=@number 
        model=Sketchup.active_model
        entities=model.active_entities 
        
        if @blength>@lengthl
          UI.messagebox('The Building Length is more than Length of Land!')
        elsif @bwidth>@widthl
          UI.messagebox('The Building Width is more than Width of Land!')
        else 
          model.start_operation("Create Model")### for the 'undo'
          x=0;y=0 ### also don't muddle the width/height !!!
        amount.times{|i|
            pt1=[x,y,0]###
            pt2=[x+@bwidth,y,0]###
            pt3=[x+@bwidth,y+@blength,0]###
            pt4=[x,y+@blength,0]###
            new_face=entities.add_face(pt1,pt2,pt3,pt4)
            new_face.pushpull(-@bheight)
            ### pushUpull typo !!! -ve = pull up as the face is reversed...
            y=y+@blength+@spacing ### set in a line
            x=x+@bwidth+@spacing   if y>@lengthl
            UI.messagebox('The area of land is inadequate !')  if x>@widthl
          } ###
        end #if##
        model.commit_operation ###
        
      end#def ###
      if not file_loaded?("2.rb") ### so only get menu item once...
        UI.menu("Plugins").add_item("Create Model2"){create_model} ###
      end#if ###
      file_loaded("2.rb") ###
      

      I have difficult to the script,help me 😒 .Thanks!

      posted in Developers' Forum
      W
      winzard
    • RE: I have a trouble in the code,and need help.thanks!

      Thank you very much!It is greate help to me! πŸ‘

      posted in Developers' Forum
      W
      winzard
    • I have a trouble in the code,and need help.thanks!
      require'sketchup.rb'
      class Model
         def create_model
            UI.messagebox('The number of the building less than 6!')
           prompts=["length of land","width of land","The number of building","building length","building width","building height","Spacing"]
           input=UI.inputbox prompts,"Create model"
           lengthl,widthl,number,blength,bwidth,bheight,spacing=input
           amount=0
           model=Sketchup.active_model
           entities=model.entities
           if(amount>6)
               then UI.messagebox('The number of the building more than 6!')
           pt1=[0,0,0]
           pt2=[0+bwidth,0,0]
           pt3=[0+blength,0+bwidth,0]
           pt4=[0,0+blength,0]
           new_face=entities.add_face pt1,pt2,pt3,pt4
           new_face.pushupull bheight
         end
      end
      UI.menu("Plugins").add_item("creat_model"){
      object=Model.new()
      object.create_model
      }
      

      I want to Creat Geometry by the code,but I can't find out where the error.

      posted in Developers' Forum
      W
      winzard