davidkalapa Posted April 9, 2022 Share Posted April 9, 2022 i want to transfer the highet attribute of a block to its block position z geometry that currently as the value of 0 how can I do it ? Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 9, 2022 Share Posted April 9, 2022 Its easy enough to do so just select the attributed block then retrieve the attribute with tag name HEIGHT then modify the Z coordinates of the block. Did you write any codes in regard to this goal? Quote Link to comment Share on other sites More sharing options...
davidkalapa Posted April 10, 2022 Author Share Posted April 10, 2022 its for a 2000 blocks i need some other way Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 10, 2022 Share Posted April 10, 2022 I am not giving you a manual solution but one with a routine and that's why I asked you if you have written any codes in this regard. Quote Link to comment Share on other sites More sharing options...
Tharwat Posted April 10, 2022 Share Posted April 10, 2022 Try the following [ untested ] codes and let me know. (defun c:Test (/ int sel ent get obj att pos ins) ;;------------------------------------------------------------;; ;; Author: Tharwat Al Choufi - Date: 10.Apr.2022 ;; ;; website: https://autolispprograms.wordpress.com ;; ;;------------------------------------------------------------;; (and (princ "\nSelect attributed blocks < M1502_P > : ") (setq int -1 sel (ssget '((0 . "INSERT") (66 . 1) (2 . "M1502_P"))) ) (while (setq int (1+ int) ent (ssname sel int) ) (and (setq get (entget ent) obj (vlax-ename->vla-object ent) pos (assoc 10 get) ins (mapcar '+ (cdr pos) '(0. 0.)) ) (vl-some (function (lambda (u) (and (= (vla-get-tagstring u) "HEIGHT") (setq att (vla-get-textstring u)) ) ) ) (vlax-invoke obj 'GetAttributes) ) (entmod (subst (cons 10 (append ins (list (distof att)))) pos get) ) ) ) ) (princ) ) (vl-load-com) 1 Quote Link to comment Share on other sites More sharing options...
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.