davidkalapa Posted April 9, 2022 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
Tharwat Posted April 9, 2022 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
davidkalapa Posted April 10, 2022 Author Posted April 10, 2022 its for a 2000 blocks i need some other way Quote
Tharwat Posted April 10, 2022 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
Tharwat Posted April 10, 2022 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
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.