Search the Community
Showing results for tags 'nested block'.
-
Make a lisp work by allowing to select a nested block
pvr posted a topic in AutoLISP, Visual LISP & DCL
Hello, I have this code I use to automatically annotate my details (FAS). It takes the block´s name and its description and inputs them into two attributes of the block I use to define a specific Multileader (Smart Multileader). I would like to make it work when selecting nested blocks. I have tried by using nentselp but cannot find the right way. Any help would be really appreciated. Thanks in advance! (defun getDesc (blk / Com) (cond ((not (vl-catch-all-error-p (vl-catch-all-apply (function (lambda ( ) (setq com (vla-get-Comments (vla-item (vla-get-Blocks (vla-get-ActiveDocument (vlax-get-acad-object))) blk)))))))) Com) (t nil))) (defun c:FAS (/ ent entl obj) (cond ((not (setq ent (car (entsel "\nSelect block: "))))) ((not (eq (cdr (assoc 0 (entget ent))) "INSERT")) (princ "\nInvalid object!")) ((setq pt (getpoint "\nSpecify first point: ")) (setq entl (entlast)) (setvar "cmleaderstyle" "Standard") (vl-cmdf "_.mleader" "_non" pt "\\") (while (eq (logand 1 (getvar 'CMDACTIVE)) 1) (vl-cmdf "")) (setq txt (vlax-get-property (setq obj (vlax-ename->vla-object ent)) (if (vlax-property-available-p obj 'EffectiveName) 'EffectiveName ;if obj has EffectiveName. use EffectiveName, else use 'Name 'Name ) ) ) (if (setq desc (getDesc (cdr (assoc 2 (entget ent))))) (setq txt(strcat txt "\n" desc)) ) ;(alert txt) (if (not (equal entl (setq entl (entlast)))) (vla-put-textstring (vlax-ename->vla-object entl) txt) ) ) ) (princ) ) (defun c:FAS (/ ent entl obj) (cond ((not (setq ent (car (entsel "\nSelect block: "))))) ((not (eq (cdr (assoc 0 (entget ent))) "INSERT")) (princ "\nInvalid object!")) ((setq pt1 (getpoint "\nSpecify first point: ")) (setq pt2 (getpoint "\nSpecify second point: ")) (setq entl (entlast)) (setq name (vlax-get-property (setq obj (vlax-ename->vla-object ent)) (if (vlax-property-available-p obj 'EffectiveName) 'EffectiveName ;if obj has EffectiveName. use EffectiveName, else use 'Name 'Name ) ) ) (setq desc (getDesc (cdr (assoc 2 (entget ent))))) (setvar 'attdia 0) (setvar 'attreq 1) (setvar "cmleaderstyle" "Smart Multileader") (command-s "mleader" pt1 pt2 name "" desc "" "" "") ) ) (princ) ) (vl-load-com) (princ) dwg1.dwg -
Is there a method to update blocks and nested blocks (dynamic and/or annotated without losing their position, visibility status, and annotated values: Tag/prompt/default values) based on new blocks that will contain in a folder (source files)? New blocks have the same block name as old ones. The cad block files within the "source" folder have the same name as the old block. Dynamic blocks have stretch or rotation properties, example: block is stretched to 2100mm and rotated to 30 degrees. 1) is it possible to obtain this kind of sophistication? 2) How would I run this routine without opening the drawing and that select the drawing files? Thanks
- 1 reply
-
- lisp
- nested block
-
(and 1 more)
Tagged with:
-
I found a lisp (attached) to change object line type. But this lisp is not changing nested blocks line types and forcing one by one selection . I need to change linetype of all objects include nested blocks and as area selection. Please help ChangeObjLinetype.lsp
- 11 replies
-
- linetype
- nested block
-
(and 1 more)
Tagged with:
-
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:
-
Hi everyone glad to be in this amazing forum. Straight to the point: is there a way to explode the nested blocks in a drawing that contain a a common word in their name? In our case we have a lot of blocks exported from vectorworks whose name was substitute with -group-xxx-y, is there a way to run a routine similar to exnest but that would explode only the nested blocks with that similar name? Thanks for any help:)
- 5 replies
-
- exnest
- nested block
-
(and 2 more)
Tagged with: