sketchucation logo sketchucation
    • Login
    1. Home
    2. cjthompson
    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!
    πŸ”Œ Easy Offset | Offset selected faces in SketchUp in positive and negative offsets. Download
    C
    Offline
    • Profile
    • Following 0
    • Followers 0
    • Topics 19
    • Posts 151
    • Groups 1

    Posts

    Recent Best Controversial
    • Core ruby policies

      This is probably a pretty stupid question, but do you know if there are any policies in sketchup against using core ruby code?
      The reason I'm asking is because of .methods. This allows you to see all the public methods of an object.

      I noticed some undocumented methods, and was wondering if they were purposefully left undocumented, or just overlooked.

      posted in Developers' Forum
      C
      cjthompson
    • RE: How to add components to another component? [ruby]

      Can you explain how you select the components?

      The easiest way would to be what chrisglasier suggested. However, if you want to do it in a ruby script, one way would be:

      add a group, add the instances inside the group (group.entities.add_instance(instance.definition,instance.transformation)), delete the previous instances, and use group.to_component

      if you add a group, you don't have to worry about transformations.

      posted in Developers' Forum
      C
      cjthompson
    • Invalid Web Dialog

      I have been using a web dialog as an interface and lately I've been getting the error "#<Exception: Invalid Dialog>" if I submit more than once. Does anyone know why this is?

      I am using mostly get_element_value instead of parameters.

      posted in Developers' Forum
      C
      cjthompson
    • RE: Iron Ruby?

      Ruby in Steel just allows you to type .rb files in VS, although I think I misunderstood you. Are you trying to find an IDE to write scripts or are you trying to find a way to connect .NET Applications with Sketchup?

      posted in Developers' Forum
      C
      cjthompson
    • RE: Iron Ruby?

      I don't know if this is what you are looking for, but have you looked into Ruby in Steel? it's a VS extension for Ruby. I found the free version works well for me. I'm not sure what you mean by using the Windows forms tools, though.

      As for the SketchupLib, that's a bit over my head. I'm still a .NET noob.

      posted in Developers' Forum
      C
      cjthompson
    • RE: Iron Ruby?

      I've looked into it a little bit, but the problem is that iron ruby is meant to run ruby code in .NET, not the other way around.
      Not to mention that sketchup uses it's own class library.
      What are you looking for, exactly?

      EDIT: After looking some more into it, Iron Ruby can run .NET code. But because Sketchup uses it's own API you can't attach iron ruby, as far as I know.

      posted in Developers' Forum
      C
      cjthompson
    • RE: Synchronizing Multiple WebDialogs

      not really. I pretty much just stumbled across it, and saw that it worked.

      I don't really know much about DOM events or even html in general. Maybe you know how to execute a script that will show what state the browser is in, and execute that on show?

      posted in Developers' Forum
      C
      cjthompson
    • RE: Synchronizing Multiple WebDialogs

      This gets an alert from a file, at least for me:

      wd = UI;;WebDialog.new "foo", true, "", 100, 100, 100, 100, true
      wd.set_html "<html><body>Hello World</body></html>"
      wd.show{
      wd.execute_script( 'alert( "hello from foo" );' )
      }
      

      What problem are you having, exactly?

      posted in Developers' Forum
      C
      cjthompson
    • RE: .skp -&gt; JSON -&gt; .skp

      you should definitely add the faces by points instead of by edges, because edges are entities, so if you export to a model that doesn't already have those entities, you will get an error.

      I haven't worked with JSON at all, so I don't know how much help I can be.

      posted in Developers' Forum
      C
      cjthompson
    • RE: Dont understand rotation

      I tried some tests with your script, and I found that .transform! applies a transformation to an instance, and .move! applies a transformation to the definition.

      So, if you have multiple copies, when you use move!, it will move them all to one place.

      posted in Developers' Forum
      C
      cjthompson
    • RE: Report just one attribute

      @artofseeing said:

      i want a messagebox to show me the following:

      the single weight of each selected component
      the sum of weights of all selected.

      that's practically it.

      do you want one messagebox with each weight and one with the sum, or do you want one with both the sum of the weights and each weight?

      posted in Developers' Forum
      C
      cjthompson
    • RE: Report just one attribute

      I haven't actually tested this, but I'm guessing this should work

      @tig said:

      
      >     gewicht=gewicht + e.definition.get_attribute("dynamic_attributes","gewicht",0)
      > 
      

      to:
      gewicht=gewicht + e.definition.get_attribute("dynamic_attributes","gewicht",0).to_f

      posted in Developers' Forum
      C
      cjthompson
    • RE: Parametric entities

      @thomthom said:

      Not sure what you mean by using classes to group attributes though...

      Basically, what I am trying to accomplish is to reference a group of entities in the code by what it actually is, for example, car, boat, etc. By doing this, I should be able to greatly simplify the code by saying boat.height or car.door.length. Like TIG said, It would also allow users to change those attributes through a dialog.

      posted in Developers' Forum
      C
      cjthompson
    • RE: Parametric entities

      @tig said:

      You CAN make 'parametric entities' with a script - there is a sample script that makes parametric shapes like cones and boxes etc that's downloadable from the Sketchup Script page... There's a special 'parametric.rb' that helps.

      That was what I was referring to. perhaps I wasn't using the right terminology.
      Have you used the parametric.rb script before? What I am really interested in is the pros and cons of using it, and whether anyone has tips regarding it.

      posted in Developers' Forum
      C
      cjthompson
    • RE: Parametric entities

      Possibly. From what I can see, parametric entities can be created with either version, but I don't know much about them.

      posted in Developers' Forum
      C
      cjthompson
    • Parametric entities

      I am thinking of learning how to use parametric entities, but I would like to see if anyone else has used them, and if they like or dislike using them. Right now, I am using classes to group attributes, so it hopefully won't be that big of a leap.

      posted in Developers' Forum
      C
      cjthompson
    • RE: ASP web interface

      Well, I haven't had many replies, although I do have another question.

      When you use ASP in the web dialog, as far as I can tell, the ASP post-back doesn't work. I've gotten it to work in the development server. Do I need to use javascript post-back, or am I just missing something?

      posted in Developers' Forum
      C
      cjthompson
    • RE: Moving component axes

      Thanks for the suggestion. I was able to do almost the opposite of your suggestion, and put the components entities inside of a group, create a vector between the groups origin and the components, and transform the two so they match. Does anyone know of a simpler way to do this?

      posted in Developers' Forum
      C
      cjthompson
    • Moving component axes

      I'm sure this is a pretty common topic, but do you know if there is an easy way to set the component axes to the corner of a component if you push/pull one of the sides. I've tried using the bounding box, but that doesn't work if you have the component at an angle.

      thanks,
      Chris

      posted in Developers' Forum
      C
      cjthompson
    • RE: New API doc - typos and questions

      I'm not sure if you've caught this yet, but transformation.xaxis, yaxis, and zaxis return vectors, not points.

      posted in Developers' Forum
      C
      cjthompson
    • 1 / 1