(defun C:xpoint() ;inspired by Todd Wessendorf of Alexandria, Virginia
;This code exports the coordinates of entities. ;Line, LwPolyLine, arc, ellipse, circle etc. ;to a txt file. ;For tutorial purpose, the full entity list is dumped on the command line for you to become familiar with - where the coordianets are, the entity type, layer, color etc.
;open a text file to append exports -you can write full path (setq out (open "MyEntities.txt" "a")) (setq Suzy (ssget)) (setq Suzilen (sslength Suzy)) (setq Sneaky 0) (while (< Sneaky Suzilen) (setq EDNA (ssname Suzy Sneaky)) (setq EDDY (entget EDNA)) (print (+ 1 Sneaky))(Princ "\nEDDY ... ") (print EDDY)
(princ "\n");new line (princ (LIST(dxf 0 EDDY))) (princ) ;now out to file (princ "\n\"(" out) (princ (LIST(dxf 0 EDDY)) out) (princ) (setq Sneaky (+ 1 Sneaky)) (SETQ typ (dxf 0 EDDY)) (cond ((= typ "LWPOLYLINE") (exportMpoints EDDY)) (t (exportPoints EDDY)) )
);end while (close out) (print "Where did that txt file go?...") (print (findfile "MyEntities.txt")) (princ) ) ; (defun dxf (n ed) (cdr (assoc n ed))) ; (defun exportpoints(EDDY)
;to see on command line (if (dxf 10 EDDY)(princ (dxf 10 EDDY))) (if (dxf 11 EDDY)(princ (dxf 11 EDDY))) ;now same thing to append to file (if (dxf 10 EDDY)(princ (dxf 10 EDDY) out)) (if (dxf 11 EDDY)(princ (dxf 11 EDDY) out)) (princ ")\"" out) (princ) ) ; (defun exportMpoints(ShortEDDY) (while (setq ShortEDDY (member (assoc 10 ShortEDDY) ShortEDDY)) (princ (dxf 10 ShortEDDY)) ;now append to file (princ (dxf 10 ShortEDDY) out) (setq ShortEddy (cdr ShortEddy)) ) (princ ")\"" out) (princ) ) ;Homework - see AutoLisp helpfile (type VLIDE on Acad Command line) for ;read, read-line, entmake, entmod ;to write the reverse function that makes entities from coords in txt file. ;debug and correct the following. String lines are to be read as or made lists ;to use in entmake (defun C:imPoint() (setq in (open "MyEntities.txt" "r")) (while (setq myEnt (read-line in)) (princ "\n") (princ myEnt) ;entmake ;entmod ); (close in) (princ) )
Learn methods and guidelines for using stereolithography (SLA) 3D printed molds in the injection molding process to lower costs and lead time. Discover how this hybrid manufacturing process enables on-demand mold fabrication to quickly produce small batches of thermoplastic parts. Download Now
Examine how the principles of DfAM upend many of the long-standing rules around manufacturability - allowing engineers and designers to place a part’s function at the center of their design considerations. Download Now
Metal 3D printing has rapidly emerged as a key technology in modern design and manufacturing, so it’s critical educational institutions include it in their curricula to avoid leaving students at a disadvantage as they enter the workforce. Download Now
This ebook covers tips for creating and managing workflows, security best practices and protection of intellectual property, Cloud vs. on-premise software solutions, CAD file management, compliance, and more. Download Now