Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 10/28/2023 in all areas

  1. Had another play, no code if you squash your shapes so gap is saw cut thickness you can save a lot of sheets. The cost of a drafts person v's sheets not sure in this case as so many needed. I also aligned a copy of a group of sheets. Then used rectangular array. For squashed answer maybe move sheets down a bit as top sheets are 8mm wide cut out. There is a new post that creates a boundary around objects so using that can work out a mega sheet that is an array of sheets as the sheet size to use in the nesting process. I have a make array around an object. I created the 2nd image using some smart move functions.
    1 point
  2. : (setq lst1 '(("H608" 32) ("H609" 32) ("H610" 32) ("H611" 32) ("H612" 32) ("H613" 32) ("H614" 32))) (("H608" 32) ("H609" 32) ("H610" 32) ("H611" 32) ("H612" 32) ("H613" 32) ("H614" 32)) : (setq lst2 '(("H608" 30) ("H609" 24) ("H610" 21) ("H612" 20) ("H613" 25) ("H614" 22))) (("H608" 30) ("H609" 24) ("H610" 21) ("H612" 20) ("H613" 25) ("H614" 22)) : (setq pre (reverse (vl-member-if '(lambda ( x ) (= (car x) "H610")) (reverse lst2)))) (("H608" 30) ("H609" 24) ("H610" 21)) : (setq suf (vl-member-if '(lambda ( x ) (= (car x) "H612")) lst2)) (("H612" 20) ("H613" 25) ("H614" 22)) : (setq lst2 (append pre (list (list "H611" 0)) suf)) (("H608" 30) ("H609" 24) ("H610" 21) ("H611" 0) ("H612" 20) ("H613" 25) ("H614" 22)) : (mapcar '(lambda ( a b ) (if (= (car a) (car b)) (list (car a) (cadr b) (cadr a)))) lst1 lst2) (("H608" 30 32) ("H609" 24 32) ("H610" 21 32) ("H611" 0 32) ("H612" 20 32) ("H613" 25 32) ("H614" 22 32))
    1 point
  3. So this is quite a basic counter: It will ask you to select an object in the group and then select the drawing area. The first selection sets the search criteria (ssget with a filter) - here searching for anything of the same entity type, on the same layer with the same colour (can add more filters later if needed). So if you select a circle on layer "PDF_Waste_Pipe" with a colour ByLayer it will return how many of these it finds... even if there are 2 or more in that group. Obviously it will work the best if your legend / blocks are on a unique layer - which in your sample they look like they are - and you pick an entity that only exists once in each group like a circle or rectangle. However looking quickly at your drawing I think this might cover what you are doing I think. I'll have a think to see if there is a more elegant way, I suspect that there is using the ssget function, crossing polylines and removing items from selection sets (defun c:sel ( / MyEnt EntLay EntType EntCol EntClosed MySS) (setq MyEnt (car (entsel "Select an Entity to count: "))) (if MyEnt (progn (princ "Thanks. Now select the drawing area to count") (setq EntLay (assoc 8 (entget MyEnt))) (setq EntType (assoc 0 (entget MyEnt))) (setq EntClosed (assoc 70 (entget MyEnt))) (setq EntCol (assoc 62 (entget MyEnt))) (setq SSList (list EntType EntLay )) (if (= EntClosed nil) () (setq SSList (cons EntClosed SSList ))) (if (= EntCol nil) (setq SSList (cons (cons 62 256) SSList ))) ; colour by layer (setq MySS (ssget SSList )) ) ; end progn (princ "Nothing selected") ) ; end if (princ (sslength MySS))(princ " blocks found") (princ) )
    1 point
×
×
  • Create New...