View Full Version : counting/autoupdating
CADtech
29th Nov 2004, 04:12 pm
I was wondering if there was a tool in autocad that will count how many of a certain block, or anything for that matter, that are in your drawing. Also i was wondering if there was an option or a way to use fields or OLE to update a table, or a schedule automatically when certain blocks are inserted, say i had to count electrical outlets, and i have a table either in another drawing or in the same drawing and it has the type of outlet and then the total number of outlets and when i instert a block to add another outlet to the total updates each time a new block is added.. is this possible, is this a feature of autocad 2005, or can it be coded in LISP or VBA?
Well I have a lighting schedule on one page, and it is now in table format, and theres several fixtures on it. in teh first column is the actual block so you know what it looks like then various descriptions of the light properties and manufacturers etc, then at the end theres a total. As of right now i am printing out, then highlighting and counting by hand all the fixtures, this is very time consuming and is error pron.
Idealy i would like to make it so when i drop in a light then its total number rises so the count is automatically done, or if refinements are needed and someoen takes a light out then it subtracts. There are a few problems with this but they're ones ill have to deal with when i cross that bridge right now i just want to have an automatic count of fixtures. Each fixture will have a different block name and if need be layer.
thanks for anyhelp.
Fantomas
29th Nov 2004, 05:01 pm
This simple program quickly counts the same blocks.
(defun c:bcoun (/ curEnt dxfList blName Count)
(if
(setq curEnt(entsel "\n*** Select sample block "))
(progn
(setq dxfList(entget(car curEnt)))
(terpri)
(if(= "INSERT"(cdr(assoc 0 dxfList)))
(progn
(setq blName(cdr(assoc 2 dxfList))
Count(sslength(ssget "_X"
(list(assoc 2 dxfList))))
); end setq
(princ(strcat "\n*** Block name: " blName
"\n*** Blocks in drawing: "(itoa Count)))
);end progn
(princ "\n*** This don't block!\n ")
); end if
); end progn
(princ "\n*** Nothing selected!\n ")
); end if
(princ)
); end bstat
I also have written the program which appropriates to blocks parameters: Part *, Model, Manufacturer, Price, etc. counts them in the drawing and exports the data in Excel. But the interface while only in Russian.
If you want insert into blocks invisible Attributes can to use this simple code:
(defun c:inatt (/ tagList operMode block)
(setq tagList(list "Manufacturer:" "Model:" "Part. N:")) ; MODIFY THIS LIST FOR OWN TAGS
(initget "I D")
(setq operMode
(getkword "\nInsert or [Delete] attributes in block [I]: "))
(if(null operMode)(setq operMode "I"))
(setq block(car(entsel "\nSelect block to insert/delete attributes ")))
(InsertIvisAtt tagList operMode block)
(princ)
); end inatt
;************************************************* *******
(defun InsertIvisAtt (dataList operMode block / actDoc refSet
blockCol layerCol refList layerState
ssgetList refList curBlock)
(vl-load-com)
(defun attInsert (dataList block / tagList curAtt)
(setq tagList '())
(vlax-for entity block
(if
(= "AcDbAttributeDefinition"
(vla-get-ObjectName entity))
(setq tagList(append tagList
(list(vla-get-TagString entity))))
); end if
); end vlax-for
(foreach tag dataList
(if
(not
(member tag tagList))
(progn
(setq curAtt(vla-addAttribute block
0.001
acAttributeModePreset
""
(vlax-3D-point '(0.0 0.0 0.0))
tag
""
); end vla-addAttribute
); end setq
(vla-put-Layer curAtt "0")
(vla-put-Invisible curAtt :vlax-true)
);end progn
); end if
); end foreach
(princ)
); end attInsert
(defun refReinsert (blockRef / activeDoc modelSpace layerCol
insPoint layer lineType linetypScale lineWeight
name normal ownerId rotation trColor visible
XScale YScale ZScale vlaLayer newRef )
(setq activeDoc(vla-get-ActiveDocument
(vlax-get-acad-object))
layerCol(vla-get-Layers activeDoc)
insPoint(vla-get-InsertionPoint blockRef)
layer(vla-get-Layer blockRef)
lineType(vla-get-LineType blockRef)
linetypScale(vla-get-LinetypeScale blockRef)
lineWeight(vla-get-LineWeight blockRef)
name(vla-get-Name blockRef)
normal(vla-get-Normal blockRef)
ownerId(vla-get-OwnerID blockRef)
rotation(vla-get-Rotation blockRef)
visible(vla-get-Visible blockRef)
XScale(vla-get-XScaleFactor blockRef)
YScale(vla-get-YScaleFactor blockRef)
ZScale(vla-get-ZScaleFactor blockRef)
vlaLayer(vla-item layerCol layer)
); end setq
(vla-delete blockRef)
(setq newRef
(vla-InsertBlock (vla-objectidtoobject activeDoc ownerId) insPoint name
XScale YScale ZScale rotation))
(vla-put-Layer newRef layer)
(vla-put-LineType newRef lineType)
(vla-put-LinetypeScale newRef linetypScale)
(vla-put-LineWeight newRef lineWeight)
(vla-put-Normal newRef normal)
(vla-put-Visible newRef visible)
(princ)
);end of refReisert
(setq actDoc(vla-get-ActiveDocument
(vlax-get-acad-object))
blockCol(vla-get-Blocks actDoc)
layerCol(vla-get-Layers actDoc)
layerState '()
); end setq
(if
(and
block
(=(cdr(assoc 0(entget block))) "INSERT")
); end and
(progn
(setq ssgetList(list '(0 . "INSERT")(assoc 2(entget block)))
refSet(ssget "_X" ssgetList)
refList
(mapcar 'vlax-ename->vla-object
(vl-remove-if 'listp
(mapcar 'cadr(ssnamex refSet))))
curBlock(vla-item blockCol
(cdr(assoc 2(entget block))))
); end setq
(vlax-for l LayerCol
(setq layerState
(append layerState
(list
(list
l
(vla-get-Lock l)))))
(vla-put-lock l :vlax-false)
); end vlax-for
(if(= "I" operMode)
(progn
(foreach ref refList
(attInsert dataList curBlock)
(refReinsert ref)
); end foreach
(princ "\nAttributes was inserted ")
);end progn
(progn
(foreach ref refList
(vlax-for ent curBlock
(if
(and
(= "AcDbAttributeDefinition"(vla-get-ObjectName ent))
(member(vla-get-TagString ent) dataList)
); end end
(vla-delete ent)
); end if
); end vlax-for
(refReinsert ref)
); end foreach
(princ "\nAttributes was deleted ")
); end progn
); end if
(foreach l layerState
(vla-put-Lock (car l)(cadr l))
); end foreach
);progn
(princ "/nNotning block selected!")
); end if
(princ)
); end of InsertIvisAtt
For quick outlet block copy with rotation may use this:
(defun c:blcopy (/ oldEcho tarBlock dxfList *error*)
(defun *error* (msg)
(setvar "cmdecho" oldEcho)
); end of *error*
(setq oldEcho(getvar "cmdecho"))
(setvar "cmdecho" 0)
(if
(and
(setq tarBlock(car(entsel "\nSelect block to Copy and Rotate ")))
(=(cdr(assoc 0(setq dxfList(entget tarBlock))))"INSERT")
); end and
(progn
(while t
(princ "\nSpecify insertion and rotation point")
(command "-insert" (cdr(assoc 2 dxfList))
"_x"(cdr(assoc 41 dxfList))
"_y"(cdr(assoc 42 dxfList))
"_z"(cdr(assoc 43 dxfList))
pause
pause
); end command
(princ "\n*** Insert next block or press Esc to Quit *** ")
); end while
); end progn
(princ "\nNothing block selected!")
); end if
(setvar "cmdecho" oldEcho)
(princ)
); end of c:blcopy
Need more?
CADTutor
29th Nov 2004, 11:12 pm
Outstanding response Fantom! Thanks very much for that. I'm sure CADtech (and others) will find that very useful.
You get the 5 star award this week :D
:star: :star: :star: :star: :star:
Fantomas
30th Nov 2004, 08:57 am
>CADTutor
Thank You :)
CADtech
30th Nov 2004, 10:17 pm
cool thanks for the extensive reply, does this first code count nested blocks? blocks within blocks..
thanks a lot
complex :?
CADtech
8th Dec 2004, 03:16 am
Hey how about just a lisp that will count blocks inside a block say for instance i have a light with 4 spot lights and each can is a block named spot, then i add a track and some text and then make them all into one block i want to be able to count those blcoks named spot... im not sure if fantoms lisp has that ablility its a little advanced for me to pick it out if its hiding in there.
Fantomas
8th Dec 2004, 11:41 am
You need to count blocks inside blocks? It is possible. Tonight or tomorrow I shall find time to write such program.
Fantomas
9th Dec 2004, 12:53 am
>CADtech
Excuse, I have been keen on export in Excel and have written the program of counting of blocks with export in Excel. For the counts of the blocks inside blocks I shall write later. Try this, only see at O/S, AutoCAD and MS Excel requrements in routine text.
USAGE
Command: blc
*** Specify selection set for block counting ***
Select objects: Specify opposite corner: 2055 found
Select objects:
********** BLOCK COUNTING REPORT ************
seccad_fdet_num 611
f_asmieol 22
SECCAD_FIRE_SIREN 94
SECCAD_FIRE_OUTMODULE 26
SECCAD_FIRE_ISOLATOR 52
SECCAD_FIRE_DETECTOR 473
SECCAD_FIRE_CALLPOINT 22
Explication_Label 755
************* END OF REPORT *****************
*** Save report to MS Excel file? [Y/N] <N>: y
*** The file was successfully saved in: D:\Documents and Settings\Alexander\My Documents\A22_Plans.xls
(princ "\nType BLC to run.")
(defun c:blc(/ blSet blList nameList listLen outList exFlag oldExFlag
exPath exApp exWorkbook exFileexSheets exSheet curId
newFile curCell curVal)
;;;+++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++
;;; +
;;; This program counts blocks, gives out the reporting, +
;;; and also can export the data to MS Excel. +
;;; +
;;; Type BLC in command line to run. +
;;; +
;;; Supported O/S: Windows 2000/XP +
;;; Suppported MS Excel Versions: MS Office 97/2003 +
;;; Supported AutoCAD Versions: AutoCAD 2000/2005 +
;;; +
;;; Writen by Fantom (Alexander Smirnov) asmirnov@inbox.lv +
;;; +
;;; Version 1.0 Dec 09, 2004 +
;;; +
;;; Be happy. And excuse me for poor my English... +
;;; +
;;;+++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++
(vl-load-com)
(princ "\n*** Specify selection set for block counting ***")
(if(setq blSet(ssget '((0 . "INSERT"))))
(progn
(setq blList(mapcar 'vlax-ename->vla-object
(vl-remove-if 'listp
(mapcar 'cadr(ssnamex blSet))))
nameList(vl-sort (mapcar'(lambda(X)(vla-get-Name x)) blList) '<)
listLen(length nameList)
); end setq
(while nameList
(setq outList (cons(cons(car nameList)
(- listLen(setq listLen(length (setq nameList
(vl-remove(car nameList) nameList))))))outList)
); end setq
) ; end while
(princ "\n********** BLOCK COUNTING REPORT ************\n ")
(foreach item outList
(princ(strcat "\n" (car item)" "(itoa(cdr item))))
); end foreach
(princ "\n \n************* END OF REPORT *****************")
(textscr)
(if(not exFlag)(setq exFlag "N"))
(setq oldExFlag exFlag)
(initget "Y N")
(setq exFlag
(getkword
(strcat "\n\n*** Save report to MS Excel file? [Y/N] <"exFlag">: ")))
(if(null exFlag)(setq exFlag oldExFlag))
(if(= exFlag "Y")
(progn
(if (setq exPath(getfiled "Save Text File As"
(strcat (getvar "dwgprefix")(substr (getvar "dwgname") 1
(- (strlen (getvar "dwgname")) 4)) ".xls")"xls" 33); end getfiled
); end setq
(progn
(setq exApp(vlax-create-object "Excel.Application"))
(if(null exApp)
(progn
(alert "Error. Can't start MS Excel.")
(quit)
); end progn
); end if
(setq exWorkbook
(vlax-get-property exApp "Workbooks")
exFile
(vlax-invoke-method exWorkbook "Add")
exSheets
(vlax-get-property exFile "Worksheets")
exSheet
(vlax-get-property exSheets "Item" "Sheet1")
curRow 2
); end setq
(repeat(length outList)
(setq curId(strcat "B"(itoa curRow))
curCell(vlax-variant-value
(vlax-invoke-method exSheet "Evaluate" curId))
curVal(car(nth(- curRow 2) outList))
); end setq
(vlax-put-property curCell "Formula" curVal)
(vlax-release-object curCell)
(setq curId(strcat "C"(itoa curRow))
curCell(vlax-variant-value
(vlax-invoke-method exSheet "Evaluate" curId))
curVal(itoa(cdr(nth(- curRow 2) outList)))
); end setq
(vlax-put-property curCell "Formula" curVal)
(vlax-release-object curCell)
(setq curRow(1+ curRow))
); end repeat
(vlax-invoke-method exFile "SaveAs" exPath nil nil nil nil nil nil)
(vlax-invoke-method exFile "Close" nil)
(vlax-invoke-method exApp "Quit")
(mapcar(function(lambda(x)
(if
(and x(not(vlax-object-released-p x)))
(vlax-release-object x)
)
))
(list curCell exSheet exSheets exFile exWorkbook exApp)
)
(setq curCell nil
exSheet nil
exSheets nil
exFile nil
exWorkbook nil
exApp nil); end setq
(gc)
(princ(strcat"\n*** The file was successfully saved in: " exPath))
); end progn
(princ "\n*** Excel file was not created! *** ")
); end if
); end progn
); end if
); end progn
(princ "\n*** Nothing blocks selected! ***")
); end if
(princ)
); end of BLC
CADtech
9th Dec 2004, 04:34 pm
AWESOME! getting closer and closer to achieving what i neeed, this is truly awesome, fantom you are da man.Thanks so much. :shock:
Fantomas
10th Dec 2004, 03:06 pm
Hi! I have written the program which counts quantity of blocks and blocks nested on one level. On mine that that is necessary for you. It is simple to make so that she counted all nested blocks, but whether it is necessary?
(defun c:nescoun(/ sSel samDxf blName blSet blQnt
vlaBl inList listLen outList)
;;;+++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++
;;; +
;;; This program counts quantity of blocks and blocks +
;;; nested on one level. +
;;; +
;;; Type NESCOUN in command line to run. +
;;; +
;;; Supported AutoCAD Versions: AutoCAD 2000/2005 +
;;; +
;;; Writen by Fantomas (Alexander Smirnov) asmirnov@inbox.lv +
;;; +
;;; Version 1.0 Dec 10, 2004 +
;;; +
;;;+++++++++++++++++++++++++++++++++++++++++++++++ +++++++++++++++++++++
(vl-load-com)
(if
(and
(setq sSel(car(entsel "\n*** Select block *** \n")))
(setq samDxf(entget sSel))
(=(cdr(assoc 0 samDxf))"INSERT")
); end and
(progn
(setq blName(cdr(assoc 2 samDxf))
blSet(ssget "_X" (list(assoc 0 samDxf)(assoc 2 samDxf)))
blQnt(sslength blSet)
vlaBl(vla-item(vla-get-Blocks
(vla-get-ActiveDocument
(vlax-get-acad-object)))blName)
inList '()
); end setq
(vlax-for ent vlaBl
(if(= "AcDbBlockReference"(vla-get-ObjectName ent))
(setq inList(append inList(list ent)))
); end if
); end vlax for
(if inList
(progn
(setq inList(vl-sort(mapcar'(lambda(x)(vla-get-Name x))inList)'<)
listLen(length inList)
); end setq
(while inList
(setq outList (cons(cons(car inList)
(- listLen(setq listLen(length (setq inList
(vl-remove(car inList) inList))))))outList)
outList(reverse outList)
); end setq
) ; end while
); end progn
); end if
(princ "\n************* REPORT **************")
(princ(strcat "\n\nTarget block name: " blName))
(princ "\n\n++++ ONE LEVEL NESTED BLOCKS +++++\n")
(if outList
(progn
(foreach itm outList
(princ(strcat "\n" (car itm)" "(itoa(cdr itm))))
); end foreach
); end progn
(princ "\nNone")
); end if
(princ "\n\n++++++++ TOTAL STATISTIC ++++++++++\n")
(princ(strcat "\n" blName " " (itoa blQnt)))
(princ "\n___________________________________\n")
(foreach itm outList
(princ(strcat "\n" (car itm)" "(itoa(* blQnt(cdr itm)))))
); end foreach
(princ "\n\n********** END OF REPORT **********")
(textscr)
); end progn
(princ "\n*** It isn't block! *** ")
); end if
(princ)
); end of incount
(princ "Type NESCOUN to run.")
I at all not awersome http://dwg.ru/foto/?id=32
CADtech
10th Dec 2004, 04:15 pm
Well the reason it is necessary, is because we have to modify some blocks and we have to explode those so bcount and your other program only counts the main blocks and you dont come anywhere near an accurate count becaus eit doesnt count half of those blocks, this newest one is great it is so close to what i need it to accomplish. Unfortuneatly it only counts the nested blocks rather then reading all of the blocks but this is definately the closest ive come so far to my goal and all of your help has been amazing, ill be able to learn a lot once i can get back into looking at coding and looking over what youe compiled.
How i tested your code.. i made an 8 foot 2 inch polyline, then i made one 5" radious circle, made a block out of the circle then i copied the circle 4 more times evenly across the polyline then i made the polyline with the 5 circle blocks ( i called the circle blocks FLOOD) into a block called "8 FOOT 5 CANS" and then i copied the full block 5 times and exploded one of them one time so as to keep the FLOOD blocks intack then i ran your code and it counted 20 nested FLOOD blocks which is great because thats what it was ment to do and what i was looking for, but it didnt count the 5 from the 8 FOOT 5 CANS that i exploded.
man i must be bugging you i appologize.
It would be perfect if the lisp before this one incorporated this new nested count but instead of just counting nested items counted it incorporated the none nested adding them to gether or something... also is there a way to specify which blocks to look for, we have a list of specific blocks that need counting and there are a lot of other blocks that dont, but that last part isnt important if its going to take to much time. I hate to be a ****** and again thank you for your time. You have been the most helpful of anyone that ive talked to thank you so very much,
i just encountered another problem, it only counts the nested blocks in one block type.... is there a way around it .. say i had the 8 FOOT 5 CANS block and a different block called 6 FOOT 3 CANS, it would only count 5 FLOOD blocks if i selected the 8 FOOT 5 CANS block instead of 8. is htere an easy fix ... man im sorry for bugging you i hope your not taking up to much time, again i want to thank you.
So how long have you been coding? You seem to cook up these thing really fast. Its probably simpler then i think it is. Do you code just for autocad or do know code using other programs?
Fantomas
12th Dec 2004, 09:50 pm
Greetings. I understand that the filter is necessary for normal work of such program taking into account set of options, such as names of blocks, layers in which should be counted them, a level of nesting, etc. I have decided to write such program with a dialogue window. During a week I shall show this a picture with this dialogue window and I want to consult to you concerning options. The spelling of the program will borrow some time.
While I program only on AutoLISP also do it approximately one and a half year. This my hobby. To learn to write programs it is necessary to write them simply! For a spelling of programs which you see it is necessary approximately from half o'clock till one and a half o'clock. For a hobby it not so is a lot of time :wink:
I studied to program at Russian forums, there very well learn beginners. Till now I am beginner... :unsure:
CADtech
12th Dec 2004, 11:01 pm
Well your pretty good for a beginner :D
Fantomas
13th Dec 2004, 09:18 am
About that that I beginning am a joke :D. However up to a rank of the Master me it is still far...
CADtech
13th Dec 2004, 02:04 pm
Hopefully i'll be able to get this stuff straight as soon as i have time to study and practice it...time is hard to find sometimes.
Fantomas
15th Dec 2004, 02:58 pm
>CadTech and others
I started to write the program for calculation of quantity of blocks. Its this dialogue window. To you its maintenance is clear? Universality has a back is a complexity. This dialogue window will help, to choose the nested and usual blocks in the certain layers, areas of the drawing, to specify the necessary blocks, etc. The Final choice will be seen in the list with a yellow background. Results of the account on bookmark Statistic and Export. What will you tell in this occasion?
http://www.cadimage.net/postimages/advbc.jpg
CADTutor
15th Dec 2004, 03:46 pm
Fantomas, I must admit that I haven't really been following this topic but it looks as though you have adopted this as a bit of a hobby :lol:
The dialogue box looks good and clear. To summarise, I assume that the coumn on the left allows the user to select/filter blocks either by layer or by selection set. In the Layer section, the column on the left shows all layers in the drawing and the column on the right shows selected layers. I like that method because it is similar to other selection methods in AutoCAD (like assigning materials to layers). It's good to have a consistent "visual syntax".
The right hand column then allows the user to do a secondary filter? Specific block names can be selected from those selected in the first filter?
Not sure what the "Select on screen" buttons do. If they allow the user to select objects by picking them, then the button should have the ">>" suffix to indicate that or (to be right up-to-date) the Select objects button used in AutoCAD dialogue boxes such as the Array command.
Generally, the layout is excellent - very clear and logical.
Excellent work :thumbsup:
Fantomas
15th Dec 2004, 04:27 pm
Yes I perceive it as a hobby, but it helps in work.
About filters you are right, all that you see it filters. Filter 'Layers' limits quantity of layers. 'Show only with preffix'-allows to display only layers with a specific prefix in the name. Switch 'Model Space/Paper Space/Both' defines space of drawing to counting. 'Create area (s) on screen' - allows will choose on the screen of area in which calculation is made. 'Higlight selected by filter' - allows to close temporarily dialogue and to illuminate the blocks chosen filters. Switch 'Main only/Nested Only/Both' - defines type of blocks which is displayed in list Selected by Filter. Buttons ' Main blocks' and ' Nested blocks' allow to choose the necessary blocks on the screen. In the right column it is possible to choose the Final list from list 'Selected by filter'. Uff...
But that that is not pleasant to me. :( I shall think still...
CADtech
16th Dec 2004, 12:04 am
Wow, Youve put more into this than i thought anyone would and i appriciate it to no end. I was just thinking of a simple selection box that counted all blocks that i specify before hand, like in the lisp routine make a list of specific block and then when you make your selection box it pops up with a list like BCOUNT does but only with the blcoks i had specified but also counting the nested blocks for the track lighting of course. But man i never thought it would get an interface and so many options... well i think your doing an awesome job and you have provided me wiht more help then you really needed to but man is it sure gonna help me out cant wait to see how the finished product will work. great job
CADtech
22nd Dec 2004, 09:33 pm
hows the progress?
Fantomas
22nd Dec 2004, 10:54 pm
Gradually I write. The interface of the program has strongly changed, I can already show a picture of in part working program tomorrow. Unfortunately there is no so much time as it would be desirable. In comparison with the previous variant with export in Excel for a code of such program approximately at 20-30 times more long, therefore it is necessary to wait. 8) When all will be ready, I shall send you the program for testing. Don't worry, you will receive it. :)
CADtech
22nd Dec 2004, 11:47 pm
oh not worrying just checking up is all.
Fantomas
24th Dec 2004, 11:22 am
>CADTech
I promised to send a picture of the interface. So it will iron at present and already in part works.
http://www.cadimage.net/postimages/adbc1.JPG
http://www.cadimage.net/postimages/adbc2.JPG
MARRY CRISTMAS!!!
CADtech
27th Dec 2004, 06:34 pm
wow you sure have been busy. Looks good.. whats the layer option for?
Fantomas
27th Dec 2004, 08:11 pm
>CADTech
whats the layer option for?
That it was possible to count blocks on the selected layers only. If it is necessary to count blocks on all layers it is necessary to press simply the button '>> '.
CADtech
28th Dec 2004, 01:48 pm
nice
CADtech
14th Jan 2005, 03:37 pm
hey fantomas just checking up to see how things are going. I want to keep in touch otherwisae ill forget to visit .. hows everything going?
Fantomas
15th Jan 2005, 07:55 pm
I am sorry. I long time was on business trip in the other city and can't to program. Next week I shall try to finish all.
CADtech
18th Jan 2005, 06:10 pm
cool man, no big rush.. just seeing how it was going. hows the weather where you are?
hyposmurf
18th Jan 2005, 11:17 pm
and where did you go on a long buisness trip?
Arizona
26th Jan 2005, 08:30 pm
and what do the words in your Avatar say?? :)
CADtech
10th Feb 2005, 04:16 pm
Man he must be buisy
2hot
19th Feb 2005, 11:39 pm
Gee Fantomas,
Will your counting program be available for downloads? I am very very interested in a copy. I was hoping to develop a routine that maintains a doors and windows schedule sometime in the near future(to a certain graphical taste), your source code will be helpful. What do you say?
Urbino
13th Apr 2006, 12:17 pm
I am sorry. I long time was on business trip in the other city and can't to program. Next week I shall try to finish all.
LOL....when i find something that i like....desapears...LOL.....where are you???
Joltremari
18th Jul 2006, 09:11 pm
Fantomas, can this be modified so that after you select the block it only counts the ones that have a specific value in a certain attribute?
Such as: If I have a block with the name Flange6, but each Flange6 block has an attribute that says if it is left or right, then after I choose the Flange6 block it would allow me to choose Left or Right and only count the ones that have that value in the LR attribute.
This simple program quickly counts the same blocks.
(defun c:bcoun (/ curEnt dxfList blName Count)
(if
(setq curEnt(entsel "\n*** Select sample block "))
(progn
(setq dxfList(entget(car curEnt)))
(terpri)
(if(= "INSERT"(cdr(assoc 0 dxfList)))
(progn
(setq blName(cdr(assoc 2 dxfList))
Count(sslength(ssget "_X"
(list(assoc 2 dxfList))))
); end setq
(princ(strcat "\n*** Block name: " blName
"\n*** Blocks in drawing: "(itoa Count)))
);end progn
(princ "\n*** This don't block!\n ")
); end if
); end progn
(princ "\n*** Nothing selected!\n ")
); end if
(princ)
); end bstat
Vj
19th Jul 2006, 07:04 am
This one had me salivating, page one was great, it got 5 stars and page two has all the great dialogue boxes...., but alas it was too good to be true!
Hey Fantomas, hope you are still around and you did get to finish your code...
There are scores of people just waiting for a thing like this..
Cheers,
Vj
filan1a
15th May 2008, 03:56 pm
WHERE IS THAT CODE
CAN YOU UPLOAD IT HERE?
>CadTech and others
I started to write the program for calculation of quantity of blocks. Its this dialogue window. To you its maintenance is clear? Universality has a back is a complexity. This dialogue window will help, to choose the nested and usual blocks in the certain layers, areas of the drawing, to specify the necessary blocks, etc. The Final choice will be seen in the list with a yellow background. Results of the account on bookmark Statistic and Export. What will you tell in this occasion?
http://www.cadimage.net/postimages/advbc.jpg
Powered by vBulletin™ Version 4.1.2 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.