25 Replies Latest reply on Jul 28, 2013 9:02 PM by Chris Dordoni

    Exporting dxf with 3D faces

    Jason Matusiak

      I am using a tool for ray modeling (RF) of environments and need to plop down some buildings in it.  We have a SolidWorks license, but I am not all that proficient, so I apologize in advance if I word something incorrectly.

       

      The software I am working with can input a dxf or a shapefile for buildings, and the stipulations on the dxf are that it "can only convert DXF objects containing polylines, polyface meshes, or 3D faces using AutoCAD grip points so that the DXF converter can identify faces that are touching."  I know that other people have created buildings in autocad, and then all the building surfaces were changed into 3D faces, each of which were then associated with AutoCAD layers according to their material type. Converting all building surfaces into 3D faces instead of polylines and polyface meshes seemed to be the most compatible with this other tool.

       

      Since I have SW, I am trying to figure out how to do something similar (and have failed for 2 days).  It appears that 3D dxf files cannot be exported, so I tried to export .stl and .sat files and convert them to .dxf with MeshLab and DraftSight, but haven't had much luck (I get a blob when I import to my other program without windows or doors).

       

      What I am not sure is if I am attempting something that just can't be done with the tools at my disposal, or is this totally doable, and I am just doing something wrong.

       

      Any thoughts?

        • Re: Exporting dxf with 3D faces
          Chris Dordoni

          Hi Jason,

           

          Its true you cannot export 3d DXF from SolidWorks; however, you can export a facetted (polygonal) file such as VRML or STL and convert it to 3d DXF with another application.

           

          I have found AccuTrans3D http://www.micromouse.ca/ incredibly useful in converting polygonal files and it allows reading/writing 3D DXFs with 3D faces or poly faces. Its only $20, and they do allow a free trial, but just buy it. It's the best $20 you'll ever spend on an application.

           

          The only drawback is they don't have a 64-bit version yet, so if your file is close to or exceeds 1,000,000 polys it probably won't help you, unless you can break it up into multiple files or reduce the poly resolution.

            • Re: Exporting dxf with 3D faces
              Jason Matusiak

              Thank you for the quick response Chris!

               

              I don't see a VRML save-as option in SW, but I did save it as an STL. 

               

              I downloaded AccutTrans to try, opened the STL, and got just a shell of the building (no windows, doors, or even holes for them):

              shell.png

               

              Maybe I am doing something wrong in SW?

                • Re: Exporting dxf with 3D faces
                  Chris Dordoni

                  Can you post the SolidWorks file, or a screenshot of what it looks like in SolidWorks?

                    • Re: Exporting dxf with 3D faces
                      Jason Matusiak

                      Gladly.  I can get you the screentshot pretty easily (it is below).  If that doesn't tell you what you are looking for, let me know.screenshot.png

                        • Re: Exporting dxf with 3D faces
                          Chris Dordoni

                          The first thing that comes to mind is that if you have an object that is hidden, it is still being exported along with the shell that has the windows & doors. If you did not use the "selected bodies" option when you saved as an STL, you would get the hidden objects as well.

                            • Re: Exporting dxf with 3D faces
                              Jason Matusiak

                              Hmmm, that could be an issues, but I didn't see that option.  This is what the save-as for the STL options menu looks like:

                              options.png

                                • Re: Exporting dxf with 3D faces
                                  Chris Dordoni

                                  After you use the "save as" command, you will get another dialog box IF you have several bodies.

                                   

                                  You will have a choice:

                                   

                                  save all bodies

                                  OR

                                  save selected bodies

                                   

                                  I believe it defaults to save all bodies.

                                    • Re: Exporting dxf with 3D faces
                                      Jason Matusiak

                                      OK, this is where my background in SW will start to fail me.  I don't get that box, so I assume that I must not have several bodies since I don't see that box.  Is that maybe part of the issue, that the doors/windows/etc are other "bodies?"

                                       

                                      My feature manager looks like this:

                                      features.png

                                        • Re: Exporting dxf with 3D faces
                                          Chris Dordoni

                                          You have used assembly components to subtract the window and door shapes?

                                           

                                          You might have to flatten the assembly heirarchy first before you export to STL. I do see the checkbox is selected for "save all components of an assembly in a single file" in STL export option, but this does not appear to be working.

                                            • Re: Exporting dxf with 3D faces
                                              Jason Matusiak

                                              Chris Dordoni wrote:

                                               

                                              You have used assembly components to subtract the window and door shapes?

                                              short answer: I don't think so?......

                                               

                                              longer answer: An intern was building up the stuff for me (she had done a little bit in school but this isn't her forte either), so I am not quite sure, but I wouldn't have thought that that was the case here.  If I expand the side walls (she called them "sidings" in the project), I can see a series of "cut-extrudeX" sub categories for the windows and doors, so I would have that that I am not using the components to subtract them.

                                               

                                              But, if you have a suggestion, I will gladly take a different approach to creating this simple building!

                                               

                                              another screenshot:

                                              screenshot2.png

                                                • Re: Exporting dxf with 3D faces
                                                  Chris Dordoni

                                                  Cut-Extrude is a subtraction

                                                   

                                                  Try saving the assembly as a Parasolid file (X_B) and then open that back up in SolidWorks. That is the quickest method I know to flatten it if there is no option to flatten it when you export.

                                                   

                                                  If there is an option to "save all components of an assembly in a single file" when you export, make sure that is checked as well.

                                                    • Re: Exporting dxf with 3D faces
                                                      Jason Matusiak

                                                      Well, I think you are onto something now.  I tried your X_B trick, but no dice.  This leads me to believe that some other setting isn't quit right in my original solidworks file (the only thing I can think).  After an export, and then I open it, I don't see any windows/doors, it looks like my first screenshot in this thread (3rd post).  I know the doors/windows are there because I can see them when I click on them in the design tree and they highlight the spot in the model, but the model itself seems to have flattened out the walls and filled in the extruded portions (if that makes sense). 

                                                       

                                                      Do you have another thought, or at this point should I tear down the building (since it is so simple), and build it back up in a different way?

                                                       

                                                      Thanks again!!!

                                                        • Re: Exporting dxf with 3D faces
                                                          Chris Dordoni

                                                          I don't work with assemblies a lot, so its possible there is an easy way to correct this.

                                                           

                                                          I might be able to fix it quickly, but I would need your files to try a few things. Since its an assembly, you will have 8 part files (with the names shown in your original feature manager screen shot) and the 1 assembly file.

                                                            • Re: Exporting dxf with 3D faces
                                                              Jason Matusiak

                                                              Thanks Chris.

                                                               

                                                              I have a .zip of the files if you want me to get them to you somehow.  I am more than willing to do whatever changes to them you think needs to be done to them to make them right (I'm not tied to what we are doing now)!

                                                                • Re: Exporting dxf with 3D faces
                                                                  Chris Dordoni

                                                                  You can send them to the email address in my profile or post them here.

                                                                    • Re: Exporting dxf with 3D faces
                                                                      Jason Matusiak

                                                                      It doesn't look like i can add files to here for some reason (I tried earlier too), and your email shows up as private still.  I will send you a PM with my email.

                                                                       

                                                                      Thanks!

                                                                      • Re: Exporting dxf with 3D faces
                                                                        Chris Dordoni

                                                                        Jason, try checking my profile again. I thought I had previously set to visible to other users, but I just now enabled that.

                                                                          • Re: Exporting dxf with 3D faces
                                                                            Jason Matusiak

                                                                            Looks like the change took effect.  I sent it off about and hour ago, so if it didn't end up going through, let me know (since it probably got caught in a SPAM filter somewhere). 

                                                                            • Re: Exporting dxf with 3D faces
                                                                              Chris Dordoni

                                                                              Jason,

                                                                               

                                                                              Right click on these files in SolidWorks feature manager, and choose "supress",

                                                                              doors<1>

                                                                              doors<2>

                                                                              doors<3>

                                                                              windows<1>

                                                                              windows<2>

                                                                              windows<3>

                                                                               

                                                                              You should now be able to export just the roof<1> and sidings<1> in the STL. Make sure "save all components of an assembly in a single file" is still checked in the STL options.

                                                                               

                                                                               

                                                                              The openings for the windows and doors are subtracted from the walls. In addition, there is a transparent piece placed inside of each opening, which is why it all looked solid in the original STL you saved

                                                                                • Re: Exporting dxf with 3D faces
                                                                                  Jason Matusiak

                                                                                  OK, great, thanks Chris.  I have to run out today, so I will hit this first thing in the morning, thanks so much!!!

                                                                                   

                                                                                  If I do these steps though, do I "lose" the windows and dooers (which are glass in the design) from the design since I am only exporting the roof and siding?

                                                                                    • Re: Exporting dxf with 3D faces
                                                                                      Chris Dordoni

                                                                                      They are still in the file but are not displayed or used in any downstream operations, which is distinctly different than hiding. This works to quickly accomplish what you need to do. You can "unsuppress" them when you are done saving, or just do not resave the file.

                                                                                       

                                                                                      However, if you had operations further down in the feature manager that used these parts, suppressing them could be an issue.

                                                                                       

                                                                                      So there may still be a way to save only the roof and siding without supressing them. 

                                                                                        • Re: Exporting dxf with 3D faces
                                                                                          Jason Matusiak

                                                                                          OK, so I gave that a try and I can definitely see the windows and doors (which is a major advantage), but I have two issues:

                                                                                          1 - It seems like it flattened the sides and roof into one layer.  I needed to keep them separate layers in the dxf so I could assign them separate properties when I import into my RF software

                                                                                          2 - I will end up needing doors/windows in the end so I can assign them properties like mentioned above for the end-software.

                                                                                           

                                                                                          Is this doable with what I have, or should I start over from scratch (maybe using something non-assembly or some other approach)?

                                                                                            • Re: Exporting dxf with 3D faces
                                                                                              Chris Dordoni

                                                                                              Jason,

                                                                                               

                                                                                              I would not have done this as an assembly myself; however, I believe the objects can be used as they are without having to recreate them. (For future reference, you can create separate objects in one part file without using an assembly)

                                                                                               

                                                                                              The objects can be saved individually (suppress all except for the one you want to save) and then you could change the layer/material for each object in another application.

                                                                                               

                                                                                              AccuTrans can create multiple layers by copying and pasting from several files. So you could open each individual object, and copy/paste it so you can build a new file with multiple layers. You can change the name and color of the layer in AccuTrans.

                                                                                               

                                                                                              What I don't know is if that will be sufficient for your end application if the layers are differentiated by name and color, but you can certainly test this.

                                                                                               

                                                                                              If you need something that is more compatible with AutoCAD's layers, you would need something like TurboCAD or IntelliCAD to do this.

                                                                                                • Re: Exporting dxf with 3D faces
                                                                                                  Jason Matusiak

                                                                                                  OK, I've spent the day trying to solve this, but I think I've run out of options.  What I thought I would do (but since you didn't suggest it, it probably means I am thinking about it right), was to supress everything but the sides.  I then saved that as an STL (so now I should have holes for the windows and doors).  Then I opened that , deleted the supressed stuff, and saved as a part (replacing the original sides SDLPRT.  I then opened the whole project and tried to save that off as a part (as opposed to an assembly), but ran into tons of errors because of screwed up coincidences and things of that ilk.  I assume that I sent myself off on a wild goose chase?

                                                                                                    • Re: Exporting dxf with 3D faces
                                                                                                      Chris Dordoni

                                                                                                      Yes, you are right. Suppress everything EXCEPT for the object you want to save in the STL file. Not sure why you had errors though.

                                                                                                       

                                                                                                      I have sent screen recordings of the SolidWorks and AccuTrans functions to your email address. I also sent the DXF file saved from AccuTrans.

                                                                                                       

                                                                                                      If you still have questions let me know.