[Plugin] Dxf_In v2.2 20110517 Dxf2Skp

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 
 

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

Postby honoluludesktop » Thu Mar 24, 2011 10:26 pm

alexdobras wrote: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.

SketchUp layers are unlike those in other Cad applications. I think that the view layer is correct. If you elect to group the import at the end of running the application, the group will be placed on "layer0", and hiding/unhiding layers behaves as you see it. If you do not group the import, it should work in a more conventional manner. I will look at the problem with placing the entities on the wrong layer.
0
User avatar
honoluludesktop 
In Remembrance
 

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

Postby honoluludesktop » Thu Mar 24, 2011 11:59 pm

Alex, good news is "layer0" is "RED_RECTANGLE" so the problem is fixable. Bad news, the missing entities may be "unsupported" by Dxf_In. Sorry, but the math for those entities may be (or not) beyond me. I will take a look.

Is the attached image the one that you are looking for?
Temp00.png
If not tell me what is wrong? The line that intersects the circle is on "layer0". I suspect that is wrong. Can you tell me what layer it's on? Perhaps layer "0".
0
User avatar
honoluludesktop 
In Remembrance
 

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

Postby alexdobras » Fri Mar 25, 2011 12:59 am

honoluludesktop wrote:Alex, good news is "layer0" is "RED_RECTANGLE" so the problem is fixable. Bad news, the missing entities may be "unsupported" by Dxf_In. Sorry, but the math for those entities may be (or not) beyond me. I will take a look.

Is the attached image the one that you are looking for?
Temp00.png
If not tell me what is wrong? The line that intersects the circle is on "layer0". I suspect that is wrong. Can you tell me what layer it's on? Perhaps layer "0".


it is almost good
the line that intersects the circle is on layer named "0" on CAD, but i see that is on "Layer0" of Sketchup. that is bad, because SU should create the later named "0", so the dxf imported should pe placed on totally different layers than that existing ones.

also: how could you import the dxf and get the entire rectangle, and almost the Block completely imported??
0

alexdobras 
 

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

Postby alexdobras » Fri Mar 25, 2011 1:08 am

there should be 5 layers:

layer0
0
red rectangle
yellow Block
Blue circle
0

alexdobras 
 

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

Postby TIG » Fri Mar 25, 2011 1:17 am

In a DWG/DXF import the CAD layer '0' should becomes= SKP layer 'Layer0' [nil]
Other layers should be named to suit... :roll:
0
TIG
User avatar
TIG 
Global Moderator
 

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

Postby honoluludesktop » Fri Mar 25, 2011 1:25 am

Tig, Do you think it will be a problem if I add layer "0" to the set along with layer0"? If a problem, why? Don't know if I can do it, but was about to try having both.
0
Last edited by honoluludesktop on Fri Mar 25, 2011 2:31 am, edited 2 times in total.
User avatar
honoluludesktop 
In Remembrance
 

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

Postby alexdobras » Fri Mar 25, 2011 1:32 am

here are the layers in SU:
please notice that there is Layer0 and 0
Capture.PNG
0

alexdobras 
 

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

Postby alexdobras » Fri Mar 25, 2011 1:41 am

here is the layout in DraftSight :
draftsight.PNG


notice that the name "red rectangle" disappears from the layer tab in SU.

i don't know what you did Honoluludesktop, that you got the picture earlier showed.
and by the way, how did you get all the lines importing accurately ?
0

alexdobras 
 

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

Postby honoluludesktop » Fri Mar 25, 2011 1:54 am

Yes, in my case, "Red_Rectangle" is missing. While I am moving ahead on this, I would like to get the opinion of those that are more experienced then myself. Bottom line is that the app. should conform to Acad, GCD/4D (the reason I wrote this plugin), and SU specifications.

Btw, Dxf_In currently doesn't do splines, ellipses, or polyface entities. Ellipsis can be added in the future, but polyface entities, and splines are outside of my comprehension of their computer math algorithms.
0
Last edited by honoluludesktop on Fri Mar 25, 2011 2:07 am, edited 1 time in total.
User avatar
honoluludesktop 
In Remembrance
 

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

Postby honoluludesktop » Fri Mar 25, 2011 1:57 am

Looks like you got another post in while I was writing the other.>_< The accurate image is based another application that I use to check my work. I placed the SU layer window over it in order that you can ID the layers.
0
User avatar
honoluludesktop 
In Remembrance
 

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

Postby alexdobras » Fri Mar 25, 2011 2:10 am

honoluludesktop wrote:Looks like you got another post in while I was writing the other.>_< The accurate image is based another application that I use to check my work. I placed the SU layer window over it in order that you can ID the layers.


but how did you get that accurate importing? i see all the lines in your SU
0

alexdobras 
 

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

Postby honoluludesktop » Fri Mar 25, 2011 11:37 am

Alex, getting there. The yellow block is erroneously being replicated. Maybe tomorrow.
0
User avatar
honoluludesktop 
In Remembrance
 

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

Postby alexdobras » Fri Mar 25, 2011 2:59 pm

i see in the picture, that the yellow Block is placed 2-times, for some reason :shock:
pray it will work tomorrow :mrgreen:
0

alexdobras 
 

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

Postby alexdobras » Fri Mar 25, 2011 3:38 pm

also, it is an advance already, because i see the rectangle fully imported into SU.
0

alexdobras 
 

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

Postby honoluludesktop » Sat Mar 26, 2011 3:34 pm

Alex, This should do for now.
Temp00.png
The plugin needs to be tested for lines, circles, arcs, faces, 3dfaces, and polylines.
dxf_In_v1.28.rb
I will have to work on the problem group or component transformations before I add ellipses to the supported entities.
0
User avatar
honoluludesktop 
In Remembrance
 

SketchUcation One-Liner Adverts

by Ad Machine » 5 minutes ago



Ad Machine 
Robot
 

PreviousNext


 

Return to Plugins

Who is online

Users browsing this forum: katmur, Openspaces, planet1111, richdps123 and 8 guests

Visit our sponsors: