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

    Posts

    Recent Best Controversial
    • RE: [Plugin] Dxf_In v2.2 20110517 Dxf2Skp

      This may be too late for you but I had used earlier versions of this on an iMac and found that there were sometimes problems which seem to relate to how the file is saved, some operating systems use carriage return -linefeed to denote the end of a line others just used one. I made a mod which allowed it to work on the iMac (see my post of Thu Feb 17, 2011 12:29 am), it may be worth trying it on the new version
      I edited the files using Textedit on the mac, just be careful that it doesn't add a .txt extension

      To help I have listed the suggested change below

      Find the following bit of code in the.rb file

      #get all block names, save them along with their location
      begin
      	aFile=File.open(chosen_file, "r")
      rescue
      	result=UI.messagebox "<Error> The DriveName\\Path\\FileName.dxf may not\nbe standard ASCII characters. If so, place the Dxf file\nin a ASCII named folder before accessing that file.", MB_OK
      end
      aFile.each_line do |line|						
      	count=count +1
      	if count==odd_number					#strip dxf tags thanks to TIG
      		odd_number=odd_number + 2
      		line=line.strip
      	end
      
      	last_line=this_line							#save last line data
      	this_line=line
      

      and insert the line
      line=line.chomp+"\n"
      after
      aFile.each_line do |line|
      it should ensure that all the data read in is terminated in a way that ruby scripts accept, and it shouldn't affect the way they run under windows either.

      posted in Plugins
      C
      Chrisn2011
    • RE: [Plugin] Dxf_In v2.2 20110517 Dxf2Skp

      Hi, I have been doing some tests and have discovered that the Mac appears to be bringing the data from the file with a Carriage Return Line Feed termination, and as such was not being recognised. I found the following modification made a huge difference

      #get all block names, save them along with their location
      aFile = File.open(chosen_file, "r")
      aFile.each_line do |line|						
      

      line=line.chomp+"\n" #strip CRLF and replace with LF
      count = count +1
      if count == odd_number #strip dxf tags thanks to TIG
      odd_number = odd_number + 2
      line = line.strip
      end

      I will try this on the current version. As far as I can see from my studying of Ruby that alteration should not affect running under Windows as it will strip any terminations from the line and then replace it with the LineFeed value used everywhere else in the code.

      The fix allowed me to load the "AmericanFlag1.dxf", I got some bad polyline error, but it did complete the loading and could be seen in Sketchup.
      It is here and I will test the new version against it and try and capture the message from the Ruby console.

      Chris


      Jim's file

      posted in Plugins
      C
      Chrisn2011
    • RE: [Plugin] Dxf_In v2.2 20110517 Dxf2Skp

      Hi,
      I'm a bit new to Sketchup, but have used other CAD packages in the past. I was wanting to load a DXF file into Sketchup, but as 8.0 doen't have a DXF importer I looked at other options, this seemed the best.

      I have just downloaded dxf_in_v1.18c, copied it and pasted it with other plugins
      It seems to start ok asks for the settings
      Help options:
      Import unit:
      Select Origin:
      Polylines:
      Materials:
      which I set to None, Millimetres, Model's, to Faces; by Number, and after it failed tried the AmericanFlag1.dxf from Jim's lots of DXF files (earlier in this topic) and still get the same problem, even changing some of the settings I still get the same problem, a Sketchup dialog stating <Error> or empty file

      The import runs through stages1 and 2 with an indicator running across the bottom of the screen, so I assume it is reading the .dxf file OK. Have I set something up wrong?
      I couldn't find an older version of dxf_in to see if there was any difference.

      Any advice or comments greatly appreciated.

      Chris

      posted in Plugins
      C
      Chrisn2011
    • 1 / 1