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

    Posts

    Recent Best Controversial
    • RE: Georeferencing

      Thanks, Jim.
      Working off your observation, I opened a new drawing, and as you said, the attribute dictionary "Georeference" is empty. All the default geodata is in the shadow_info object (or hash, I'm not sure of the proper term). I listed it like this:

          
      am = Sketchup.active_model
      #<Sketchup;;Model;0x63be010>
      am.shadow_info.each{|k,v| puts "#{k} #{v}"}
      City Boulder (CO)
      Country USA
      Dark 45
      DayOfYear 312
      DaylightSavings false
      DisplayNorth false
      DisplayOnAllFaces true
      DisplayOnGroundPlane true
      DisplayShadows false
      EdgesCastShadows false
      Latitude 40.017
      Light 80
      Longitude -105.283
      NorthAngle 0.0
      ShadowTime Fri Nov 08 07;30;00 Central Standard Time 2002
      ShadowTime_time_t 1036762200
      SunDirection (-0.423824071310226, -0.772439983723215, 0.472979521886207)
      SunRise Fri Nov 08 00;43;14 Central Standard Time 2002
      SunRise_time_t 1036737794
      SunSet Fri Nov 08 10;46;34 Central Standard Time 2002
      SunSet_time_t 1036773994
      TZOffset -7.0
      UseSunForAllShading false
      nil
      

      Checking the "Use Georeference" box creates the attribute dictionary and probably uses the shadow_info coordinates to set the lat and long.

      I want to programatically check the "Use Georeference" box on a batch of files. I can't assume it exists so I'll need to create the attribute dictionary "Georeference" exactly. I suppose I should make the shadow lat/long and the georeference lat/long match to avoid future confusion.
      I this the way to go?

      posted in Developers' Forum
      J
      jwelin
    • Georeferencing

      Has anyone found a Ruby method to enable the "Use georeferencing" checkbox in Model info:location?
      I've scanned the API but no luck.

      posted in Developers' Forum
      J
      jwelin
    • RE: [Plugin] Import STL files

      Thanks for the work on this plugin. I have a three questions:

      Is there a limit to the level of nested groups/components it exports?

      The exported STL seems to be incompatible with some applications. Rhino sees the geometry, for instance, while Magics does not. Also an SU2stl generated stl, opened in Rhino and resaved as an STL is much smaller in file size. Would you like to see examples?

      Is there a way to call this plugin from another? I have a need to batch export.

      posted in Plugins
      J
      jwelin
    • RE: Model.import fails to import dwg's

      Alright, the error popped up because of an error in the file path (fileone or filetwo in the code).
      Silly mistake made frustrating by a misleading error message.

      However, I have these observations:
      model.import and model.export have a second parameter which suppresses the summary window.
      This works exporting, and importing skp files, but does not suppress the summary for dwg files. So the user must click on the OK button for every file which is imported.

      model.save does not function as the application's file:saveas command, in that the open skp file does not assume the name of the saved file. model.save functions more like file:save a copy as.

      These two points, along with the lack of a method to close a file (have I missed it?) makes automating any sort of batch processing difficult. Perhaps its intentional, but it limiting for a scripting language.

      posted in Developers' Forum
      J
      jwelin
    • Model.import fails to import dwg's

      I am using the model.import method on a batch of DWG files without success. Every import attempt yields this error as a window in the SU application (not the console):

      Error opening AutoCAD import file: Invalid group code
      This does not appear to be a valid AutoCAD DWG or DXF file or the file is write protected.

      These are good 2004 dwg files which open in ACAD and audit without errors.
      Oddly, these dwg's import fine with the file:import in SketchUp
      This error occurs in Su6 and Su7 identically.
      I have saved down to 2000 dwg with the same error.
      I am using the free version of SU, both on Mac and PC.

      This is the Ruby code:

      model = Sketchup.active_model
      status = Sketchup.open_file templatename
      status = model.import(fileone)
      status = model.import(filetwo) if filetwo != "no match"
      status = model.save(destinpath + filename)

      I am creating simple test dwg's to see if I can get the model.import to work at all. I will also try dxf format.

      Any insight?

      John Welin, architectural modelmaker in Chicago

      posted in Developers' Forum
      J
      jwelin
    • 1 / 1