iztok13 Posted September 24, 2012 Posted September 24, 2012 Hello, I was wondering if there is any lisp program to move attribute to Z-coordinate. I have attribute (block) wich have number as "TOČKA" and Z coordinate like "H". So I need this attribute to move on H witch is Z coordinate ? this is an example of attribute blocks point attr.dwg thx for any help... Quote
Stefan BMR Posted September 24, 2012 Posted September 24, 2012 (defun C:TEST (/ ss en p1) (if (setq ss (ssget '((0 . "INSERT") (2 . "TYXH")))) (repeat (setq i (sslength ss)) (setq en (vlax-ename->vla-object (ssname ss (setq i (1- i)))) p1 (vlax-get en 'InsertionPoint) ) (foreach x (vlax-invoke en 'getattributes) (if (eq (vla-get-TagString x) "H") (vlax-put en 'InsertionPoint (list (car p1) (cadr p1) (atof (vla-get-TextString x)))) ) ) ) ) (princ) ) Quote
iztok13 Posted September 24, 2012 Author Posted September 24, 2012 Thx Stefan BMR, but i notice that this lisp works only with the TYXH name of block. I have in drawing different blocks name , is possible to do this for all block attributes ? block attr.dwg Quote
Stefan BMR Posted September 24, 2012 Posted September 24, 2012 This will process one block name at the time. (defun C:TEST (/ at tag ea ss en p1 i) (if (and (setq at (car (nentsel "\nSelect attribute representing Z value: "))) (eq (cdr (assoc 0 (setq ea (entget at)))) "ATTRIB") (setq tag (cdr (assoc 2 ea))) ) (if (setq ss (ssget (list (cons 0 "INSERT") (assoc 2 (entget (cdr (assoc 330 ea)))) ) ) ) (repeat (setq i (sslength ss)) (setq en (vlax-ename->vla-object (ssname ss (setq i (1- i)))) p1 (vlax-get en 'InsertionPoint) ) (foreach x (vlax-invoke en 'getattributes) (if (eq (vla-get-TagString x) tag) (vlax-put en 'InsertionPoint (list (car p1) (cadr p1) (atof (vla-get-TextString x)))) ) ) ) ) ) (princ) ) Quote
iztok13 Posted September 24, 2012 Author Posted September 24, 2012 thank you very much.... nice smooth workin thx again Quote
Fredricc Posted June 27, 2019 Posted June 27, 2019 Is it possible to do this on all points on all choosen visible layers ? Quote
dlanorh Posted June 27, 2019 Posted June 27, 2019 4 hours ago, Fredricc said: Is it possible to do this on all points on all choosen visible layers ? Not enough information supplied, so the short answer would be probably Quote
Fredricc Posted July 1, 2019 Posted July 1, 2019 all points and lines and everything you can see in 2d vision would be lighted up with a attribute of the z coordinate, and be placed in a separate layer Quote
tombu Posted July 1, 2019 Posted July 1, 2019 5 hours ago, Fredricc said: all points and lines and everything you can see in 2d vision would be lighted up with a attribute of the z coordinate, and be placed in a separate layer You want to convert every object in the drawing to a block? What Elevation would you put in the attribute for a line the beginning or the end? For what purpose? Quote
Fredricc Posted July 2, 2019 Posted July 2, 2019 i posted some stuff a while ago, but havent figure out how to do it yet. this link is showing what i mean : 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.