Visual LISP, AutoLISP and General Customization
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Z axis can't to zero.

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
395 Views, 5 Replies

Z axis can't to zero.

bad drawing. Z axis can't to zero.

 

I use command "FLATTEN" can't reset Z axis to zero. I use LISP ,but it's too.

;;vla
;;(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))))
     )
    )
  )
)

 

;;DXF
;;(XX:LeftPick:LineZto0Ent (car(entsel)))
(defun XX:LeftPick:LineZto0Ent (ss)
  (defun MoveOne (e)
    (entmod
      (mapcar
'(lambda (X)
    (cond
      ((or (equal (car x) 11) (equal (car x) 10)) (list (car x) (cadr x) (caddr x)))
      (T x)
    )
  )
(entget e)
      )
    )
  )
  (cond
    ((equal (type ss) 'ENAME) (MoveOne ss))
    ((equal (type ss) 'PICKSET)
     (repeat (setq n (sslength ss))
       (MoveOne (ssname ss (setq n (1- n))))
     )     
    )
  )
)

 

any routine or any tools can solve this problem ?

 

DWG file in attachments.

 

5 REPLIES 5
Message 2 of 6
3wood
in reply to: Anonymous

You can try attached CHZ20.vlx.

I also attached the result dwg here.

It doesn't work on Region objects though.

Message 3 of 6
Anonymous
in reply to: 3wood

 
 
Message 4 of 6
3wood
in reply to: Anonymous

It doesn't hurt to get a free registration.

Message 5 of 6
Anonymous
in reply to: 3wood

Hi 3wood.

can only chage the block ? 

Message 6 of 6
3wood
in reply to: Anonymous

No, it changes all entities including block definitions except for a certain entity types such as region.

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report

”Boost