rk25134 Posted January 8, 2015 Posted January 8, 2015 Select the specific blocks inside polyline/polygon and update the selected Mtext/Text information into below mentioned tag values of the blocks tag names: ST_NAME HSE_NO It should ask the Block name. Quote
Tharwat Posted January 8, 2015 Posted January 8, 2015 Are you talking about Attributed Block ? What is the new text string that you want to replace the current one with ? Sample drawing mostly describes the goal much more better than words Quote
rk25134 Posted January 8, 2015 Author Posted January 8, 2015 Please find the attached Dwg test1.dwg Quote
Tharwat Posted January 8, 2015 Posted January 8, 2015 I see the the tag name ( ST_NME and HSE_NO) are Invisible and even when changing the value they won't be seen . Quote
BIGAL Posted January 8, 2015 Posted January 8, 2015 I am trying to remember the post but I did a lisp for selecting text within a polyline it should be simple to modify to find a block and update the attribs is part2. here is a start needs modifying to look for Insert, the dwg posted has no info about what is to be replaced need more detail. ; this is not finished code (vl-load-com) (defun getcoords (ent) (vlax-safearray->list (vlax-variant-value (vlax-get-property (vlax-ename->vla-object ent) "Coordinates" ) ) ) ) (defun co-ords2xy () ; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z (setq numb (/ (length co-ords) 2)) (setq I 0) (repeat numb (setq xy (list (nth I co-ords)(nth (+ I 1) co-ords) )) (setq coordsxy (cons xy coordsxy)) (setq I (+ I 2)) ) ; end repeat ) ; end defun ; program starts here ; choose output file change acdatemp to what you want (setq plobjs (ssget (list (cons 0 "lwpolyline")))) (setq numb1 (sslength plobjs)) (setq x numb1) (repeat numb1 (setq obj (ssname plobjs (setq x (- x 1)))) (setq co-ords (getcoords obj)) (co-ords2xy) ; write pline co-ords here (setq numb3 (length co-ords)) (setq z numb3) (setq ansco-ords "") (repeat numb3 (setq ansco-ords (strcat ansco-ords (rtos (nth (setq z (- z 1)) co-ords) 2 3 ) " " )) ) (setq ans (strcat "Pline " ansco-ords)) (write-line ans fout) (setq ansco-ords "") (setq ss (ssget "WP" coordsxy (list (cons 0 "Insert")))) ; selection set of Blocks within polygon (if (= ss nil) (princ "\nnothing inside") (progn (setq coordsxy nil) ; reset for next time (setq numb2 (sslength ss)) (setq y numb2) (repeat numb2 ; this where you would do attrib bit (princ "\n") ) ; end repeat2 (setq ss nil) ; reset for next poly ) ) ) ; end repeat1 (close fout) (princ) Quote
BIGAL Posted January 10, 2015 Posted January 10, 2015 Just use a lisp, ssget with a filter for the block UTUID and update, just pick street name 1st then select relevant blocks say by a polygon window. Plenty of examples around. I would do multiple at a time rather than 1 lot at a time. Quote
pBe Posted January 10, 2015 Posted January 10, 2015 Use fields value rk25134. you only have to do it once. Whatever is the value on the the TAGS ST_NAME and HSE_NO the TEXT string value will follow or is it the other way around? But still, FIELDS is the way to go. Quote
BIGAL Posted January 11, 2015 Posted January 11, 2015 Pbe nice idea just pick text as a field if you rename blocks update. Quote
pBe Posted January 12, 2015 Posted January 12, 2015 Pbe nice idea just pick text as a field if you rename blocks update. I guess we will never know if its enough to solve the OP's problem, perhaps the OP has all but given up on this thread. Quote
rk25134 Posted January 13, 2015 Author Posted January 13, 2015 can we update the text value into the block which is are laid in closed polygons/polylines Quote
pBe Posted January 13, 2015 Posted January 13, 2015 Yes. as long the source is either TEXT/MTEXT/Attributes Quote
rk25134 Posted January 15, 2015 Author Posted January 15, 2015 Need a lisp for below requirement I need to update automatically the block attribute of tag value (HSE_NO) from the text/mtext located in the same closed polygon. Ex. 1. In a closed polygon/polyline there will be a text or mtext having some values that need to entered into the blocks which are locating in the same closed polygon/polyline 2. text/mtext is in layer HSENO and the block attribute is HSE_NO 3. I tool will find more than one text/mtext that need to entered into another block which is located in the same block. Quote
BIGAL Posted January 16, 2015 Posted January 16, 2015 have a look at my last post here http://www.cadtutor.net/forum/showthread.php?90457-Counting-Blocks-Within-a-Boundary Quote
rk25134 Posted January 16, 2015 Author Posted January 16, 2015 Please find the attached lisp, need to any modifications please let me know HR_Modified.lsp Quote
rk25134 Posted January 17, 2015 Author Posted January 17, 2015 Please change the code accordingly 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.