CADPOLE Posted May 10, 2009 Posted May 10, 2009 I worked with a CAD Demi-god that had a lisp that would turn plan pipng blocks into iso blocks for ball valves and such. I believe you had to explode the block first but, I'm not possitive on that. Dose anyone have a .lsp for that? o:)P.s. I really miss the Demi-god and, hope he is making fat bucks where ever he's at. Bless him and all his lisp routines. amen Quote
wizman Posted May 11, 2009 Posted May 11, 2009 Please try: (defun c:isoblock (/ blok_ent counter ent_data ent_pt i sub_func) (vl-load-com) (defun to_southwest (ent_name base_pt / obj) (vla-TransformBy (setq obj (vlax-ename->vla-object ent_name)) (vlax-tmatrix (list (list (/ (sqrt 2.) 2.) (- (/ (sqrt 2.) 2.)) 0. 0.) (list (/ (sqrt (/ 2. 3.)) 2.) (/ (sqrt (/ 2. 3.)) 2.) (sqrt (/ 2. 3.)) 0.) (list (- (/ (sqrt 3.) 3.)) (- (/ (sqrt 3.) 3.)) (/ (sqrt 3.) 3.) 0.) (list 0. 0. 0. 1.) ) ) ) (vla-move obj (vlax-3d-point (trans (cdr (assoc 10 (entget ent_name))) ent_name 0) ) (vlax-3d-point base_pt) ) ) (defun to_southeast (ent_name base_pt / obj) (vla-TransformBy (setq obj (vlax-ename->vla-object ent_name)) (vlax-tmatrix (list (list (/ (sqrt 2.) 2.) (/ (sqrt 2.) 2.) 0. 0.) (list (- (/ (sqrt (/ 2. 3.)) 2.)) (/ (sqrt (/ 2. 3.)) 2.) (sqrt (/ 2. 3.)) 0.) (list (/ (sqrt 3.) 3.) (- (/ (sqrt 3.) 3.)) (/ (sqrt 3.) 3.) 0.) (list 0. 0. 0. 1.) ) ) ) (vla-move obj (vlax-3d-point (trans (cdr (assoc 10 (entget ent_name))) ent_name 0) ) (vlax-3d-point base_pt) ) ) (defun to_front (ent_name base_pt / obj) (vla-TransformBy (setq obj (vlax-ename->vla-object ent_name)) (vlax-tmatrix (list (list 1. 0. 0. 0.) (list 0. 0. 1. 0.) (list 0. 1. 0. 0.) ;mirrored (list 0. 0. 0. 1.) ) ) ) (vla-move obj (vlax-3d-point (trans (cdr (assoc 10 (entget ent_name))) ent_name 0) ) (vlax-3d-point base_pt) ) ) (defun to_front_southwest (ent_name base_pt / obj) (to_front ent_name base_pt) (to_southwest ent_name base_pt) ) (defun to_front_southeast (ent_name base_pt / obj) (to_front ent_name base_pt) (to_southeast ent_name base_pt) ) (if (setq blok_ent (car (entsel "\n>>>...Pick a block...>>>: "))) (progn (setq ent_data (entget blok_ent)) (setq ent_pt (cdr (assoc 10 ent_data))) (to_southwest blok_ent ent_pt) (setq counter 1) (while (= (setq i (strcase (getstring "\rPress [Enter] to Toggle or Press any key to exit: "))) "") (if blok_ent (vla-delete (vlax-ename->vla-object blok_ent)) ) (setq sub_func (nth counter '(to_southwest to_southeast to_front_southwest to_front_southeast ) ) ) (entmake ent_data) (setq blok_ent (entlast)) ((eval sub_func) blok_ent ent_pt) (if (< counter 3) (setq counter (1+ counter)) (setq counter 0) ) ) ) ) (princ) );...........................................wiz11May09 Quote
wizman Posted May 11, 2009 Posted May 11, 2009 thanks lee, i just rotated the block, im not sure if the OP still needs to explode then flatten then turn to block again. keep up your good work lee. 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.