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

    wawmsey7

    @wawmsey7

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

    wawmsey7 Unfollow Follow
    registered-users

    Latest posts made by wawmsey7

    • Surface area of a component/group made up of groups

      I want to get the total external surface area of a component or group that is made up of groups and components that are butted next to each other. So in effect the total surface area of the outer shell of the component not just the surface area of each of the groups/components added together. I appreciate that I could actually 'outer shell' the component and then just get the area of all the resultant faces and add them up - this would work but would slow down the process considerably when working with lots of parts.

      Is there a way of doing this without actually changing the model at all and therefore that doesn't slow down the process too much or does it all start to get quite complex?

      Thanks

      posted in Developers' Forum
      W
      wawmsey7
    • Call C++ from ruby in Sketchup

      I'm trying to enable panel optimisation in my plugin and the code to do this properly is exceedingly complex so I've been trying to track down some code that already exists for this... I run a mac and most libraries to run this function work with dll which is no good, but I have managed to track down one that should work with c++ ...

      http://optimalprograms.com/cut_2d_x.htm

      So my question is... If this does work (i've sent an email to the company to enquire), can I run / access the c++ file / function from within ruby and obtain the results in ruby...?

      would really appreciate it if anyone has any ideas on this or in general the whole panel optimisation / 2d bin backing / 2d stock cutting problem thing???

      Thanks

      posted in Developers' Forum
      W
      wawmsey7
    • RE: Webdialog - getting started?

      thanks for the help, that's a really useful reference!

      posted in Developers' Forum
      W
      wawmsey7
    • Webdialog - getting started?

      I'm wanting to make a basic webdialog for my plugin whereby the webdialog is simply used to set the variables in my script. I have basic knowledge of html, css and javascript so for the moment have managed to scramble together a basic form for my inputs.

      So for example the form goes:

      [pre:twxh754o]height : (input box)
      width : (input box)
      depth : (input box)

      (submit button)[/pre:twxh754o]

      (* I'm aware that it's easy enough to do this example using the UI.inputbox method but this is just a basic example so I can begin to wrap my head around using the webdialog!)

      So what would be the best way to get the data that the user inputs into the form and asign it to variables once they press the 'submit button'?

      Thanks in advance for your help,
      Matt

      posted in Developers' Forum
      W
      wawmsey7
    • RE: Load a vismat / vray material into sketchup using ruby code?

      I added a vismat material into the model and looked inside the material attribute dictionaries and found one dictionary that had one key "V-Ray for SketchUp Material Attribute"... This presumably holds all of the data vray needs for the material? the value for this is a really long a complicated load of stuff which begins....

      <Assets>
      <Asset renderer="vray" url="/Wood_02/Reflection/transparency_texture/TexFresnel" type="texture" layout="">
      <plugin>
      <vrayplugin version="7" type="texture" name="TexFresnel">
      <parameters>
      <parameter handler="default" listType="none" type="acolor texture" name="black_color_tex" label="Perpendicular Texture">
      <value></value>
      </parameter>
      <parameter handler="default" listType="none" type="acolor" name="black_color" label="Perpendicular">
      <value>
      <r>1.000000</r>
      <g>1.000000</g>
      <b>1.000000</b>
      </value>
      </parameter>
      <parameter handler="default" listType="none" type="bool" name="use_multiplier_as_exponent" label="Multiplier as exponent">
      <value>1</value>
      </parameter>
      <parameter handler="default" listType="none" type="float texture" name="refract_ior_tex" label="Refract IOR Texture">
      <value></value>
      </parameter>
      <parameter handler="default" listType="none" type="bool" name="invert" label="invert">
      <value>0</value>
      </parameter>
      <parameter handler="default" listType="none" type="float" name="refract_ior" label="Refract IOR">
      <value>1.550000</value>
      </parameter>
      <parameter handler="default" listType="none" type="float" name="fresnel_ior" label="IOR">
      <value>2.500000</value>
      </parameter>
      <parameter handler="default" listType="none" type="float" name="black_color_tex_mult" label="Perpendicular Texture Multiplier">
      <value>1.000000</value>
      

      and goes on... bla bla bla....

      so i guess if I put all this into the material in my code then it will behave like this vismat material when rendered??

      posted in V-Ray
      W
      wawmsey7
    • Load a vismat / vray material into sketchup using ruby code?

      Is it possible to load a vismat material into sketchup via the ruby script. So in this case i have written a script to draw some stuff and I now want to apply a saved vray material (.vismat) to it's faces as a part of the script so that it is all ready for rendering.
      Is this possible?

      If not, then what would be the best way to replace the material that is already mapped onto the faces how I want, with a vismat that has the same texture, so that the texture stays in the same place?

      Thanks for your help in advance,
      Matt

      posted in V-Ray render plugins extensions
      W
      wawmsey7
    • Load a vismat / vray material into sketchup??

      Is it possible to load a vismat material into sketchup via the ruby script. So in this case i have written a script to draw some stuff and I now want to apply a saved vray material (.vismat) to it's faces as a part of the script so that it is all ready for rendering.
      Is this possible?
      Thanks for your help,

      Matt

      posted in Developers' Forum
      W
      wawmsey7
    • RE: Textures in model slow down ruby?

      No, I'm adding materials the normal way. Adding the materials isn't the problem. I was having a problem whereby adding component definitions is slower if I simply have materials with textures in the model, and the the more there are the slower it goes... but i've managed to nullify this problem by writing my code better so that I only define each component that I need to load for my scripts once.

      posted in Developers' Forum
      W
      wawmsey7
    • RE: Textures in model slow down ruby?

      I do use vray, but it was disabled throughout all of this... just to be on the safe side!

      posted in Developers' Forum
      W
      wawmsey7
    • RE: Textures in model slow down ruby?

      I've worked out that textures in the model only make the script run slowly when it is pulling/importing the component definitions into the model like so...

      shelfpin = Sketchup.active_model.definitions.load ("filename")

      and in one of my scripts I had this as part of a defined function which I was looping 50+ times to cut shelf holes and add a shelf pin for various positions on a panel - so was in affect importing the shelf pin component 50+ times completely unnecessarily.

      So as soon as I took out this out of the code completely (given that the component is already loaded in the model) and ran the same code again, it ran at the same fast speed as it does when there isn't any textures in the model!

      So my solution is to run the code to load the components needed for all my scripts once and then it's all done only once and I'm free to run any of my scripts after it.

      However it would be easier if I could have code before the code for loading the component to check if it's already loaded or not into the model and then load it if it's not already there? Is that do-able?

      **the following code just tagged on the end seemed to work fine

         magd = Sketchup.active_model.definitions.load (file) if magd.class != Sketchup;;ComponentDefinition
      

      theres probably a tonne of ways to do this but that seemed to do the job

      Thanks

      posted in Developers' Forum
      W
      wawmsey7