| Author |
Message |
TRJ
Guest
|
Posted:
Wed Mar 09, 2005 8:37 pm Post subject:
Re: Need to check if blocks exist in drawing. |
|
|
No your point is well taken and educational. It will benefit someone.
"Joe Burke" <joburke@hawaii.rr.com> wrote in message
news:422f1540$1_3@newsprd01...
| Quote: | I don't know whether case is an issue since I haven't studied the thread
in detail.
But I see your point, so forget what I said.
Joe Burke
"TRJ" <a0h9rjone@cfl.rr.com> wrote in message
news:422f06a1$1_3@newsprd01...
Given. However I do not see where the OP is calling tblsearch in his
code.
Did I overlook it? Is case sensitivity possibly why the OP is not
finding
his blocks?
|
|
|
| Back to top |
|
 |
TRJ
Guest
|
Posted:
Wed Mar 09, 2005 8:38 pm Post subject:
Re: Need to check if blocks exist in drawing. |
|
|
You could use the BCOUNT command if all you want to do is count blocks.
"MiD-AwE" <nospam@address.withheld> wrote in message
news:97931.1110379603795.JavaMail.jive@jiveforum2.autodesk.com...
| Quote: | Sweet,
Much better than what I had. My main goal was not to count the number of
times the block was found though that is a very useful function, but I |
needed to check if the block exists in the drawing and this rewrite is
excellent for that. I need to develop this into a full featured checker for
our work. For about 75% of our drawings there will only be 1 of each of
these items in our drawings (swimming pools are considerably different from
standard architecture). So, checking for the existence of said blocks will
suffice but on our commercial division counting blocks is essential.
| Quote: |
I have made a simple modification of the code to serve both purposes
(posted below). Basically, I only added the alert for items not found at |
all). I'd like to do other functions as well as alert the user if the block
is not found at all.
| Quote: |
Thanks again to everyone and especially BillZ who seems to always surprise
me with near wizardry of LISP :)
| Code: | (defun c:CHDWG (/ BlkNams blknam)
(setq BlkNams (list "NSKIM" "LIGHT" "MDXDRAIN" "HLFDRAIN" "DPTHCALL"
"NAWL")
)
;---;
(foreach n BlkNams
(cond ((= n "NSKIM")
(setq blknam "skimmer")
)
((= n "LIGHT")
(setq blknam "light")
)
((= n "MDXDRAIN")
(setq blknam "main drain")
)
((= n "HLFDRAIN")
(setq blknam "secondary main drain or MDX vent")
)
((= n "DPTHCALL")
(setq blknam "depth markers")
)
((= n "DPTHCALL")
(setq blknam "automatic water leveler")
)
)
(if (setq ss (ssget "X" (list (cons 0 "INSERT")(cons 2 n))))
(princ (strcat "\n " blknam " found < " (itoa (sslength ss)) "
time(s)."))
(ALERT (strcat "\nNo " blknam " found in drawing!"))
Need to do other stuff here. Is it as easy as that?
)
)
;---;
(princ)
) |
|
|
|
| Back to top |
|
 |
MiD-AwE
Guest
|
Posted:
Wed Mar 09, 2005 9:24 pm Post subject:
Re: Need to check if blocks exist in drawing. |
|
|
Thanks again :)
|
|
| Back to top |
|
 |
MiD-AwE
Guest
|
Posted:
Mon Apr 04, 2005 7:29 pm Post subject:
Re: Need to check if blocks exist in drawing. |
|
|
In this method of block checking, how can I excuse a missing block if another is found instead. For instance, how can I ignore the fact that "NSKIM" is missing from the drawing so long as "MDXDRAIN" exists in the drawing?
Thank you. |
|
| Back to top |
|
 |
|
|
|
|