Hello, I need programming assistance on two things (LISP preferred, VB also ok): 1. To re-create all the constituent boundary paths by reading a HATCH object. The HATCH object may be non-associative and can contain islands etc. Boundaries may contain polylines with arcs or splines. I have managed the simple straight line polylines but the arcs are stumping me. 2. To identify the hatched and non-hatched polygons from a list of polygons in an island hatch pattern. I tried to go by the DXF code 92 but am still confused after a few tests. Any pointers welcome. Regards Rakesh -- 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>
I thought i'd give it a try, but when I try to load it.. I get this.. ;error: syntax error thoughts? (vanil. 2K4)
That error indicates any of dozens of possible errors in the .lsp file you're attempting to load. Looking at the code posted, it's likely that word wrap has broken one or more of the lines of code, so as to make them unintelligible to the LISP interpreter. You may have some luck with either the LISP Analyzer in Migration Assistance, or with the VLIDE editor and its built-in analysis and debugging functions. Or, just manually search through your file, making sure that there aren't any misplaced line breaks. ___
It came on the CD with AutoCAD2000 and (I believe) 2000i. You may have do download it separately from the Autodesk Web site for later versions. ___
On a quick look, I found one obvious error: (if (and A2k (=3D (strcase (cdr (assoc 410 ed1))) "MODEL")) should be (if (and A2k (= 3D (strcase (cdr (assoc 410 ed1))) "MODEL")) -- a space is required after the "=" function. There may be others like this. There are other problems as well; there are a number of localized variables that don't appear in the code, for example, and other symbols that should be localized that aren't. Those "=" signs in the declaration shouldn't be there; it looks like somewhere along the line, some app inserted them where spaces (or more likely) linebreaks originally appeared. The symbol 'bptf' appears in the code, but neither 'part' nor 'bptf=part' do '*modelspace*' appears, but '*model=space*' does not; 'en2' is used, but 'en=2' is not; etc. You need to either find an original copy of the code or do considerably more cleanup. ___
I don't think the 3D is supposed to be there at all. Almost looks like a GroupWise to HTML to Text email conversion problem. The code posted by Dan didn't have that. -- R. Robert Bell, MCSE www.AcadX.com | On a quick look, I found one obvious error: | (if (and A2k (=3D (strcase (cdr (assoc 410 ed1))) "MODEL")) | should be | (if (and A2k (= 3D (strcase (cdr (assoc 410 ed1))) "MODEL")) | -- a space is required after the "=" function. There may be others like | this. | | There are other problems as well; there are a number of localized variables | that don't appear in the code, for example, and other symbols that should be | localized that aren't. Those "=" signs in the declaration shouldn't be | there; it looks like somewhere along the line, some app inserted them where | spaces (or more likely) linebreaks originally appeared. The symbol 'bptf' | appears in the code, but neither 'part' nor 'bptf=part' do '*modelspace*' | appears, but '*model=space*' does not; 'en2' is used, but 'en=2' is not; | etc. | | You need to either find an original copy of the code or do considerably more | cleanup. | ___ | | > ok.. this is what i've got now.. | > | > But it is still returning errors. and sometimes won't work at all. | > | > can you do anything more with it? | |
Voila! Mr. Bell hit it on the nose. Remove all occurrences of '3D' as a standalone symbol, and the routine works as advertised. ___
Not quickly. The original author may have written most of the code before the advent of a "true" ellipse. It does work, though, with ellipses that are approximated by polylines (i.e., generated with PELLIPSE = 1). ____
Hello, I thank everyone - Jimmy Bergmark, Dan Allen and all other who contributed in this thread with their inputs. With some editing as indicated by the posts, I was able to get the routine to work. Regards Rakesh -- 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>
Now I saw this thread. If you have or want any improvements you want added please tell. The latest version is always found here: http://www.jtbworld.com/lisp/hatchb.htm -- Best Regards, Jimmy B CAD and Database Developer Manager at www.pharmadule-emtunga.com Take a look at the trial version of SmartPurger (now for AutoCAD 2004) or download some freeware at www.jtbworld.com More on AutoCAD 2004; www.jtbworld.com/autocad2004.htm www.jtbworld.com/autocad2004tips.htm
Ellipses should work. -- Best Regards, Jimmy B CAD and Database Developer Manager at www.pharmadule-emtunga.com Take a look at the trial version of SmartPurger (now for AutoCAD 2004) or download some freeware at www.jtbworld.com More on AutoCAD 2004; www.jtbworld.com/autocad2004.htm www.jtbworld.com/autocad2004tips.htm
On my tests the open splines has been restored as closed splines. I don't know if it's even possible to reverse engineer and restore a open spline. I don't remember. -- Best Regards, Jimmy B CAD and Database Developer Manager at www.pharmadule-emtunga.com Take a look at the trial version of SmartPurger (now for AutoCAD 2004) or download some freeware at www.jtbworld.com More on AutoCAD 2004; www.jtbworld.com/autocad2004.htm www.jtbworld.com/autocad2004tips.htm