(in-package :custom) (use-package :OLI) (sd-defdialog 'tp_bohrer01 :dialog-title (sd-multi-lang-string "Show" :german "Der Bohrer") :toolbox-button t :variables '( ;Anfang Boden Variablen (tainos_akt_wp) ("Maße") (tp_bo_d :value-type :number :initial-value 20 :title "Durchmesser" :prompt-text "Bohrerstärke angeben") (tp_bo_l :value-type :number :initial-value 300 :title "Länge" :prompt-text "Bohrerlänge angeben") (tp_scha_l :value-type :number :initial-value 100 :title "Schaft" :prompt-text "Schaftlänge angeben") (tp_sw01 :value-type :number :initial-value 118 :title "Schneidwinkel" :prompt-text "Schneidwinkel angeben") ("created by t. peter") ) :ok-action '(progn (tp_bo_erstellen) (if tainos_akt_wp (sd-call-cmds (current_wp tainos_akt_wp))) ) :cancel-action '(progn (if tainos_akt_wp (sd-call-cmds (current_wp tainos_akt_wp))) ) :local-functions '( (tp_bo_erstellen() (setq tp_rad01 (/ tp_bo_d 2)) (setq tp_c1 (/ tp_rad01 (cos (sd-deg-to-rad (- tp_sw01 90))))) (setq tp_a1 (* tp_c1 (sin (sd-deg-to-rad (- tp_sw01 90))))) (setq tp_fak (/ tp_rad01 5.5)) (sd-call-cmds (geometry_mode :real)) (sd-call-cmds (create_workplane :new :name "tmp-Ae1")) (sd-call-cmds (line :TWO_POINTS (make-gpnt2d :x 0 :y 0) (make-gpnt2d :x tp_bo_l :y 0))) (sd-call-cmds (line :TWO_POINTS (make-gpnt2d :x tp_bo_l :y 0) (make-gpnt2d :x (- tp_bo_l tp_a1) :y tp_rad01))) (sd-call-cmds (line :TWO_POINTS (make-gpnt2d :x (- tp_bo_l tp_a1) :y tp_rad01) (make-gpnt2d :x 0 :y tp_rad01))) (sd-call-cmds (line :TWO_POINTS (make-gpnt2d :x 0 :y tp_rad01) (make-gpnt2d :x 0 :y 0))) (sd-call-cmds (turn :part "/der_bohrer" :sd-inq-curr-wp :rotation_angle (sd-deg-to-rad 360) :axis :u :keep_profile :no :keep_wp :yes )) (sd-call-cmds (position_pa :part "/der_bohrer" :translate :dir_len :u :len (- (+ tp_scha_l (* tp_rad01 5.5))))) (sd-call-cmds (create_workplane :new :name "tmp-Ae2")) (sd-call-cmds (geometry_mode :real)) (sd-call-cmds (circle :CEN_RAD (make-gpnt2d :x 0 :y (+ tp_rad01 tp_fak)) (make-gpnt2d :x 0 :y (+ (+ tp_rad01 tp_fak) tp_rad01)))) (sd-call-cmds (position_wp "/tmp-Ae2" :rotate :axis :v :rotation_angle (sd-deg-to-rad 27) :done)) (sd-call-cmds (current_wp "/tmp-Ae1")) (sd-call-cmds (helix_dia ;;war HELIX_ADD fhk 20150216 :add_material ;; hinzu fhk 20150216 :blank_part "/tmp_part" :wp "/tmp-Ae2" :axis :u :pitch (* tp_bo_d 6.5) :turns (round(/ tp_bo_l (* tp_bo_d 6.5))) )) (sd-call-cmds (subtract_3d :blanks "/der_bohrer" :tools "/tmp_part" :keep_tool :yes)) (sd-call-cmds (position_pa :part "/der_bohrer" :rotate :axis :u :ROTATION_ANGLE (sd-deg-to-rad 180) :done)) (sd-call-cmds (subtract_3d :blanks "/der_bohrer" :tools "/tmp_part" :keep_tool :no)) (sd-call-cmds (spiral :wire_part "/tmp_spiral" :axis :u :spiral_type :CONICAL-SPIRAL :start_pos (make-gpnt2d :x 0 :y tp_rad01) :end_radius (* tp_rad01 3) :pitch (* tp_bo_d 6.5) :turns 1 :right :on )) (sd-call-cmds (position_pa :part "/tmp_spiral" :rotate :axis :v :ROTATION_ANGLE (sd-deg-to-rad 180) :done)) (sd-call-cmds (position_pa :part "/tmp_spiral" :rotate :axis :u :ROTATION_ANGLE (sd-deg-to-rad 90) :done)) (setq tp_edges (sd-call-cmds (get_selection :focus_type *sd-edge-3d-seltype* :select :selected_part "/tmp_spiral" :all_3d))) (sd-call-cmds (general_sweep_dia ;;war GENERAL_SWEEP_ADD fhk 20150216 :add_material ;; hinzu fhk 20150216 :blank_part "/tmp_sp_sweep" :wp "/tmp-Ae2" :spine (first tp_edges) )) (sd-call-cmds (subtract_3d :blanks "/der_bohrer" :tools "/tmp_sp_sweep" :keep_tool :yes)) (sd-call-cmds (position_pa :part "/der_bohrer" :rotate :axis :u :ROTATION_ANGLE (sd-deg-to-rad 180) :done)) (sd-call-cmds (subtract_3d :blanks "/der_bohrer" :tools "/tmp_sp_sweep" :keep_tool :no)) (sd-call-cmds (current_part "/der_bohrer")) (sd-call-cmds (refine_part :current 2)) (sd-call-cmds (DELETE_3D "/tmp-Ae1")) (sd-call-cmds (DELETE_3D "/tmp-Ae2")) (sd-call-cmds (DELETE_3D "/tmp_spiral")) );Ende dachrgl1 ))