Search the Community
Showing results for tags 'nested'.
-
I have recently downloads a pile of files, blocks for inserting, symbols. Apparently all files have block in them of the same name of the file name. Thus, upon inserting a file I get the error "block reference itself" and will not insert. Is there a means of removing the block in the file in a batch method? Since there is over 8700 blocks, I do not want to open each file, explode, purge, save, individually. Looking for a batch method that basically does the same thing. Or some other method to not only remove the error, but also to avoid the purging nested block on layer problems.
-
- nested
- block reference
-
(and 2 more)
Tagged with:
-
Selecting Nested attribute text enity to remove hatch over it
shailujp posted a topic in AutoLISP, Visual LISP & DCL
Hi all, I need help on selecting a nested object which is attributed text from the block to be able to remove hatch over it. Below is the code that I'm using currently (not mine originaly, I tweaked it a bit for my application). This code just works for the whole block but doesnt allow me to select just the text. (defun Fixhatch (/ Hatchfix objct) (while (setq Hatchfix (entsel "\nSelect Hatch to fix (or Enter to close):")) (redraw (car Hatchfix) 3) (Alert "\n***Select object(s) to clear/skip hatch:***") (setq objct (ssget)) (if (eq (cdr (assoc 0 (entget (setq Hatchfix (car Hatchfix))))) "HATCH") (command "_.-hatchedit" Hatchfix "Ad" "s" objct "" "") (princ "\nSelected entity is not a hatch.") );end if );end while );end defun As you can see the text TB6 is an attribute text of the rectangle block and I want to remove hatch just from the text. Can this be done? Thanks in advance. -
Edit line weight in nested blocks of all XREF drawings.
crsimmons posted a topic in AutoCAD Drawing Management & Output
The 2D drawings I am working with were exported from 3D REVIT files to 2D AutoCAD files. There are several XREFed drawings that are both mechanical and architectural from the original REVIT files that for whatever reason, the block's line weights came over with line weights of 70 in those blocks. When I plot, the objects are a blur with the line weight so high. I tried using the command "setbylayer" but that didn't work since nested blocks still had lineweights of 70. Is there a VBA or LISP routine to run through all the blocks (including nested) that can change the line weights to a given number? Thank you for any advise/recommendations. -
Change colour of all objects within blocks in a drawing file using a batch process
hosannabizarre posted a topic in AutoLISP, Visual LISP & DCL
I created an action macro to do the following: 1) Select all objects 2) Change the colour to "140" I saved it as "ActMacro001" I needed to apply this macro to heaps of files, and used the following batch process lisp (It applies ActMacro001 to files A.DWG, B.DWG, C.DWG etc): [color=#ff0000]([/color][color=#0000ff]defun[/color] C:BATCH[color=#ff0000]([/color][color=#0000ff]/[/color] dwgs scr-name lsp-name[color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]setq[/color] dwgs '[color=#ff0000]([/color][color=#ff00ff]"C:/A.DWG" "C:/B.DWG" "C:/C.DWG" "C:/D.DWG"[/color][color=#ff0000])[/color] scr-name [color=#ff00ff]"c:/tmp.scr"[/color] lsp-name [color=#ff00ff]"c:/batch.lsp"[/color] [color=#ff0000])[/color] (create-script scr-name dwgs lsp-name [color=#ff00ff]"(ChangeColour)"[/color] [color=#0000ff]T[/color][color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]command[/color] [color=#ff00ff]"_.SCRIPT"[/color] scr-name[color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]vl-file-delete[/color] scr-name[color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]princ[/color][color=#ff0000])[/color] [color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]defun[/color] ChangeColour[color=#ff0000]([/color][color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]command[/color] [color=#ff00ff]"ActMacro001"[/color][color=#ff0000])[/color] [color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]defun[/color] create-script[color=#ff0000]([/color]scr dwgs lsp cmd save [color=#0000ff]/[/color] f dwg[color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]setq[/color] f [color=#ff0000]([/color][color=#0000ff]open[/color] scr [color=#ff00ff]"w"[/color][color=#ff0000])[/color][color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]foreach[/color] dwg dwgs [color=#ff0000]([/color][color=#0000ff]progn[/color] [color=#ff0000]([/color][color=#0000ff]write-line[/color] [color=#ff0000]([/color][color=#0000ff]strcat[/color] [color=#ff00ff]"_.OPEN \""[/color] dwg [color=#ff00ff]"\""[/color][color=#ff0000])[/color] f [color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]write-line[/color] [color=#ff0000]([/color][color=#0000ff]strcat[/color] [color=#ff00ff]"(load \""[/color] lsp [color=#ff00ff]"\")"[/color][color=#ff0000])[/color] f [color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]write-line[/color] cmd f[color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]if[/color] save [color=#ff0000]([/color][color=#0000ff]write-line[/color] [color=#ff00ff]"_.QSAVE"[/color] f[color=#ff0000])[/color] [color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]write-line[/color] [color=#ff00ff]"_.CLOSE"[/color] f[color=#ff0000])[/color] [color=#ff0000])[/color] [color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]close[/color] f[color=#ff0000])[/color] [color=#ff0000]([/color][color=#0000ff]princ[/color][color=#ff0000])[/color] [color=#ff0000])[/color] I have discovered now that some of the drawings which had the macro applied had blocks. All elements aside from the blocks were changed to colour 140. Now I want to improve my macro, or lisp routine, such that all elements within blocks are changed to colour 140, along with non block elements. Is there a way to automate the changing of block definitions with repect to nested object colour?? Would greatly appreciate some insight on this problem.