Jump to content

Z axis to zero


andy_lee

Recommended Posts

Hi,guys

 

I need a routine for Z axis to zero, Support all object, block ,attrib block ,dynamic block.

 

Thanks for any help !

Link to comment
Share on other sites

11.gif

 

There is an easy one routine. but not support any block.

 

;;(HH:vlaZto0 (ssget))
(defun HH:vlaZto0 (ss / E N OBJ P1 P2)
 (defun MoveOne (e)
   (setq obj (vlax-ename->vla-object e))
   (vla-move obj p1 p2)
   (vla-move obj p2 p1)
 )
 (setq p1 (vlax-3d-point '(0 0 0)))
 (setq p2 (vlax-3d-point '(0 0 1000e99)))
 (cond
   ((equal (type ss) 'ENAME) (MoveOne ss))
   ((equal (type ss) 'PICKSET)
    (repeat (setq n (sslength ss))
      (MoveOne (ssname ss (setq n (1- n))))
    )
   )
 )
)

Link to comment
Share on other sites

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