woodman78 Posted February 24, 2010 Posted February 24, 2010 I am looking for a way to remove a specific block from a layout tab on a drawing and put another block in it's place. They will all have the same insertion point. I have been trying to look for ways to select the block. Do i use ssget or what?? Quote
Glen Smith Posted February 24, 2010 Posted February 24, 2010 Does BLOCKREPLACE do what you want or are you looking for something else? Glen Quote
woodman78 Posted February 24, 2010 Author Posted February 24, 2010 Thanks Glen, I never knew about BLOCKREPLACE but i'm looking to do it within a lisp. How do I filter out the block. The name is fixed and the position is fixed on each layout. The block forms part of the title on our sheet. Quote
MarcoW Posted February 25, 2010 Posted February 25, 2010 WHat about this? (defun c:ins2ins (/ lb bn ss i en ed) ;;;GET NEW BLOCK INFO (setq lb (getvar "INSNAME")) (while (not bn) (setq bn (getstring (strcat "\nNew blocks name (has to be in drawing or in support file path) <" lb ">: "))) (cond ((= bn "") (setq bn lb)) ((and (snvalid bn) (tblsearch "BLOCK" bn))) ((and (snvalid bn) (findfile (strcat bn ".DWG"))) (command "_.INSERT" bn) (command)) (T (setq bn nil lb "")))) (while (not ss) (princ "\nSelect block(s) to exchange...") (setq ss (ssget (list (cons 0 "INSERT") (if (getvar "CTAB") (cons 410 (getvar "CTAB")) (cons 67 (- 1 (getvar "TILEMODE")))))))) (setq i (sslength ss)) (while (not (minusp (setq i (1- i)))) (setq en (ssname ss i) ed (entget en)) (entmod (subst (cons 2 bn) (assoc 2 ed) ed))) (command "attsync" "S" "L" "y") (prin1)) Credit to the original author, it is not me . I only added the attsync line... Maybe there is a way to keep the attribute values intact, if for a title block it is mostly required. Quote
woodman78 Posted February 25, 2010 Author Posted February 25, 2010 MarcoW, it would be great to just update the attribute of the block but the problem I have is that it is for project names and they can range in length from one liners to being spread over 3 lines. Can this be done by updating the attirbute? At the moment I use a dynamic block which is cumbersome. Quote
Lee Mac Posted February 25, 2010 Posted February 25, 2010 Credit to the original author, it is not me . Looking at the style, I'd say it was one of David's Quote
woodman78 Posted February 25, 2010 Author Posted February 25, 2010 LeeMac, can i use something similar to the "\\X" that you gave me for the dimreact to make the attirubute of a block update with more than one line? Quote
David Bethel Posted February 25, 2010 Posted February 25, 2010 Looking at the style, I'd say it was one of David's Yeah, I'd say that was one of mine. -David Quote
Lee Mac Posted February 25, 2010 Posted February 25, 2010 LeeMac, can i use something similar to the "\\X" that you gave me for the dimreact to make the attirubute of a block update with more than one line? Don't think so - you would have to use Multiline Attributes. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.