witman Posted November 4, 2009 Posted November 4, 2009 Hi Guys I've searched the forum a couple of times without any luck. But here it goes; I'm working with a large set of contours (exported from MapInfo), these contours have an attribute "Z" with the elevation in autocad 2008. Is there a way to use this "Z" value to elevate my blocks? (we're talking 20.000+ blocks). I need the contours for my 3ds max model. Thank you! Quote
gilsoto13 Posted November 4, 2009 Posted November 4, 2009 Hi Guys I've searched the forum a couple of times without any luck. But here it goes; I'm working with a large set of contours (exported from MapInfo), these contours have an attribute "Z" with the elevation in autocad 2008. Is there a way to use this "Z" value to elevate my blocks? (we're talking 20.000+ blocks). I need the contours for my 3ds max model. Thank you! http://forums.augi.com/showthread.php?t=4362 the bad thing is that It grabs the top attribute... maybe someone could modified it to be the Z attribute bel.lsp Quote
gile Posted November 4, 2009 Posted November 4, 2009 Hi, As I don't know the block name and the attribute tag, the user have to select the good attribute of one block first. (defun c:elevate (/ acdoc att tag own name inspt atts alt) (vl-load-com) (setq acdoc (vla-get-ActiveDocument (vlax-get-acad-object))) (if (and (setq att (car (nentsel "\nSelect the altitude attribute: "))) (setq att (vlax-ename->vla-object att)) (= (vla-get-ObjectName att) "AcDbAttribute") ) (progn (setq tag (vla-get-TagString att) own (vla-ObjectIdToObject acdoc (vla-get-OwnerId att)) name (vla-get-Name own) ) (ssget "_X" (list '(0 . "INSERT") (cons 2 name))) (vlax-for b (setq ss (vla-get-ActiveSelectionSet acdoc)) (vl-catch-all-apply '(lambda () (setq inspt (vlax-get b 'InsertionPoint) atts (vlax-invoke b 'GetAttributes) ) (foreach a atts (if (= (vla-get-TagString a) tag) (setq alt (atof (vla-get-TextString a))) ) ) (vla-Move b (vlax-3d-point '(0. 0. 0.)) (vlax-3d-point (list 0. 0. alt))) ) ) ) ) ) (princ) ) Quote
witman Posted November 4, 2009 Author Posted November 4, 2009 Thanks you guys, I'm gonna try it tomorrow when I'm back at work...looks promising. I'll let you now how it goes. I will sing your praises for a week if it works! -Henrik Quote
jalucerol Posted November 6, 2009 Posted November 6, 2009 Try the attached vba. It's intended to elevate circles using text that is placed near to it. Feel free to chang it as you need, if you like I can modify it for you. planialtimetria.zip 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.