sketchucation logo sketchucation
    • Login
    1. Home
    2. kaas
    3. Posts
    Oops, your profile's looking a bit empty! To help us tailor your experience, please fill in key details like your SketchUp version, skill level, operating system, and more. Update and save your info on your profile page today!
    πŸ«› Lightbeans Update | Metallic and Roughness auto-applied in SketchUp 2025+ Download
    K
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 47
    • Posts 864
    • Groups 1

    Posts

    Recent Best Controversial
    • RE: [solved!!]onMouseMove show component instance

      Still trying to figure it out. Tested it by putting the code directly into the Ruby Console and putting it into a rb-file.

      Try with a freshly started Sketchup 2014 and delete 'Sophie' (but leave her in the component definitions). First I executed in the Ruby Console:

      
      @model = Sketchup.active_model
      @ents = @model.entities
      @defs = @model.definitions
      inst = @defs["Sophie"]
      @model.place_component inst,false
      
      

      Place her anywhere but not on the origin 0,0,0

      Second run this:

      
      @ents.each {|e|
      next unless e.is_a?(Sketchup;;ComponentInstance)
      puts e.transformation.origin
      }
      
      

      You get the proper coordinates of Sophie.

      Now I delete all Sophies but leave her in the component definitions.
      I wrap the above code into a plugin. I need to add an observer so the code can pick it up again (place_component breaks the code). I load it and start it with: MB_place_instance.activate

      The first placed instance always returns 0,0,0 as the origin. Add another one (activate again) and it returns the origin of the first added instance etc... Looks like its returning the definition and not the placed instance.

      There must be some logic in it but I fail to see it...

      
      require 'sketchup.rb'
      module MB_place_instance
      
      	class MyDefObserver < Sketchup;;DefinitionObserver ### create an observer (place_component breaks the code and returns to SU) ###
      	   def onComponentInstanceAdded(definition, instance)
      		 puts "observer has fired; " + instance.to_s
      		 MB_place_instance.refire(instance) # go back to the tool
      	   end
      	end
      
      	def self.activate
      		@model = Sketchup.active_model
      		@ents = @model.entities
      		@defs = @model.definitions
      		inst = @defs["Sophie"]
      		@observer = MyDefObserver.new
      		@model.definitions[0].add_observer(@observer)
      		@model.place_component inst,false
      	end #def
      	
      	def self.refire(instance)
      		@defs[0].remove_observer(@observer) # delete the observer
      		@observer = nil # delete the observer in case previous method fails
      		GC.start # collect garbage
      		@ents.each {|e|
      			next unless e.is_a?(Sketchup;;ComponentInstance)
      			puts "looking with each; #{e.transformation.origin}"
      		}	
      		puts "directly adressing passed instance; #{instance.transformation.origin}"
      	end #def
      	
      end #module
      
      ### start in RubyConsole with; MB_place_instance.activate
      
      
      posted in Developers' Forum
      K
      kaas
    • RE: [solved!!]onMouseMove show component instance

      @tig said:

      You already have a reference to the instance called @instance - so, without re-coding [so you make a definition rather than an instance], you can get a reference to the instance's definition thus: @defn=@instance.definition, then immediately erase the instance with @instance.erase!...
      And then you NOW use @model.place_component(@defn) πŸ˜•

      ...? I changed the code a bit compared what I posted a few posts above. Now, at the start of model.place_component for the first time there is no instance in the model, only a definition. So I'm not sure what I should delete here.

      I ask myself: is the result of Sketchup.active_model.place_componentthe same context as Sketchup.active_model.entities?

      posted in Developers' Forum
      K
      kaas
    • RE: [solved!!]onMouseMove show component instance

      @tig said:

      ..Why not use the way that mimics the native component placer - http://www.sketchup.com/intl/en/developer/docs/ourdoc/model#place_component...

      I gave your suggestion a go. Instead of adding the component to the mouse I used @model.place_component ... and have the code pick it up again with an observer.

      Problem I now face: the newest added instance doesn't show up if I look for it. My guess is: its returning the definition info instead.

      I tried:

      @entities.each {|e|
         puts e.to_s
         next unless e.is_a?(Sketchup;;ComponentInstance)
         puts "instance; #{e.to_s}"
         puts "origin; #{e.transformation.origin}"
      }
      
      

      OR

      	
         instance = @definitions[instance_def_name]
         puts "instance; #{instance.instances[0].to_s}"
         puts "origin; #{instance.instances[0].transformation.origin}"
      
      

      Only if I add another (and another) instance, all but the last one are found (see animated gif).

      I must be missing something elementary... Any suggestions?


      problem.gif

      posted in Developers' Forum
      K
      kaas
    • RE: [solved!!]onMouseMove show component instance

      Hi TIG,

      Thanks for your suggestion. I changed the code, drew a simple rectangle and pushed-pulled it. After picking it throws an error on the 'glue-line':
      Error: #<ArgumentError: Can only glue to something in the same component>
      Doesn't make sense to me. They should be both in the same context: Sketchup.active_model.entities. Google-ing this error results in another thread you were active in http://sketchucation.com/forums/viewtopic.php?f=180%26amp;t=54813 but no help there. Any suggestions anyone?

      def onLButtonUp(flags, x, y, view)
      	ph = view.pick_helper
      	ph.do_pick(x, y)
      	face = ph.picked_face
      	@instance.move!(Geom;;Transformation.new(@ipP.position))
      	view.invalidate
      	if face
      		@instance.glued_to=face
      	end	
      end
      
      posted in Developers' Forum
      K
      kaas
    • RE: [solved!!]onMouseMove show component instance

      @tt_su said:

      In addition to changing the behaviour you need to use glued_to= to specify what it should be glued to.

      Hello Thomas, Thanks for your reply.

      I want the component to glue to any face in the model, just like a normal glue-ing component would do, if inserted from the component browser.

      Funny part is: when using the code below the instance doesn't glue. If I manually pick the component afterwards from the component browser and place it, it does glue...??

      def activate
      	@model = Sketchup.active_model
      	@definitions = @model.definitions
      	@entities = @model.entities	
              @ip = Sketchup;;InputPoint.new
      	@ipP = Sketchup;;InputPoint.new	
      		
      	size = 20
      	pm = Geom;;PolygonMesh.new
      	pm.add_point([-size, -size, 0]) # 1
      	pm.add_point([-size, size, 0]) # 2
      	pm.add_point([size, size, 0]) # 3
      	pm.add_point([size, -size, 0]) # 4
      	pm.add_polygon(1,3,2,4)
      	
      	smooth_flags = Geom;;PolygonMesh;;NO_SMOOTH_OR_HIDE
      	mb_rundim_plane_def = @definitions.add("mb_runDimPlane");
      	dim_plane = mb_rundim_plane_def.entities.add_faces_from_mesh(pm, smooth_flags)
      	behavior = mb_rundim_plane_def.behavior
      	behavior.snapto = SnapTo_Arbitrary
      	behavior.is2d = true
      	
      	@instance = @entities.add_instance(mb_rundim_plane_def, ORIGIN)
      end # def activate
      
      def onMouseMove(flags, x, y, view)
        @ip.pick(view, x, y)
        if @ip != @ipP && @instance
          view.invalidate if( @ip.display? or @ipP.display? )
          @ipP.copy!(@ip)
          view.tooltip=@ipP.tooltip
          @instance.move!(Geom;;Transformation.new(@ipP.position))
        end
      end
      
      def onLButtonDown(flags, x, y, view)
        return nil if not @instance
        @ipP.pick(view, x, y)
        if @ipP.valid?
          @instance.move!(Geom;;Transformation.new(@ipP.position))
          @instance=nil
        end
      end
      
      posted in Developers' Forum
      K
      kaas
    • RE: Profile Builder Pro Wishlist

      @whaat said:

      I'd love to hear more features requests for Profile Builder. The next version is currently in development.

      Another one from me: the option to sort profiles by name. The current list is sorted by order of addition to the profile libs. Re-Sorting by name after a new profile is added would be nice.

      posted in Plugins
      K
      kaas
    • RE: [solved!!]onMouseMove show component instance

      I'm trying out several methods for a plugin-user to define a plane. Picking 3 points works but maybe more easy would be to use a component plane thats glues to the underlying objects.

      Using the code from this thread I can attach a component-plane to the mouse pointer.

      behavior = @plane_def.behavior behavior.snapto = SnapTo_Arbitrary behavior.is2d = true

      Adding this code makes the component-plane glue to objects but only outside the ruby code as it seems. The glue works if the component is picked from the component browser OR if the component is added with model.place_component componentdefinition, repeat. Then I would have to add an observer to have the code pick it up again.

      Is there any way around this?

      edit: changed 'listener' to 'observer'

      posted in Developers' Forum
      K
      kaas
    • RE: Profile Builder Pro Wishlist

      @whaat said:

      I'd love to hear more features requests for Profile Builder. The next version is currently in development.

      I use the current pb pro all the time and am very happy with it.
      My main request would be: multiple not connected shapes to be used as a profile (useful for instantly making a cavity wall etc)

      posted in Plugins
      K
      kaas
    • RE: Wacom Pen in SketchUp?

      @mistro11 said:

      ...I would like to know a good effective way to assign buttons.

      I switched to a simple bamboo a while ago and it works perfect in SketchUp. My setup is:

      • richt-click on the pen is richt-click: the context menu's are too nice to give up.
      • left-click on the pen is middle-click. Hovering over the tablet while pressing left-lick = orbit & with shift = pan.
      • I don't use the buttons on the tablet it self.
      • for staring tools in Sketchup I use a combination of clicking the menus/icons or using the keyboard shortcuts.

      The above works really fast and easy for me. Working for quite some hours at a time is far more easy on my wrist compared to using a mouse.

      posted in SketchUp Discussions
      K
      kaas
    • RE: Modeling Techniques for proper construction drawings

      Interesting topic!

      I prefer to use layout only for adding texts and annotations. Everything else, including hatches and dimensions, is done in SketchUp. SketchUp is more fast, more reliable, more fun and the 3d model can be opened by the client as well.

      Some elements are only modeled in 3d as a simple volume and it's details are added in 2d in the sectioncut (ventilation duct, a timber framed wall).

      Plugins that make the process more easy are:

      • ProfileBuilder by Whaat
      • SectionCutface by TIG
      • 2dBoolean by Jolran

      section.jpg


      model.jpg

      posted in LayOut Discussions
      K
      kaas
    • RE: Ruby: 3d align components

      @sdmitch said:

      If you are willing to post or pm me a sample model and the plugin, I will be glad to see what if anything I can do with it.

      Hi Sdmitch, thanks for your offer. Jolran and I are already pm-ing about a solution so I think it will be already resolved.

      Max

      posted in Developers' Forum
      K
      kaas
    • Ruby: 3d align components

      I'm trying to make a plugin that array-copies components along a line in a chosen plane. It could be used to assist in filling sections with real line hatches. See image:

      1. some custom components, axis at each bottom left corner.
      2. choose component from list
        3a pick starting point, 3b pick end point, 3c pick point to set plane of component (and maybe later for scaling some components to fit between parallel lines)

      I'm no smart coder at all so have used quite some bits from TIG's mirror.rb. It works..a bit.. but with several vectors the rotation goes totally wrong (for instance 3abc in the middle). I hope someone can help me out a bit and point me into the right direction.

      
      def drawArray
         @bbox = @comp_copy.bounds #bounding box of chosen component
         @v1= @pos1.vector_to (@pos2) # vector between first and second picked point
         @copies = (@v1.length / @bbox.width).ceil # set number of copies
         @nv1 = @v1.length = @bbox.width #set spacing on vector = width of component
         @baseVector = Geom;;Vector3d.new 1,0,0 #base vector of component
         @baseNormal = Geom;;Vector3d.new 0,0,1 #base normal of component
         @deltaVect = (@baseVector.angle_between @v1).radians	#angle between base component and chosen path
         @plane = Geom.fit_plane_to_points(@ip1.position, @ip2.position, @ip3.position)
         @planeNormal = Geom;;Vector3d.new(@plane[0], @plane[1], @plane[2])
         @deltaNorm = (@baseNormal.angle_between @planeNormal).radians #angle between normal of component and normal of the 3 picked points
         @first=true
         while @copies > 0
         if @first 
            @translation = Geom;;Transformation.new(@pos1)
            @rotV = Geom;;Transformation.rotation(@pos1,@planeNormal,@deltaVect.degrees)
            @rotN = Geom;;Transformation.rotation(@pos1,@v1,@deltaNorm.degrees)
         else
            @v1.length = @bbox.width*@copies
            @translation = Geom;;Transformation.new(@pos1 + @v1) 
            @rotV = Geom;;Transformation.rotation(@pos1+@v1,@planeNormal,@deltaVect.degrees)
            @rotN = Geom;;Transformation.rotation(@pos1+@v1,@v1,@deltaNorm.degrees)
         end
         @componentinstance = @entities.add_instance(@comp_copy, @translation)
         @componentinstance.transform! (@rotV)
         @componentinstance.transform! (@rotN)
         @copies -= 1
         @first=false
      end
      @state=0
      end
      
      

      arrayCompAtLine.jpg

      posted in Developers' Forum
      K
      kaas
    • RE: Sketchup Freeze after startup

      What do you mean by "freeze" ? A long delay or a total freeze?

      I experience several seconds of delay at the startup of SketchUp. Removing the Sketchucation loader removes the delay. If my network is very busy, the delay could get quite long. So for now, I always have the loader disabled unless I want to update / download a plugin and afterwards, the loader is immediately disabled again (change the extension of the loader from .rb to .rb! ).

      See more here: http://sketchucation.com/forums/viewtopic.php?f=10%26amp;t=55850%26amp;start=120#p522116

      posted in Newbie Forum
      K
      kaas
    • RE: Color by axis - accuracy?

      Hello Wo3Dan,

      I did read up a bit on several forums about accuracy (your name came up a few times there as well πŸ˜„. Was an interesting read.

      In hindsight, I'm most likely the cause for the errors maybe because of scaling an object that was already a bit off (I didn't notice because at that time I was relying on ColorByAxis). Will change my workflow a small bit to make sure I can spot errors earlier.

      Thanks again for your reply!

      Max

      posted in SketchUp Discussions
      K
      kaas
    • RE: Color by axis - accuracy?

      Hi Wo3Dan,

      Thanks for your reply. I already gave up on the ColorByAxis because it turns out it's a known issue for many years (reading about it on the official SketchUp forum). Was a bad surprise for me though.

      Not as a solution for the color by axis issue, but to improve my accuracy for everything (and hopefully getting rid of the '~ dimensions' I experience AND the need for having to scale some objects 1000x before applying a boolean), for a brief moment I tried using meters instead of mm's using the same dimensions but I gave up on that too because of the issues I mentioned some posts above.

      I found a thread here from a few years ago and just started reading that one to see if there's any tips in there. http://sketchucation.com/forums/viewtopic.php?f=15%26amp;t=44142

      For me, as an architect, 1 mm is the accuracy I really need. It seems like that's on the edge of what SketchUp can do, especially after modifying, adding elements to another element etc. Will have to dig into it more though.

      Still, would be very welcome if SketchUp could get some attention to this accuracy issue that people who work with small dimensions have to find workarounds for. Not having to scale objects 1000x bigger before applying a boolean is welcome to my workflow as well.

      greetings,

      Max

      posted in SketchUp Discussions
      K
      kaas
    • RE: Color by axis - accuracy?

      @Bruce,

      If you, like me, tried ColorByAxis using meters you will have noticed it doesn't make any difference. As long as the deviation is within a certain 0.1% gap it's still displayed as correct. Pity you can't set the tolerance somewhere yourself.

      @Tandem, It should be known by the people @SketchUp because there are several post about it on the official forum.

      This accuracy issue when using the metric system (mm) is giving me more problems the more I think about it.
      The workaround would be to switch units to meters but enter dimensions as if I was in mm. I already do the same when working on more complex booleans otherwise they won't work.

      But, this gets me into more problems:

      1. I have to change scales in LayOut to compensate
      2. have to warn third parties using my drawings about the scale and units.
      3. I have to rebuild my ProfileBuilder library
      4. have to scale all my 3d model libraries
      5. components that I would download from the online component library are 1000x too small.
        6 ...

      In short: my 'solution' is giving me a lot more problems than I would like...

      posted in SketchUp Discussions
      K
      kaas
    • RE: Color by axis - accuracy?

      Did some reading on the SketchUp forum: https://productforums.google.com/forum/#!searchin/sketchup/accuracy/sketchup/XTgh3NYN3HQ/x1gqvdzHorwJ

      Might be a bigger issue for me here. The fact SketchUp internally uses inches (I use the metric system: mm's) and points might be welded because they fall within the internal tolerance threshold could get me into problems. If I draw a 10m straight wall, perform some operations and afterwards its 0,5% off the axis due to SketchUp's internal operations, I'm in trouble.

      Considering to switch to meter unit now while using the same numbers: 1mm = 1 m, internally should be 1000x more accurate? Just need to add some new scales in Layout to compensate.

      I'm curious if other architects on this forum have run into this problem as well...

      Max

      posted in SketchUp Discussions
      K
      kaas
    • RE: Suggestions to improve Layout

      Going to quote myself here because this behavior really could use a fix in Windows.

      @kaas said:

      If I zoom to some portion of my paper in Layout, switch (click or alt-tab) to another program and switch back to Layout (alt-tab or click), it reverted to zoom all. Would prefer if Layout wouldn't change zoom. New feature in 2014?

      Also, I use a pen tablet in Layout (as well as in Sketchup). Annoying part is, when I draw (or edit) a line and want to zoom out to another point, pressing the shortcut key for zoom breaks the line command while in Sketchup pressing <esc> after shortcut-zooming picks up the line command again. Please make layout behave the same!

      posted in LayOut Feature Requests
      K
      kaas
    • Color by axis - accuracy?

      Anyone ever noticed there's a margin in accuracy when using the ColorByAxis style ?

      Had a bad surprise today in a remodeling project where the layout of the original house has a bit of a pie-shape (the side walls are not on an orthogonal grid). I used the 'color by axis' to check if the new walls were on an orthogonal grid.
      While adding the measurements I noticed several walls, that looked o.k. when checking by color by axis, were a few centimeters off the grid. Seems like there's a threshold that's far bigger than I would like to. Tested it in a new drawing and it's 1/1000 but in the project it was more like 4/1000.

      Any way to force Sketchup to use a much smaller or no margin at all? I'm working in mm's. Changing the precision for length & angle doesn't seem to affect it even after saving and reopening the file.

      posted in SketchUp Discussions sketchup
      K
      kaas
    • RE: Lighting

      @djh said:

      I tried Twilight, Maxwell, Lightup, Podium, and Thea. The rendering seems to take a long time and my computer crashes.

      CPU: E2200 @ 2,20GHz
      RAM: 2GB

      My guess is: you're scene is a bit too heavy (121047 edges, 54682 faces) for your computer to render. I did a quick rendering using LightUp and posted the 'render settings' if you want to try yourself. For your computer I would change the '3cm' to '30cm' to start with and if it doesn't crash divide it by 2 until it crashes again.


      LU_settings.jpg


      175 2A 003_LightUp.jpg

      posted in Newbie Forum
      K
      kaas
    • 1
    • 2
    • 31
    • 32
    • 33
    • 34
    • 35
    • 43
    • 44
    • 33 / 44