#1
|
|||
|
|||
about sheet metal punch_function
Code:
(sha-define-shop-table "ar-rect" :TABLE-TITLE "Rectangular array" :COLUMNS (:HORIZ :VERT :SPACE_X :SPACE_Y :TOT_DIST_X :TOT_DIST_Y :TOOL_ID :DESCR :MIN_THICK :MAX_THICK :PREFERENCE :ADVICE) :COLUMN-NAMES ("Horiz" "Vert" "Space x" "Space y" "Total Dist x" "Total Dist y" "Tool Id" "Descr" "Min Thick" "Max Thick" "Pref" "Advice") :UNITS (:mm :mm :mm :mm :mm :mm nil nil :mm :mm nil nil) :CONTENTS ( (10.00 3.00 3.00 3.00 121.00 32.00 "JLS" "array" 0.60 2.50 :PREF "-") (12.00 3.00 4.00 3.00 115.00 32.00 "JLS" "array" 0.60 2.50 :PREF "-") (15.00 3.00 5.00 3.00 148.00 21.00 "JLS" "array" 0.60 2.50 :PREF "-") (15.00 3.00 4.00 4.00 160.00 40.00 "JLS" "array" 0.60 2.50 :PREF "-") ) :KEY (:HORIZ :VERT :SPACE_X :SPACE_Y :TOT_DIST_X :TOT_DIST_Y ) :DISPLAY (:HORIZ :VERT :SPACE_X :SPACE_Y :TOT_DIST_X :TOT_DIST_Y :PREFERENCE :ADVICE) :FLAT-TEXT (:TOOL_ID) :MENU-ENTRY ("{1}x{2}" :HORIZ :VERT) :HELP "sha_clstr_rect" ; unique, not displayable column entries :PROF_FNC sha-rect-profile ) Code:
(defun sha-rect-profile (&key horiz vert space_x space_y tot_dist_x tot_dist_y &allow-other-keys ) (let* ((result nil) (tool-wp (sha-tool-wp)) (dist_x (+ horiz space_x)) (dist_y (+ vert space_y)) (rows (truncate (/ tot_dist_x dist_x) ) ) (cloumn (truncate (/ tot_dist_y dist_y) ) ) (h (/ horiz 2)) (v (/ vert 2)) (ox (if (evenp rows) (/ (* (- rows 1) dist_x) -2) (/ (* (- (ceiling (/ rows 2) ) 1) dist_x) -1) ) ) (oy (if (evenp column) (/ (* (- column 1) dist_y) -2) (/ (* (- (ceiling (/ column 2) ) 1) dist_y ) -1) ) ) (x 0) (y 0) ) (create_workplane :new :name tool-wp :world_origin ) ;********* create Profile ******* (flet ( (create_rectangle (x y) (POLYGON (gpnt2d (- x h) (- y v)) (gpnt2d (- x h) (+ y v)) (gpnt2d (+ x h) (+ y v)) (gpnt2d (+ x h) (- y v)) (gpnt2d (- x h) (- y v)) ) ) ) (dotimes (i (ceiling column) ) (dotimes (j (ceiling rows) ) (create_rectangle (+ x ox) (+ y oy)) (setf x (+ x dist_x)) ) (progn (setf x 0) (setf y (+ y dist_y)) ) ) ) ;******** create Adjustpoints ****** (C_POINT 0,0 ) (setq result (sha-profile-of-wp tool-wp)) (delete_3d (sha-absolute-name tool-wp)) result ) ) l Code:
(setq dist_x (+ horiz space_x)) (dist_y (+ vert space_y)) (rows (truncate (/ tot_dist_x dist_x) ) ) (cloumn (truncate (/ tot_dist_y dist_y) ) ) to make rectangle hole . but lisp code is wrong somebody can help me
__________________
(Sorry ! My English is pool) Last edited by aris63; 08-08-2004 at 06:40 PM. |
#2
|
|||
|
|||
Re: about sheet metal punch_function
Quote:
but it must like this (x (truncate 5 2) ) or (x ( truncate (/ y 2)) ) The rows and column transform integer if rows =3.2 --> 3.0 rows=3.6 --> 3.0 column=8.3 --> 8.0 column=8.6 --> 8.0 How to do it
__________________
(Sorry ! My English is pool) Last edited by aris63; 08-09-2004 at 09:44 PM. |
#3
|
|||
|
|||
Re: about sheet metal punch_function
Code:
(rows (truncate (/ tot_dist_x dist_x) ) ) (cloumn (truncate (/ tot_dist_y dist_y) ) ) Code:
(rows (truncate (/ (* (/ tot_dist_x dist_x) 2) 2) ) ) (cloumn (truncate (/ (* (/ tot_dist_y dist_y) 2) 2) ) )
__________________
(Sorry ! My English is pool) |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
|
|