Cooking CAD

Archived SketchUp forum thread, that inspired many SketchUppers to add lots of useful tips...

Tracy

1/21/06

Hi All,

I already posted this thread in the Ruby Forum related to a Ruby thread but thought I might try here, too.

I'm fairly new to SU and am experiencing the typical problems working with imported cad drawings. The attached .skp is a current project I'm working on. I've gotten most of it converted into faces by running various scripts such as "Label Stray Lines", "Make Faces 1.1", "Repair Broken Lines", etc. All of which have been extremely helpful.

I've been able to greatly increase the number of faces but am still struggling to finish the rest through trial and error (and some hair pulling). Basically, I need to have everything inside the outer most line into faces. I'm redrawing some things, drawing lines through parts of areas (I think I read in another thread where someone called it "triangulation") trying to find out at what point the problem occurs.

My question is...does anyone have a typical set of tasks they do to an imported cad drawing before starting working on it? A recipe of sorts...

"SketchUp Roasted Cad"

1. Import cad dwg.

2. Select all, explode.

3. Run "....." script on all.

etc.

I think you get my drift. I've searched the forum for this issue and have read some very helpful information. But, having it presented in a single "how to" would be very helpful.

Thanks for any help.

Tracy

[%sig%]

Glenview Courtyard 3D - 2.skp

Stu Mayhew

1/21/06

Tracy,

it can be a pain at times even with 'make faces'

In the attached I have gone around the outer wall, joining corners, which seems to work. The 'joins' should erase one you have gone right around.

Stu

Glenview.skp

otto

1/21/06

Tracy,

Usually, I clean the drawing in the cad before importing it to SU.

Autocad has some nice features for it.

DAISAKU

1/22/06

Start from a scratch.

Use your CAD only if necesary.

Or only a portion of the design.

The Importation works better in the other way: Sketchup to CAD.

TracyV

1/22/06

Stu,

Thanks for that tip. A few clicks and the outer most band was done!

Otto,

I hate to admit it, but the cad drawings are usually mine. And, I'm a fanatic about always snapping to lines or corners, making arcs or circles tangent, removing any extra stuff, purging and auditing before importing, all that good stuff. Especially drawings from engineers...they are usually the worst (sorry guys, no offense). But, there always seems to be something amiss. Can you tell me what some of those “nice features” are in cad that you mentioned (though I'm probably already using some of them.)?

Daisaku,

IÂ’d prefer to use the cad drawings whenever I can since IÂ’ve already gone through the work of drafting the design in. It doesnÂ’t make sense to me to do the work twice. However, I understand your point. I think it depends on the project. Running the various scripts and doing a little touch-up was easier than redrafting the entire design all over again (in my opinion). Thanks for your feedback.

[%sig%]

Steven (Grayslake, Illinios)

1/22/06

Tracy,

What you're really looking for is how to prepare your CAD drawings for import. As someone who has done this more times than I care to recount here's what I do.

1) Get rid of anything from your CAD drawing that you don't need (blocks of furniture, applicances, landscaping, etc.) or things which will not import anyway (text, dimensions, 3D solids, etc.).

2) Explode your drawing. Several times.

3) Purge your drawing. Several times.

3) Make sure all lines are connected (ie. make polylines of your geometry). This is especially true of curves.

3a) Make sure all your geometry in on Z=0 (Express Tools has Flatten and there are LiSP routines on the web if you don't have Express - literally search flatten.lsp).

3b) If the curves you need are important curves (ie. in SU you want the best curve possible - as you know SU does not do curves but short line segments) do the following: Use the Divide tool in CAD to divide your cicle/arc into semi small lengths (the length of each segment will depend on the size of the curve - the more points, however, the higher the poly count in SU). Once your curve is divided erase your curve. Now draw a polyline from your endpoint to all your nodes and finish at your endpoint. Sounds time consuming but it took longer to explain than it will do actullt accomplish.

4) Move all geometry to Layer 0.

5) Copy/Paste drawing into a new, clean drawing file (no layers, templates, etc.).

6) Purge your drawing. Do an audit, too.

7) Save your drawing as a dwg or dxf and then import into SU.

8) In SU you will be left with just lines. Use the Ruby script MakeFaces to, well, create your faces without redrawing everything. For faces not created you will have to triangulate (complex interior faces do not always close).

9) Now start push/pulling your faces to create your final massing model.

Sounds complex but it's really easy - and fast.

Good luck.

Steven.

TracyV

1/22/06

Steven,

That's great! Thanks so much for your method. Great minds think alike. This is pretty much the process I followed (except for checking that everything is on Z=0 I always forget to do that). So, thanks for confirming that IÂ’m on the right track.

I’ve attached my finished model. Well, almost finished. I’m still trying to work out the fencing along the stairs and accessible ramp. Otherwise, I can’t wait for my next project. No doubt, it will be quicker and easier now that I’m getting the hang of it. Next time, I want to try the “Dennis Technique” of rendering it in photoshop.

Best Regards,

T

Glenview Courtyard 3D - 2 (1).skp

Otto

1/22/06

Steven,

The only thing I see missing in your list is the politicaly wrong command "overkill". its in express menu autocad.

Steven (Grayslake, Illinois)

1/23/06

Hmmm... I did seem to foget that now, didn't I? OK, here's an amended list to copy/paste into another thread when the time comes....

1) Get rid of anything from your CAD drawing that you don't need (blocks of furniture, applicances, landscaping, etc.) or things which will not import anyway (text, dimensions, 3D solids, etc.).

2) Explode your drawing. Several times.

3) Purge your drawing. Several times.

4) Use Overkill in the Express tools to rid your drawing of duplicate lines which may be on top of other lines. If you don't have Express you can find Overkill on the internet.

5) Make sure all lines are connected (ie. make polylines of your geometry). This is especially true of curves.

6) Make sure all your geometry in on Z=0 (Express Tools has Flatten and there are LiSP routines on the web if you don't have Express - literally search flatten.lsp).

7) If the curves you need are important curves (ie. in SU you want the best curve possible - as you know SU does not do curves but short line segments) do the following: Use the Divide tool in CAD to divide your cicle/arc into semi small lengths (the length of each segment will depend on the size of the curve - the more points, however, the higher the poly count in SU). Once your curve is divided erase your curve. Now draw a polyline from your endpoint to all your nodes and finish at your endpoint. Sounds time consuming but it took longer to explain than it will do actullt accomplish.

8) Move all geometry to Layer 0.

9) Copy/Paste drawing into a new, clean drawing file (no layers, templates, etc.).

10) Purge your drawing. Do an audit, too.

11) Save your drawing as a dwg or dxf and then import into SU.

12) In SU you will be left with just lines. Use the Ruby script MakeFaces to, well, create your faces without redrawing everything. For faces not created you will have to triangulate (complex interior faces do not always close).

13) Now start push/pulling your faces to create your final massing model.

Steven.

Tracy

1/23/06

Otto,

I never heard of "overkill". Thanks for adding it to the discussion. I'll be anxious to try it, especially on many engineering drawings I receive.

And, Steven,

Thanks again for the list. It will be very helpful to me and to many others, I'm sure!

T

[%sig%]

Michael Young

1/23/06

Sort of in line with this discussion is something I would love to see in SU, which is the ability to control how a NURB spline will import into SU from DWG. SU does at least an adequate job of it usually, and if I need particular results, I segment the curve in CAD. But if I'm working quickly, I often just import it and make do with a less than good interpretation.

SU must have a parameter set somewhere in its guts that converts the curve. I would love control over it, say, in Preferences.

—M

Anssi (Porvoo, Finland)

1/23/06

This thread made me remember a similar one some time ago, with a link to an AutoCad plugin (lisp,arx?) that did the opposite of "overkill", by splitting long lines at intersections, making the work of "findfaces.rb" much easier in SU. Anybody remember the link?

Anssi

Poul Lodberg

1/23/06

Found the link, it was posted at the Ruby forum:

<http://www.synapse-informatique.com/qbrick_en.htm>

Must try it, might be handy

Anssi

Tracy

1/23/06

So, where would the QBrick command fit into Steven's list:

as an addition to the list (it slides in between #5 & #6) or, does it replace #5. or, somewhere else?

T

Anssi (Porvoo, Finland)

1/23/06

Tracy,

I would change Steven's order somewhat

I am mostly quoting directly from his post:

1) Get rid of anything from your CAD drawing that you don't need (blocks of furniture, applicances, landscaping, HATCHES, FILLS, GRAPHIC SYMBOLS etc.) or things which will not import anyway (text, dimensions, 3D solids, etc.).

2) Explode your drawing. Several times.

3) Purge your drawing. Several times.

4) Make sure all your geometry in on Z=0 (Express Tools has Flatten and there are LiSP routines on the web if you don't have Express - literally search flatten.lsp).

5) Use Overkill in the Express tools to rid your drawing of duplicate lines which may be on top of other lines. If you don't have Express you can find Overkill on the internet.

6) Make sure all lines are connected (ie. make polylines of your geometry). This is especially true of curves.

7) If the curves you need are important curves (ie. in SU you want the best curve possible - as you know SU does not do curves but short line segments) do the following: Use the Divide tool in CAD to divide your cicle/arc into semi small lengths (the length of each segment will depend on the size of the curve - the more points, however, the higher the poly count in SU). Once your curve is divided erase your curve. Now draw a polyline from your endpoint to all your nodes and finish at your endpoint. Sounds time consuming but it took longer to explain than it will do actullt accomplish.

8) Make sure that the lines that should form surfaces in SU form neat interconnected perimeters round them, and break at all intersections. This can be done automatically by utilities like Qbrick

9) Move all geometry to Layer 0.

10) Copy/Paste drawing into a new, clean drawing file (no layers, templates, etc.).

10) Purge your drawing. Do an audit, too.

11) Save your drawing as a dwg or dxf and then import into SU.

12) In SU you will be left with just lines. Use the Ruby script MakeFaces to, well, create your faces without redrawing everything. For faces not created you will have to triangulate (complex interior faces do not always close).

13) Now start push/pulling your faces to create your final massing model.

Thanks Steven.

I put Flatten before Overkill, because it can create new overlapping geometry.

Now for somebody else to make this even more watertight

Anssi

Steven (Grayslake, Illinois)

1/23/06

Good catch, Anssi. This revised list makes more sense.

Steven.

Chris Fullmer

1/23/06

In my opinion, that qbrick is an absolute necessity. It can really help the find faces.rb work much more effectively. I still am waiting for the breakatintersections.rb to be released (i think i saw it was being created but not necessarily with that name).

Chris Fullmer

Steven (Grayslake, Illinois)

1/23/06

You know, in 15 years of using AutoCAD, I've never heard of qbrick. However, doing a quick search I did find it on <http://www.caddepot.com>. I'll have to play with this a bit...

Thanks Chris.

Steven.

Tracy

1/23/06

I just loaded it and tried it. Pretty interesting. If for nothing else, at least now I can explode a circle.

T

[%sig%]

Steven (Grayslake, Illinios)

1/23/06

Explode a circle, you say? You mean #7 on my list can be replaced with qbrick? Interesting....

Steven.

Tracy

1/23/06

Explode a circle....in CAD. Don't even ask! :)

otto

1/23/06

Now the tricky part.

once you have nice closed polylines, use the command 'region'.

you wont see any change in CAD but it will create magic while importing it to SU.

All the regioned polylines will turn to grouped faces in SU.

And now my question:

Do you know of a lisp to eliminate undo's of zoom commands for 2004? I know it is embedded in 2006?

Steven (Grayslake, Illinois)

1/24/06

Not quite true, Otto. You will see your regioned faces (created by typing REG and selecting all your polygons - or just some) if you type SHA (for shade) on the command line. The color of the region will be the same color as the layer on which it was created. To get back to a simple line view one must type SHADEMODE on the command line and select 2D (for 2D wireframe).

Steven.

zaxdante137

1/24/06

could someone tell me where can i find that overkill tool?

Steven (Grayslake, Illinois)

1/24/06

Express>Modify>Delete Duplicate Objects.

If you don't have Express you can find this LiSP (in various forms) at <http://www.caddepot.com/cgi-bin/cfiles/cfiles.cgi?0,0,0,0,3> Search "duplicate" or "overkill" to find it. Or google overkill.lsp or "delete duplicate lines."

Steven.

Tracy

1/24/06

I tested our “CAD To Do” list on my previously posted courtyard project.

This is the imported .dxf without performing the tasks on the list. All I did, in CAD, was delete all blocks, hatches, and other stuff that wasnÂ’t needed, and copy/pasted into a new drawing. I purged and audited, too. Then I saved as .dxf and imported into SU. As you can see, there is still a bit of work to be done in making faces.

Cont. on next post...

Courtyard-Without List.skp

Poul Lodberg

1/24/06

Here is the same cad drawing after running through all the items on the list. The only changes I made are as follows:

After running overkill, I converted all lines into polylines. This was so I could select all, then run the PLJOIN command. It did not work before doing this. Cad seemed to ignore the command as nothing was joined, even the polylines.

A note on “overkill”. It seemed to work great with the tolerance set to “0”. However, when I started increasing that number, the command started to erase lines that should not have been.

I also skipped #8 just for this test.

I followed everything else as outlined by Steven and Anssi.

And, viola I now have all faces. Granted, they are not exactly as I need them to be (ex: the middle portion of the curved stairs and landing combined into one face, the pool, coping, and surrounding patio combined, etc.) but, I think it is still a much better starting point than without this list.

What do you guys think?

Courtyard-With List.skp

Steven (Grayslake, Illinois)

1/24/06

Indeed it is better. Still, I wonder why the faces are a might screwed up in the center section? Could there be overlapping lines which Overkill did not pick up? Or some polyline that is not quite closed. You can draw a square polyline with just three sides - but you still have to close it. I think that may be the case here. Of course, without the orginal dwg/dxf I have no way of telling.... I suppose I could export out of SU and into CAD but that move in and of itself may correct - or worsen - the problem.

Steven.

Tracy

1/24/06

Steven,

I failed to check the cad drawing after running the list. However, after your post I looked at it again and I think I see the problems. There are stair treads that do not extend to the curves. And some polylines did not break at all intersections as I hoped QBrick would do. An extra explode and QBrick would probably have helped. Plus I should have checked the drawing before importing. I guess it will never be a perfect process...but it is getting close. :)

By the way, I tried attaching the cad dwg but it was kicked back as too large. I thought there was no limit to file size for attachments? The cad dwg is ~4 mb.

T

Steven (Grayslake, Illinois)

1/24/06

There is a 2mb limit to postings. However, CAD files crunch down quite well so try zipping it. And, when zipped, the Forum is sometimes forgiving in the 2mb limit (though not always).

Steven.

Tracy

1/25/06

Steven,

Thanks. I've attached the zip in case you wanted to look at it.

I very much appreciate everyone's input into this list. I think it has made a daunting task (at least for beginners) seem much more manageable. I know I'll continue to perfect it as I become more proficient with SU. My collegeaus are in aw of my prowess so far...ooooh, aaaaah!

T

Courtyard.zip

catamountain

1/25/06

I have read this thread with great interest. SU suits most all of my drawing requirements. But depending on which way my business goes, I may have use these clean-up steps on CAD files prior to importing.

I have a retired version of AutoCAD from someone who upgraded to REVIT. I have never tried to use it yet. A while back I looked over the shareware offering at <http://www.caddepot.com/> to help be find more user friendly and affordable versions of CAD. AndyCAD comes to mind.

Can anyone suggest some favored alternatives to AutoCAD for pre-SU clean-up?

Drew

2/2/06

Okay I apologize if this has already been stated is there a way to flatten your SU drawing if the CAD file has already been imported? Looking at the imported dwg, everything looks to be Z=0, but apparently not the case IÂ’ve already done too much work in the SU file to start over suggestions?

Drew

[%sig%]

Steven (Graylake, Illinois)

2/2/06

Search the Ruby Forum. I know there is a flatten tool somewhere.... I might be on FormFonts, though...

Big help, huh?

Steven.

Dan

2/2/06

Tracy,

Just opened your dwg file and was looking at it - you are getting hammered by "Layer Filters". You can see them in your Layer Manager. This is the exact same drawing only now (52.3KB) from 4.31MB.

In 2006 allows you to delete these very quickly less than a second. If you have an older version of cad there is a lisp that works well but is slow - it might take 5 to 7 minites to get rid of them you think you rcomputer is locked up but its not - its just deleting those unused filters. There is no need for them to even be there, you won't miss them at all. The lisp is called "xpurge" (free) you should be able to find it.

If you ever notice a your drawing files getting really big and have deleted and purged, overkilled and flattened to just lines and it is still 1 or 2 MB files then it is most likely "Layer Filters". 2005 started allowing delete all option (still slow) and 2006 has fixed it. They are like viruses attached to blocks or layers inserted into drawings, they get added to the file, but are not removed with purge. It really is like an AutoCAD virus, once you have them in a block that you insert into a drawing, now tha file is infected too.

Hope this helps.

Dan.

Courtyard TEST.dwg

TracyV

2/3/06

Dan,

Thanks for that tip. I actually used a lisp called "cdgpurge" which does the exact same thing. My collegeau found it and downloaded it so I don't have the link but I'd be happy to get it if anyone is interested.

What a difference this lisp makes. I've always hated all those layer filters...and many times, we scratch our heads here wondering why on earth a drawing with relatively few lines, is so darn large. Now we know why.

Thanks again. This lisp will now be a part of my typical drawing clean-up with the cad drawings I get from other consultants. We'll be upgrading to 2006 within the next month so I look forward to using it.

T

Dan

2/3/06

Tracy,

Glad I could help, layer filters come from some 3rd party add-ons to AutoCAD and we have narrowed it down to mainly Architectural desktop. I will bet others reading this will think back to a time when they too couldn't figure out why there files were so large and slow with so few lines on the drawing. At least they can fix it now.

Anssi, I too was curious about the "qbrick" command (hadn't heard of it either) it works as shown but has some "French" (I think) in the command line with English too, is there a full or totally English version?

Otto, you mentioned the use of "region" command earlier, whatÂ’s the difference when importing into SU over using "boundary" command (polyline) or is there?

Thanks,

Dan

Poul Lodberg

2/4/06

Before importing dwg to SU I always does this very simple procedure.

1. Close all layers with information not needed.

2 Write block ( just type w in command line)

3. Pick a point and select the part of the drawing you need

4. Enter the name for the new drawing (block)

Now you will have a new drawing file, with a very reduced size, ready for importing into SU. I have been using this method since Autocad 14 and it works fine for me.

Anssi (Porvoo, Finland)

3/16/06

People still seem to look for this thread for reference. I think it misses the mention of the favourite method of many users of dealing with the CAD linework after importing into SU.

Despite all the cleaning etc. applied to the file before importing it ino SU, using the CAD created edges directly to form a model in SU is a nuisance, and often results to problems with slight misalignments, nonplanar faces etc. so usually I decide to redraw everything all the same, using the CAD lines as a template.

1. I draw a face larger than my model, horizontal for plans, vertical for elevations

2. I group the cad lines, and move the group up on the blue axis a convenient distance from the base plane. (or away from the elevation plane)

3. Now I can start drawing: I place my drawing tool on the plane, wait for the inference marker (on face) to appear, press and hold down Shift, and start drawing, pointing at relevant points and intersections in the CAD linework. So the new lines are assuredly created coplanar, and on the base plane. I favour the Rectangle tool for this.

4. When all the necessary edges are created, I can delete or hide the CAD linework, and start push-pulling to complete the model. Most often this doesn't take longer than fighting with the CAD lines to make them form faces etc.

Anssi

Christopher Love

3/16/06

Another quick method that I have used as I have upgraded to Windows XP at work and my old license of AutoCRUD wont work on XP is to import the dwg file, I then drop a section plane on the dwg and create a group from the slice. I then copy the group thus created into a new SU file, delete all the unnecessary layers and the run the make faces.rb I have attached your original .skp after this process. As you can see it doesnt bring in all the faces however it is quicker than cleaning up all the AutoCRUD mess.

Regards

Chris

Glenview%20Courtyard%203D%20-%202[1].skp

lapx

3/16/06

Anssi,

Becareful with flatten, I have notice it to distort lines after using "aecobjexplode" .

Some lines were no longer orthagonal.

Tracy

3/18/06

Anssi,

I understand your point about redrawing in SU to ensure that all things are ready to go. And, before this working list of procedures was born, I would have totally agreed. In fact, redrawing the cad drawing from scratch seemed like the only alternative. By the time I fixed all the problems in my original cad dwg, I had just about redrawn it anyway.

But, running the list on the cad drawing while its still in cad has eliminated all but a few problems that need fixing before pushpulling. And, I can live with that. I only spend a few minutes now fixing things here and there. The majority of the model is ready to go once I import it into SU. So, it just doesn't make sense to me to redraw the whole thing over again. It's not a perfect process, but, I don't see the logic in doing the work twice, which was my whole point for starting this thread anyway--to avoid having to redraw something I had already spent the time drawing. The only time I would draw a model from scratch in SU is if I had no cad base and was using an imported image for reference or just my imagination.

T

arail

3/18/06

I'm going to print this whole thread out and make it into a booklet.

steve@aecd

3/19/06

My question is regards to deleting layer filters. I use desktop 2006. The only time this option has popped up was when I was trying to get to the layers to make changes and I am working on a CAD file that someone else has sent me. Sometimes it's an export from Datacad. I guess my question is, how to I get it to pop-up whenever I want to run it to keep my filesize down? I have looked through the layer commands, but haven't been able to find it there.

Also thanks for all the cool tips. I am a user of ACAD that needs to pull previously drawn files into SU to create 3D versions of them. I am trying to work out mostly interiors right now.