Leaderboard
Popular Content
Showing content with the highest reputation on 01/30/2026 in all areas
-
You could use this to rename the reference in question so that it references a different (duplicate) block definition, which could then be marked as explodable.2 points
-
Something like this? (defun c:foo (/ e el m p1 p2) (cond ((and (setq e (car (entsel "\nPick dimension: "))) (progn (vlax-for a (vla-item (vla-get-blocks (vla-get-activedocument (vlax-get-acad-object))) (cdr (assoc 2 (entget e))) ) (and (= "AcDbMText" (vla-get-objectname a)) (setq m (vlax-vla-object->ename a))) ) m ) (setq p1 (cdr (assoc 10 (setq el (entget m))))) (setq p2 (getpoint p1 "\nSpecify second point: ")) ) (setq e (entmakex (append (vl-remove-if '(lambda (x) (= 330 (car x))) el) (list (cons 10 p2)))) ) (vla-put-height (setq e (vlax-ename->vla-object e)) (* 0.001 (vla-get-height e))) ) ) (princ) )1 point
-
This is not possible that I'm aware of. The code above could be modified to explode the blocks selected then make those block definitions un-explodable again.1 point
-
You may have to Wblock one block, open the wblock, change the explode to "Yes" then rename the block. You can now insert that block into your dwg say deleting the original block. But you will have 2 blocks.1 point
-
Trash5.dwgTrash4.dwgTrash3.dwgTrash2.dwgTrash1.dwg I opened your files in Bricscad and did WBLOCK on them, and they all reduced down in size dramatically. I haven't looked to see if anything is missing, so have a look and see if they are OK. The last file I Wblocked complained that there were over 1,500 layer filters. I don't use them myself, but it seems excessive to me (see screenshot file).1 point
-
As I said, this code doesn't work in some special cases. However, in the cases where it does work, it returns surprising results. I've attached a short video to illustrate this. CLG_xple.mp41 point
-
Best way to clean a difficult file is WBlock, not sure what had those bloated like that.1 point
-
There is no problem in drawing that type of break it just involves a custom lisp to break the lines and draw wiggly lines, the amount of wiggle may have a couple of FUZZY values or scale factors. even a block just scaled to fit. To write your own lisp and its a good task to start learning, Draw a line say 1 unit long vertically one end at 0,0, the turn off snap and draw a wiggly Pline. Use list select pline and copy out the co-ords, to notepad You have 1/2 your code now, just make the points, use a scale factor on the Y value to adjust the points for the 2-3/8 then can draw the pline at correct position. Ok now the easy answer make a block and again draw a line, do the pline, erase the dummy line, save block. you can insert the block and scale it to suit the length required. insert block twice, after breaking line. I would turn second insert upside down so looks a bit more random. Ok I have avoided line work on any other angle than horizontal, on purpose, you can pick a point on 1st line break it, then perp to other line and auto break it also. This involves getting linework details like angle of lines. The actual pline could have randomness added to it so no 2 plines are quite the same by in example vertical, adjusting the x value within a range so 2 breaks don't touch. So have a go make a block and your homework is in lisp, Getpoint pt1, Polar for 2nd point, based on horizontal line, then Break using 2 points, getpoint again Pt2 using perp , break other side. Simple block answer.1 point
-
1 point
-
Hi guys, As thanks for helping me out through the journey of AutoLISP from multiple posts, I've decided to make a small contribution to CADTutor.net with my own code that you can download from here: https://www.cadtutor.net/forum/files/file/27-block-overkill/ Upon issuing the BOVERKILL command, This LISP will allow you to either delete blocks that area "duplicated" on top of one another, or move them to a specified layer. This LISP deletes blocks in which the blocks in comparison abides to the following three criteria below: It shares the same insertion point to a specified tolerance It shares the same effective name It shares the same effective scale to the same specified tolerance Modes of Overkill Thanks to a wonderful suggestion from one of the insights in this forum, the program has been further upgraded as of 20 April 2023. This LISP routine now also allows for three modes of overkill: Distance Plane-Axis Axes The "Distance" mode is the default mode and is the most widely used mode of overkill. This mode determines that two blocks are considered duplicates if the distance between them is within the specified tolerance inputted by the user. The "Plane-Axis" mode determines that two blocks are duplicates if the proximity of the blocks in comparison lies within one tolerance specified for one of the planes , and a separate tolerance along the third axis (normal) of that plane. Calculations are done to the UCS. The "Axes" mode determines that two blocks are duplicates by comparing three different tolerances across each axis individually. All three tolerances must be met for the program to consider the blocks a duplicate. Just like the previous mode, the UCS will be used by the program to perform the calculations. Following this, the program will also draw a circle (of a radius set within the LISP routine) on the insertion points of the processed blocks. These circles will be drawn in the "BOVERKILL-Duplicates" layer. After which it prints a report of the quantity of the deleted or modified blocks to the command line. This feature makes it easy for users to identify where duplicates are found on a large drawing with thousands of blocks. However, the dynamic properties of the block are far too hard for me to calculate as they have different position, rotation and visibility parameters that could be altered by the user. As such, they are ignored. Note that the rotation of the block does not fall in the criteria above as mirroring the block alters it's rotation values, and thus will fail on some circumstances. This means that the blocks will still be processed if as long as the three criteria above satisfy and objects are not rotated the same way. This LISP was inspired when using block counting routines (for example from Lee Mac's Block Counter routine or your own custom routines) reporting incorrect numbers due to duplicate blocks. The OVERKILL command for one reason or another is not able to delete duplicate dynamic blocks that are (for example, rotated normally then rotate through dynamic rotation to the original position). I've also cycled through the net for solutions to no avail. Thus, I opened this program for you folks to use. It's not a perfect code but I hope it will make working for you much more convenient. Any feedbacks, comments, and criticisms are welcomed as I look to learn and get better. Enjoy. Thanks, Jonathan Handojo1 point
-
This might be a bit closer: (defun c:foo (/ c d e f k) (setq k "rjpfoo") (or (getenv k) (setenv k "(62 . 1)")) (cond ((and (setq c (acad_truecolordlg (read (getenv k)))) (setq e (nentsel "\nSelect entity to change all xref layer color: ")) ) (setenv k (vl-prin1-to-string (last c))) (setq d (vla-get-activedocument (vlax-get-acad-object))) (setq f "") (foreach x (cadddr e) (setq f (strcat (cdr (assoc 2 (entget x))) "*," f))) (vlax-for l (vla-get-layers d) (if (wcmatch (vla-get-name l) f) (entmod (append (entget (vlax-vla-object->ename l)) c)) ) ) (vla-regen d acactiveviewport) ) ) (princ) )1 point
-
no idea why its working for me and not you guys. took out the vla-copy and just use command --edit @leonucadomi you try Steven's lisp? ;;----------------------------------------------------------------------------;; ;; Copy dimension value to another location (defun C:DimCopy (/ dim BP LastEnt en) (vl-load-com) (setvar 'cmdecho 0) (while (setq dim (car (entsel "\nSelect Dimension: "))) (setq obj (vlax-ename->vla-object dim)) (setq BP (vlax-get obj 'TextPosition)) (setq LastEnt (entlast)) (command "_.Copy" dim "" "_non" BP (getpoint BP "\nCopy to: ")) (command "_Explode" (entlast)) (if (setq en (entnext LastEnt)) (while en (cond ((= "MTEXT" (cdr (assoc 0 (entget en)))) (command "_Explode" en) ;convert mtext to text ) ((= "TEXT" (cdr (assoc 0 (entget en)))) (progn) ) (t (entdel en) ) ) (setq en (entnext en)) ) ) ) (setvar 'cmdecho 1) (princ) )1 point
