Jump to content

Recommended Posts

Posted

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.:cry:

 

Thank you! :)

Posted
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.:cry:

 

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

Posted

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)
)

Posted

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!:D

 

-Henrik

Posted

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...