We have some architectural drawings in which some knucklehead drew the walls as Wide polylines (what a dope!). Any, I've routines to convert Solids and Traces to polyline boundaries (different knuckleheads!), but am a bit stuck on this one. Here's the solid routine: (defun c:sob (/ sol soladd ent typ i pt10 pt11 pt12 pt13 sol1 sol10 sol11 sol12 sol13) (princ "\nSelect Solid to create polyline:") ; (if (/= (setq sol (ssget '((0 . "SOLID")))) nil) (setq sol (ssget) soladd (ssadd)) (setq i 0) (while (< i (sslength sol)) (setq ENT (ssname sol i) TYP (cdr (assoc 0 (entget ENT)))) (progn (if (equal TYP "SOLID") (setq soladd (ssadd ENT soladd)) ) ) (setq i (1+ i)) ) (setq i 0) (repeat (sslength soladd) (setq sol1 (entget(ssname soladd i))) (setq sol10 (assoc 10 sol1) sol11 (assoc 11 sol1) sol12 (assoc 12 sol1) sol13 (assoc 13 sol1) ) (setq pt10 (list (cadr sol10) (caddr sol10))) (setq pt11 (list (cadr sol11) (caddr sol11))) (setq pt12 (list (cadr sol12) (caddr sol12))) (setq pt13 (list (cadr sol13) (caddr sol13))) (setq i (1+ i)) (command "pline" pt10 pt11 pt13 pt12 "c") ) (princ) ) Plines don't have all of the assoc 11, etc. things I'd need. Any thoughts are welcome! -- Regards, --------------- Reid M. Addis Registered Architect Architectural Applications Specialist Granary Associates 411 North 20th Street Philadelphia, PA 19130 Ph. 215-665-7056 email:
Boy, am I tired. Should be "Convert" "anyway", what else did I spell wrong? -- Regards, --------------- Reid M. Addis Registered Architect Architectural Applications Specialist Granary Associates 411 North 20th Street Philadelphia, PA 19130 Ph. 215-665-7056 email:
If the width is constant you can use group code 43. If the width is not constant you have to play with code 40 and 41 and there is one entry for each vertex. -- Best Regards, Jimmy Bergmark CAD and Database Developer Manager at www.pharmadule-emtunga.com Take a look at JTB FlexReport (FLEXlm report tool) - www.jtbworld.com/jtbflexreport SmartPurger (Purges automatically) - www.jtbworld.com/?/smartpurger.htm or download some freeware at www.jtbworld.com More on AutoCAD 2005; www.jtbworld.com/autocad2005.htm
Hi Reid, If you do not mind using a third party tool, try our GeoTools program. See URL in the signature below for a fully functional free download. Download @ www.4d-technologies.com/geotools GeoTools has a command to explode wide polylines and recreate the geometry of the width. I must add here that the program tries its best to do the job as well as possible but it is not a 100% solution. But it is better than having nothing. Regards Rakesh -- Please email me your replies. I may not always be observing the posts here. email: AutoCAD customization for Engineering/Mapping/GIS Get GeoTools @ http://www.4d-technologies.com/geotools Build MyGeoTools @ http://www.4d-technologies.com/geotools/my_geotools.htm FREE downloads : http://www.4d-technologies.com/techcenter </PRE>
Reid, Have you tried using vla-methods to extract the Solid's coordinates? I took a different approach and came up with this: (defun c:sob (/ ss i e Sobj sc scl c num el r p) ;|Turn Solids into LWPolylines|; (if (setq ss (ssget '((0 . "SOLID")))) (progn (setq i -1) (while (setq e (ssname ss (setq i (1+ i)))) (setq Sobj (vlax-ename->vla-object e)) (setq sc (vla-get-Coordinates Sobj)) ;; turn the variant to a list of coordinate points (setq scl (vlax-safearray->list (vlax-variant-value sc))) ;; and turn it into a list of 3 coordinates per pointlist (while scl (setq c -1 ;;counter num 3 ;;# coordinate to create el nil ;;initialize list to nothing ) ;; loop though point to assemble list (while (< (setq c (1+ c)) num) (setq el (cons (car scl) el)) (setq scl (cdr scl)) ) (setq el (reverse el)) (setq r (cons el r)) ) ) (setq r (reverse r)) ;;Solids are 4-point entities, but points must be reversed to make it work (setq r (list (car r) (nth 1 r) (nth 3 r) (nth 2 r) ) ) (command "._pline" (car r)) (while (setq p (car (setq r (cdr r)))) (command p) ) (command "close") (vla-delete SObj) ) ) (princ) ) Matt \On Fri, 2 Apr 2004 09:16:17 -0500, "Reid M. Addis"
Matt, I don't need the freakin solid! I need the freakin wide lwpolyline ! I've got a couple of hot leads on this, but additional help is appreciated.\ Solids and traces are easy as they have actually boundary points. For the wide polyline, you have to get its assoc 43 (width) all of its vertices in order, then start at the first vertex, adding 1/2 the width to the xy coordinate, keep drawing until you hit the last vertex, then reverse direction using -1/2 the width, etc... you get the idea. More complicated than my little brain can handle! -- Regards, --------------- Reid M. Addis Registered Architect Architectural Applications Specialist Granary Associates 411 North 20th Street Philadelphia, PA 19130 Ph. 215-665-7056 email:
Since you seem to be working with a constant-width polyline situation, how about trying this, which I think would be a lot easier? (I'll let you figure the actual code for it -- shouldn't be too hard.): Determine the width (assoc 43), then change the global width of the subject polyline to 0 [zero] (entmod substitute 0 into assoc 43), then offset it to both sides by half the width you determined, then erase the original polyline. If it's drawn within the Drawing Limits, you could probably use (getvar "limmin") and (getvar "limmax") for points to define the direction to offset to for each side. Kent Cooper, AIA "Reid M. Addis" wrote ...
Sorry, Reid, I misread your post. Indeed it is not a trivial problem. I know you use ADT, so another approach would be to select and read a pline segment's width, and apply the start and end points of the segment to create a generic wall with the pline width's width. Matt