View Full Version : Block Count Table
Ozymandias
28th Nov 2007, 02:30 pm
I currently have a Lisp that counts up the blocks that I select within a selected area. The data is displayd in the command box.
What I would like to do is add onto the end of the lisp some more coding that will enable it to automatically produce a table with the data where ever I want.. any suggestions where to look?
Thanks
Alan Cullen
28th Nov 2007, 03:00 pm
Big, Big, change in routine. Can be done, but not easily.
Ozymandias
28th Nov 2007, 03:02 pm
I had a feeling that you would say that... hangs head.. I think its time I invested in a LISP course.. hmm wonders if there are any in my area.
lpseifert
28th Nov 2007, 03:16 pm
Could you use Eattext instead of a lisp routine?
Ozymandias
28th Nov 2007, 03:20 pm
I dont know about eat text.. ive heard of it but dont know how it works or what it does
lpseifert
28th Nov 2007, 03:33 pm
ExtendedATTributeEXTract... its a command with a wizard that will extract block information and put it in a table, including number of blocks. I don't know if it will work with a selection of blocks though. Try it, it's easy to use.
Ozymandias
29th Nov 2007, 10:45 am
thanks for all the help so far guys.. this forum is full of amazing info..
SLW210
29th Nov 2007, 04:21 pm
What are you using to count the blocks? Can you send the info to Excel and then to the table?
Ozymandias
30th Nov 2007, 11:41 am
Im using a lisp that I found on here.
Im pretty new to lisps and macros as I have always just used what CAD gave me.. now im exploring the possibilities (and realising how vast cad is) I dont know what Code would be needed to edit the lisp below to export the given data into an xcel file or then import that into CAD
SLW210
30th Nov 2007, 03:06 pm
Give this one a try. It gives the option of writing to a file. It will have a .blk extention, which will open with notepad.
Ozymandias
30th Nov 2007, 03:16 pm
that doesnt seem to work says openF not defined.
SLW210
30th Nov 2007, 03:19 pm
The LISP didn't work? Let me have a look.
SLW210
30th Nov 2007, 03:45 pm
Works fine for me. Try reloading it.
lpseifert
30th Nov 2007, 04:02 pm
SLW210 - do you have the function OPENF defined in your acaddoc.lsp or in a startup application maybe?
Ozymandias
30th Nov 2007, 04:04 pm
Im assuming I dont as thats it tells me its not
SLW210
30th Nov 2007, 04:16 pm
Sorry, I found it. Put this in your acaddoc.lsp (not the acad"version #"doc.lsp), if you do not have one already, open notepad and insert the following code and save as acaddoc.lsp.
(defun OpenF (N M / P) ; Receives file name N and mode M (P is local)
(if ; If the file can be opened in mode M then
(setq P (open N M)) ; add pointer P to the global list ERR_FILE-#S
(setq ERR_FILE-#S (cons P ERR_FILE-#S))
) ; Returns the result of Open regardless
P ; Will be nil only if Open was unsuccessful
) ; Close DeFun
Ozymandias
30th Nov 2007, 04:20 pm
I dont suppose you have the same for Close F do you ??
Thanks for all the help its really appreciated,
SLW210
30th Nov 2007, 04:24 pm
I dont suppose you have the same for Close F do you ??
Thanks for all the help its really appreciated,
You just want it all today. :D Sorry I have a lot of work to get done, didn't bother checking it all out. Sorry once again for your trouble.
(defun CloseF (File_pointer) ; Receives pointer of file to be closed
(setq ERR_FILE-#S (Remove File_pointer ERR_FILE-#S))
(close File_pointer) ; Removes file pointer from error list for files
) ; Close DeFun (normally returns nil)
Ozymandias
3rd Dec 2007, 11:20 am
DUDE you rawk!
Seriously thanks for all the help .
SLW210
3rd Dec 2007, 03:21 pm
Did that take care of what you needed? You are welcome. http://img126.exs.cx/img126/997/36_1_11.gif
Powered by vBulletin™ Version 4.1.2 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.