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

    dannyver

    @dannyver

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

    dannyver Unfollow Follow
    registered-users

    Latest posts made by dannyver

    • RE: Materials from face to components

      @tig said:

      This alternative one-liner will process all selected component-instances, making those instances take the material of the first face found within the component's definition.

      ms=[];mod=Sketchup.active_model;mod.selection.grep(Sketchup;;ComponentInstance).each{|i|d=i.definition;d.entities.grep(Sketchup;;Face).each{|f|ms<<f.material};m=ms.compact[0];i.material=m};
      

      To make a menu item of such simple commands you can try the following.
      It's not difficult - just take care...

      Use a plain-text editor, like Notepad++ [or TextWrangler on a MAC], and add a new file into your Plugins folder*** named say 'MyOneLiners.rb' - ensure that its encoding is set to UTF-8.
      Add this line to the very start of the file to be on the safe side:
      # encoding: UTF-8

      Then add the following line for each 'one-liner'...

      UI.menu("Plugins").add_item("TITLE"){CODE}

      Substituting your desired 'name' for your command in place of TITLE [keeping the paired ""], and also copy and paste the full code into where it says CODE [leaving the pair of enclosing {} ]

      Do a new line for each command you want.

      Save the RB file, and restart SketchUp to see your new command[s] listed under the SketchUp Extensions menu [previously called Plugins]...

      ***To open your Plugins folder [which is hidden by default] just copy+paste+enter this one-liner into the Ruby Console:

      UI.openURL("file;///#{Sketchup.find_support_file('Plugins')}")
      

      You could even add that command to your menu items, as say "OpenMyPluginsFolder" !

      Work fine thanks for the help !!

      posted in Newbie Forum
      D
      dannyver
    • RE: Materials from face to components

      @tig said:

      How do we determine the color you want for the component-instance ?
      There seem to be several different materials on various faces [or even sub-components] inside it ?

      If you select the component-instance and give it the default material in Entity Info then how does it export ?

      IFC always applies the 'container's' material to nested faces - the faces' materials are ignored.

      Try this one-liner, copy and paste it into the Ruby Console + enter.
      It examines the model's definitions and finds the first face inside each component-definition that has a material, it then applies that material [if any] onto every placed instance of that component.

      Sketchup.active_model.definitions.each{|d|next if d.group?||d.image?;ms=[];d.entities.grep(Sketchup;;Face).each{|f|ms<<f.material};m=ms.compact[0];d.instances.each{|i|i.material=m}}
      

      All sub-components only have 1 surface material.

      If I give the component standard material then it is all exported as light gray.

      This is exactly what I was looking for and works great. This saves me so much time thanks a lot !!

      Is it also possible to process this in a plugin?
      And can it then be that it only processes selected components when something is selected?

      posted in Newbie Forum
      D
      dannyver
    • RE: Materials from face to components

      @tig said:

      Unfortunately that explanation makes it even less clear.
      Where is the 'face' ?
      Where is the component-instance ?
      Where does the layer's color come into this ?

      Please explain how you do it manually, step-by-step - in very simple terms...
      I appreciate that it's likely that English is not your first language, so keep it very simple, to avoid things getting lost in translation...

      step 1 dwg import via xref
      step 2 copy xref component on a map
      step 3 open the xref component, the components contained therein provided with the same material as there is on the surface of the component
      stap 4 when I export the drawing to .ifc all components have the material / color of the component (green). this should be the material / color of face.

      So it would be handy if there were a plugin that would copy the material / color of the face to the component that contains the face.


      example

      posted in Newbie Forum
      D
      dannyver
    • RE: Materials from face to components

      @tig said:

      Please expand on this.
      There's probably insufficient detail to give a useful reply.
      However, here's my attempt at recasting what I think you mean...

      • You want a Plugin which will find a particular face's material and apply that material onto a particular component-instance.

      • How is the chosen face to be determined ?

      • How is the affected component-instance to be determined ?

      • Is there more than one instance of this component ?

      • Is the face actually nested inside the component that is to receive the material ?

      • Is that nested face to have its material removed after it's applied to the 'container' ?

      • Is this to only affect component-instances, or are groups also to be considered ?

      But... why can't you use the eyedropper-tool from the 'Materials Browser' dialog, and pick to select the desired face's material, then use the paint-bucket to paint the 'container', just as if you had selected the material off the browser itself ? Editing the container, and then exiting the edit, as necessary to access the face and container as needed.
      Note: to wipe a face's material, just select it with a single-click and use 'Entity Info' to reassign its front-material from the top icon-click and the 'default material which is always first in the swatches in the 'Choose Paint' dialog...

      I will explain why I could use this well. I now use an xref plugin to load an autocad drawing into sketchup. Then I place this loaded 98x component on a site plan of a building. then I export an .ifc of this.

      the problem is that now the colors are not exported because the colors of the composet are being exported but these are with a loaded .dwg the layer of colors from autocad.

      I could adjust this manually, but the autocad model is still often adjusted.

      posted in Newbie Forum
      D
      dannyver
    • Materials from face to components

      I am looking for a plugin with which I can transfer the material from the face to the first component. Does anyone have an idea or something for this?

      posted in Newbie Forum sketchup
      D
      dannyver
    • RE: [Plugin] View Parts (1.2) β€” Sept 13 2011

      it is not that it is not working, but it dos not work in site a components/group.

      it while make this plugin much more useful when it while work in site a component. maybe there is someone that can make it work

      posted in Plugins
      D
      dannyver
    • RE: [Plugin] View Parts (1.2) β€” Sept 13 2011

      @driven said:

      hi dannyver,

      I don't use SU 6 and I'm on a mac so it's hard to know what issues your having.

      maybe you could re-cast your question to target your setup better.

      e.g. "I've tried this plugin using SU6 on this skp and it doesn't seem to function, can someone check if it's my skp?

      or "can someone post a skp that works with this plugin in SU6 so I can check my setup..."

      With the first example you'll likely find out if your skp works or with the second you'll eliminate a wrongly setup skp...

      sorry I can't be of more help. Personally I know it 'basically' works on mac using SU8, but I only tested the functionality for future use.

      other than that I suggest checking you've got the latest version, and re-read any instructions or posts.
      also, if you no longer use SU6 update your User Settings.
      john

      i update my user settings right away πŸ˜‰

      posted in Plugins
      D
      dannyver
    • RE: [Plugin] View Parts (1.2) β€” Sept 13 2011

      @dannyver said:

      @jean-franco said:

      Hi,

      @driven said:

      I tried both standard and a version using TIG's mods, and although both create scenes, everything is hidden.

      I've the same situation under Windows XP 3.
      If I select components within a group and launch Viewparts, it creates all the needed scenes but all is hidden. And no way to unhide anything.

      Have a look at the attached file.

      Driven, If you don't mind, I'd like to have your updated script with TIG's modifications to do a test.
      I'm sorry but I'm really not a Ruby scripter.
      Thanks.

      [attachment=0:3wnzrn5t]<!-- ia0 -->cerificateur-scenes.skp<!-- ia0 -->[/attachment:3wnzrn5t]

      i have the same problem is ther any one ho has a answer or solution for this problem already ❓ ❓

      is there no one ho has a solution for this problem 😒 . this can make this plugin very useful πŸ˜„

      posted in Plugins
      D
      dannyver
    • RE: [Plugin] View Parts (1.2) β€” Sept 13 2011

      @jean-franco said:

      Hi,

      @driven said:

      I tried both standard and a version using TIG's mods, and although both create scenes, everything is hidden.

      I've the same situation under Windows XP 3.
      If I select components within a group and launch Viewparts, it creates all the needed scenes but all is hidden. And no way to unhide anything.

      Have a look at the attached file.

      Driven, If you don't mind, I'd like to have your updated script with TIG's modifications to do a test.
      I'm sorry but I'm really not a Ruby scripter.
      Thanks.

      [attachment=0:1k9cpp7m]<!-- ia0 -->cerificateur-scenes.skp<!-- ia0 -->[/attachment:1k9cpp7m]

      i have the same problem is ther any one ho has a answer or solution for this problem already ❓ ❓

      posted in Plugins
      D
      dannyver
    • RE: Layers

      i tough when ther wil be a plugin that can make it work that you can open a component whit the view mode hide rest of the model switch on
      and then you can make a scene of it and it whil save this the selection this would make it very easy to make scene's from different components! 😎

      posted in Newbie Forum
      D
      dannyver