[Plugin] Dxf_In v2.2 20110517 Dxf2Skp

Re: [Plugin] Dxf_In v1.18 092410 v1.15 French version

Postby honoluludesktop » Tue Jan 11, 2011 7:06 am

dsct, I have looked hard at TestFile.dxf, and can not find a z coordinate value following its entity code (30, 31, 32, 33) that is "0.0", which would be the case as the image of the SUv7/ODA import suggest.
Temp02.png
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.18 092410 v1.15 French version

Postby dsct » Wed Jan 12, 2011 4:00 pm

honoluludesktop,

Thanks for looking at my application and for the update. I really appreciate your interest and help. I tried the updated plugin on a larger file. It read in a lot of the 3dfaces but gave me a "<Error> Bad 3dface" message for the rest. I've attached a somewhat bigger sample that shows that issue. Any thoughts? It's my understanding that the sample file that I sent, TestFile.dxf, has x,y,z coordinates for all points. Some values are zero. I'm not sure that I understand your comment about the missing z's.

My use has been that of a hobbyist and found that dxf was a man readable format that I could understand and generate myself. I downloaded a guide for dxf and used it to write the files. These files read into SU and I was content with the results. It seems that you have a more definitive (and possibly different) format for dxf. Can you point me to the source for that format. Since I'm generating the file, I can conform and hopefully get the rest of the way there.

Thanks again for your help,
dsct
0

dsct 
 

Re: [Plugin] Dxf_In v1.18 092410 v1.15 French version

Postby honoluludesktop » Wed Jan 12, 2011 8:31 pm

dsct, I looked at the faces that Dxf_In is rejecting and discovered that these faces are not coplaner. The attached image contains the model generated by Dxf_In in black, white, and gray. The blue line is an attempt to create a face from the existing vertices's. If the vertices's of the blue lines are coplanar, a face would be created. Because Dxf_In is a SU Ruby plugin, it seems to tolerates less variation in the vertices's values, then does the ODA translator.

In this case there are two options. One is to improve the accuracy of "Dxf Out"(s) vertex values. The other is to rewrite Dxf_In to create a triangular face from 3 vertex (as ODA does), in place of the 4 vertex 3DFACE that Acad requires. This may take time to do and you may have to wait for a Dxf_In solution. Is it difficult to improve the accuracy of "Dxf Out"? Without doing so, Autocad will not be able to read your Dxf. What may simply be required, is to increase the decimal rounding place. Say, for example, from 7 places (.00000001) to twelve (.000000000001).

The link to the Acad specifications is here. You also need a copy of a AutoCad generated Dxf in order to see some of the formatting that AutoCad requires.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.18 092410 v1.15 French version

Postby honoluludesktop » Wed Jan 12, 2011 9:11 pm

Hmmm........Turned out to be easier to rewrite then to explain (as above).>_< Attached is Dxf_In that triangulates non coplaner 3DFACE(s). It is still to your advantage to fix "Dxf Out" in order to maintain compatibility with AutoCad. In addition, ODA/SU7 locates the translated model on SU(s) ground plane, where Dxf_In elevates it as specified. Where is the original model located in reference to the world origin? Btw: please check your pm (private mail).
Temp00.png
Can you pm me an image of your model as it is created by your original application?
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby honoluludesktop » Fri Jan 28, 2011 9:36 pm

This version allows the following non Acad compliant Dxf information to be processed:
01/10/2011 - v 1.20 Convert lower case Dxf entity names to upper case.
01/12/2011 - v 1.22 Triangulate Dxf 3DFACE when not coplaner.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby nwlarch » Sun Jan 30, 2011 11:06 pm

Perfect plugin to go from GIS to SketchUp when the ArcGIS->Skp6 plugin doesn't work. You've done fantastic work and you should get more recognition for it!
0

nwlarch 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby gwied » Tue Feb 01, 2011 5:53 pm

I am trying to get topographic contour lines into SU8 as vectors. Illustrator (AI) can "trace" raster images from topo maps very nicely, but then I cannot get the results into SU8.
--I created a simple filled 2-d square in AI,
--exported that as a dxf with the "AutoCAD version 2004/2005/2006" option in the AI export dialog.
--I used your plug-in (my_dxf_In_v1.22.rb) to import this file into SU8,
--and get the SU error "<Error> or Empty File".
--I tried the other export->CAD options from AI to no avail.
--Also, "polylines to faces" or "polylines to edges" made no difference.

Any suggestions? Do you think AI is exporting "non-Acad-compliant" dxf?
0

gwied 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby honoluludesktop » Tue Feb 01, 2011 10:58 pm

It is possible that AI exports drawing entities that Dxf_In doesn't currently support. Upload the dxf file that fails to import (smaller the better), and I will look at it. Also, describe, or upload a image of the original illustration.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby gwied » Wed Feb 02, 2011 7:08 pm

Here are 4 files for your experimentation/troubleshooting :
1.the DXF export from (1)
3watersheds-topo-SIMPLE.dxf

2.png of (1) so you can see what the DXF is supposed to show
3watersheds-topo-SIMPLE.png

3.DXF export from AI of a simple, 2D square - black stroke, white fill.
square.dxf

4.screenshot of AI-DXF export settings
AI export DXF options.png


The AI file of topo contours file would not upload; but if you can use it, I could email it to you.
Thanks for the help!
0

gwied 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby honoluludesktop » Thu Feb 03, 2011 10:56 am

gwied, I have looked at 3watersheds-topo-SIMPLE.dxf, and found that it consist of splines.
Temp00.png
Dxf_In doesn't support splines at this time, and unfortunately, I will not be able to add it to the translator any time in the near future.

I understand that Dxf v12 writes splines as ploylines. ODA provides a Dxf/Dwg translator here that will convert your Dxf v2000+ into Dxf v12. Dxf_In can then be used to import Dxf v12 into SketchUp. Select Dxf_In option: polylines to edges.

Dxf_In will however, translate the entities in square.dxf.
Temp01.png
See the help option for a list of entities that Dxf_In supports.
0
Last edited by honoluludesktop on Fri Feb 04, 2011 4:50 am, edited 1 time in total.
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.22

Postby gwied » Thu Feb 03, 2011 5:49 pm

Sorry for my lack of vocabulary here-- If the splines (curved lines) in AI were converted to a series of small straight line segments, then perhaps they would be Polylines in the dxf?
I was not able to import square.dxf, the same file you imported successfully! Any ideas? Thank you!
0

gwied 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby honoluludesktop » Fri Feb 04, 2011 4:49 am

As you probably know, SketchUp can not model curves, and approximates them as a sequence of short connected lines. A spline is a complicated curve, and a polyline is a sequence of connected lines. Btw, Sketchup's basic entities only include faces (planer surfaces) and edges (lines). I am not mathematically fluent, and probably butchered the explanation.

AI exported the topo as Dxf v2004-6 splines. If you use the ODA translator and convert AI's Dxf v2004-6 to Dxf v12, the Dxf splines will convert to a Dxf polyline.

3watersheds-topo-SIMPLE-v12.dxf

The image I posted above is an example of that. Because AI incorrectly tags the splines as closed, the exported topo line are closed. That however, can be easily corrected in SketchUp as below.
Temp00.png

If you can get AI to export the topo as Dxf v12, the topo will export as polylines. I did not see this option on your image of the AI menu. In addition, if AI can export the topo as either Dxf lines, polylines, arcs, or lwpolylines, Dxf_In will be able to import them into SketchUp. However, I did not see these options in the AI menu either.

I don't know why you are unable to import square.dxf, did you get any error messages? If so, screen capture the messages and post them here. If you did not get any error messages, open Sketchup, from the SketchUp menu select Window > Ruby Console. Then attempt to import square.dxf. If you get an error message in the Ruby Console, screen capture that message and upload it here.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby honoluludesktop » Sat Feb 05, 2011 4:05 am

Hmmmm..........In regards to square.dxf, I just noticed that your OS, and hardware are Mac. I don't believe that I have ever had a request for support from a Mac user before. Perhaps that is the problem. Plugins that run on a PC do not always run in a Mac (as well as the other way around). For me to attempt to solve this kind of problem, it would help to have the error message that is reported in the Ruby Console. Perhaps fortunately, the ODA translator support specific Mac OS's. You need to verify it with your OS.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In (alpha release)

Postby wthierry » Sat Feb 12, 2011 5:32 pm

Coen Naninck wrote:I always wonder when there are no replies yet a bunch of downloads, why those who downloaded don't take (or have?) the time to send some love to the author. I have no use for this plugin, but here's some love. :thumb:

awesome work on that plugin! :bounce:
0

wthierry 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby Chrisn2011 » Wed Feb 16, 2011 1:32 am

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
0

Chrisn2011 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby honoluludesktop » Wed Feb 16, 2011 9:32 pm

Chris, There are 3 things you can do. First download (from the first post in this topic), and use the current version Dxf_In v1.22. If that fails, post the problem "AmericanFlag1.dxf" here so that I can examine the file (In the post a reply window, "upload attachment" tab is located on the left side, below the reply box). I see that you use a Mac. I have never tested the plugin on a Mac. Plugins that run on PC may not run on Macs, or the other way around. For me to fix a Mac related problem, I need your help. Open sketchup, turn on the "Ruby Console", run Dxf_In, then copy the error message from the Ruby Console, and upload it here.

In any case, upload "AmericanFlag1.dxf" for me to look at, I was unable to find it in Jim's earlier link.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby Chrisn2011 » Thu Feb 17, 2011 1:29 am

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
0

Chrisn2011 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby honoluludesktop » Thu Feb 17, 2011 1:26 pm

Chris, Thanks for the dxf, it failed to translate on my pc system. I currently have some work that pays the rent, and may not get back to you for a couple of days, but, I will ASAP. The problem may not be a PC vs. Mac situation. A quick look at the the dxf indicates that the problem may be easily fixed. I will post a solution, or an explanation as soon as I pay the rent:-)

The image appears not very sharp.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby honoluludesktop » Fri Feb 18, 2011 1:46 am

Chris, The problem is simple. Your file $ACADVER version number is AC1003. The Acad Dxf documentation doesn't identify this version. I suspect that it is prior to Acad v10, and may even have been made with a non-Acad program. It contains the drawing entity "polyline" in a 2d format. Dxf_In only reads 3d entities. It will be a while before I can revise Dxf_In to accommodate 2d entities. I suggest that you convert AmericanFlag1.Dxf v?? to AmericanFlag1.Dxf v2000 with Teigha™ File Converter linked here. The converter will change the 2d polylines to 3d so that Dxf_In can read them. The free converter is by ODA, and I believe it is the same engine that SketchUp uses in its Pro Dxf importer. For output, select "2000 ASCII DXF". The converter is designed to batch convert all the DXF and/or Dwg files in one folder into another folder.

I have attached the v2000 Dxf file below, give it a try on your Mac and let me know if it works. If not, open the SketchUp "Ruby Console". run Dxf_In again, and if you get a error message in the "Ruby Console", upload a copy of it to me.

Temp01.png
AmericanFlag1.dxf
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby honoluludesktop » Tue Feb 22, 2011 3:54 am

Many AutoCad entities like line, arc, and circle have properties unlike those in SketchUp. For example a Acad line can have thickness, and a extrusion direction. A basic Acad line is like a SketchUp line or edge, but when it has thickness, it has 4 sides, like that of a SketchUp face. When a thick line has a Acad extrusion direction, in Sketchup that line resembles a parallelogram. In addition, a Acad polyline has thickness, and will resemble an rectangular volume in SketchUp.

Dxf_In currently supports thickness, and width when required by users in some entities.

The following image is a Dxf_In import of a file that translates lines, arcs, and polylines (stright lines only) with thickness.
Temp12.png


The next image is a SketchUp import of the same file translating lines, arcs, and (below) a polyline with thickness and other properties.

Temp11.png

The last image is the same files opened in a Acad viewer. It adds width, and other properties to the model.

Temp14.png
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby alexdobras » Thu Mar 24, 2011 1:22 am

Honoluludesktop: thank you very much for this plugin
one thing though, i tested on a file and i saw that the it doesn't import the text intro SU.
could you adjust that please, also if it is possible to add the possibility to maintain the Cad Layers on SU, after the import.
thanks a tonne!
0

alexdobras 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby honoluludesktop » Thu Mar 24, 2011 12:23 pm

Hi Alex, Go here for a plugin to import text separately into your SketchUp model. Can you post the dxf file so that I can work on layers?
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby alexdobras » Thu Mar 24, 2011 12:33 pm

i give you the files that i have to work with.
the big one is the one i need, but since is so big, and take a lot of time to import, i made another(smaller) with only a section of the model, so can take a look rapidly

here is the link from where you can access them: http://dl.transfer.ro/transfer_ro-24mar ... 2f1f55.zip
small part-VICTORIA_CUERPO_BELLO.dxf

VICTORIA_CUERPO_BELLO.dxf


notice! i didn't explode the model, so they can import badly with lacking of details. I don't find where i put the exploded ones. If you need them too, tell me, and i will upload them also.

and by the way the import_text makes SU crashing when i want to import the file :( that's why i'm asking
0
Last edited by alexdobras on Thu Mar 24, 2011 1:10 pm, edited 1 time in total.

alexdobras 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby alexdobras » Thu Mar 24, 2011 1:09 pm

here is the pdf of what should appear in SU , but only in CAD, as DraftSight, which is new and free sees :
small-victoria_cuerpo_bello.pdf

victoria_cuerpo_bello.pdf
0

alexdobras 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby honoluludesktop » Thu Mar 24, 2011 1:19 pm

Got it, will get back to you after I have a chance to look at it. Good job, cutting the size down.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby honoluludesktop » Thu Mar 24, 2011 4:40 pm

Alex, Test this version in regards to layers. I see that there are transformation problems with blocks that I will also have to fix.
Temp00.png
In addition, Dxf_In currently doesn't support nested blocks. Read the help files; also set the defaults dimensions to your preference.
my_dxf_In_v1.25.rb
Let me know if the layers are OK so that I can post the plugin for others.
0
User avatar
honoluludesktop 
In Remembrance
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby alexdobras » Thu Mar 24, 2011 5:49 pm

i have made another file, much simple one.

0 (contains a polyline)
blue circle
red rectangle
yellow Block

Though layer system now works with your new plugin, but is not accurate: i ,mean the red rectangle is placed on Layer0(of SU default), but it should appear on a different one: that is Red Rectangle not to be placed on Layer0(defaultSUlayer).
(bytheway: if i hide Layer0-everything dissapears- this is strange because on layer Red Rectangle should be only a rectangle, and SU for some reason puts the rectangle on Layer0 with also everything!! strange, you can see that is no Red Rectangle layer in SU, after importing the file)

here's the file, please check it out.
testlayers.dxf
0

alexdobras 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby alexdobras » Thu Mar 24, 2011 5:57 pm

it would be best to make possible to add the layers imported into Su, on different layers than SU's layers, cause currently it puts some geometry on Layer0 of SU, which is not good at all.
0

alexdobras 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby alexdobras » Thu Mar 24, 2011 6:09 pm

the rectangle lacks an edge for some reason by the way, as seen here:
see.PNG
0

alexdobras 
 

Re: [Plugin] Dxf_In v1.22 20110228 v1.15 French version

Postby alexdobras » Thu Mar 24, 2011 6:31 pm

Also: Blender 2.49 has a very powerful DXF importer. I have tested it and installed everything includin text blocks all correct , without an error. Single thing that is not working are the layers. Unfortunately blender in not as quick and simple as SU :|

I wonder if you could take a look into how that Importer in made, so you could adapt it to SU.
0

alexdobras 
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

PreviousNext


 

Return to Plugins

Who is online

Users browsing this forum: becsramos, Elibjr, vidale_pierre and 175 guests

Visit our sponsors: