;;--------------------------------------------------------------------------* ;; Modulbeschreibung: ;; Hilfsbolzen ;;--------------------------------------------------------------------------* ;; Dateiname: Hilfsbolzen.lsp ;; Version : 1.0 ;; Datum : 05.2008 ;; Author : Highway - osd.cad.defdialog ;; Beschreibung: Erstellt einen Hilfsbols zur Positionierung ;;--------------------------------------------------------------------------* ;; Version : 1.1 ;; Datum : 23.10.2017 ;; Author : MiBr ;; Erweitert: Achsrichtung für Nullpunkt, Einstellung der Größe ;; Teile/AE bleiben aktiv , Ursprungsfläche Rot ;;--------------------------------------------------------------------------* (in-package :test) (use-package :oli) (sd-defdialog 'hilfsbolzen_erzeugen :dialog-title "3D Hilfsbolzen" :toolbox-button t :after-initialization '(progn (setq Erster_nullp 0)) :help-action '(sd-display-message "Der Hilfsbolzen dient als Hilfe bei der Positionierung") :variables '( ; (PICTURE :value-type ; :image :image-file "\\xxx\\hilfsbolzen.bmp" ; :image-width 170 ; :image-height 100 ; :image-alignment :center) ("-") (KEEP_WP :value-type :boolean :toggle-type :grouped-toggle :title "AE behalten" :initial-value nil) (NULLP_X :toggle-type :wide-toggle :value-type :boolean :indicator-type :none :title "Im Nullpunkt auf X-Achse" :initial-value nil :initial-visible nil :after-input (Nullpunkt_Y)) (NULLP_Y :toggle-type :wide-toggle :value-type :boolean :indicator-type :none :title "Im Nullpunkt auf Y-Achse" :initial-value nil :initial-visible nil :after-input (Nullpunkt_Z)) (NULLP_Z :toggle-type :wide-toggle :value-type :boolean :indicator-type :none :title "Im Nullpunkt auf Z-Achse" :initial-value nil :initial-visible t :after-input (Nullpunkt_X)) ("-") (URSPRUNG :value-type :point-3d :title "Ursprung" :after-input (progn (setq NULLP_X nil) (setq NULLP_Y nil) (setq NULLP_Z nil))) (RICHTUNG :value-type :measure-direction :title "Richtung" :after-input (progn (setq NULLP_X nil) (setq NULLP_Y nil) (setq NULLP_Z nil))) (parameters :title "Einstellung der Größe" :expand-shrink (Bolzen_durch Bolzen_laenge)) (Bolzen_durch :value-type :number :prompt-text "Durchmesser des Bolzen wählen" :title "D/[mm]" :initial-value 20 ) (Bolzen_laenge :value-type :number :prompt-text "Gesamtlänge des Bolzen wählen" :title "Länge/[mm]" :initial-value 50) ) :ok-action '(hilfsbolzen) :local-functions '( (hilfsbolzen () (let ((Default_Part (sd-inq-curr-part)) ;Aktives Teil sichern (Default_WP (sd-inq-curr-wp)) ;Aktive Arbeitsebene sichern ) (sd-call-cmds (create_workplane :new :pt_dir :origin URSPRUNG :normal RICHTUNG)) (sd-call-cmds (uic_c_line_cross 0,0)) (sd-call-cmds (c_circle :cen_dia 0,0 Bolzen_durch)) (sd-call-cmds (geometry_mode :real)) (sd-call-cmds (polygon (oli:make-gpnt2d :x (/ Bolzen_durch 2) :y 0) ;1,0 (oli:make-gpnt2d :x 0 :y 0) ;0,0 (oli:make-gpnt2d :x 0 :y (/ Bolzen_durch 2)))) ;0,1 (sd-call-cmds (arc :3_pos (oli:make-gpnt2d :x 0 :y (/ Bolzen_durch 2)) ;0,1 (oli:make-gpnt2d :x (/ Bolzen_durch 2) :y 0) ;1,0 (oli:make-gpnt2d :x (- 0 (/ Bolzen_durch 2)) :y 0))) ;-1,0 (sd-call-cmds (extrude :part (format nil "/~a" (sd-gen-obj-basename :part :prefix "Hilfsbolzen.")) :distance Bolzen_laenge :keep_profile :no :KEEP_WP (if KEEP_WP :yes :no))) (sd-call-cmds (part_prop (sd-inq-curr-part) :base_density 0.0001 :base_color 10276015 :done :base_trans :semi)) (sd-call-cmds (set_face_Color (sd-call-cmds (get_selection :focus_type *sd-face-seltype* :curr_part_only :select URSPRUNG)) 16733011)) (sd-call-cmds (current_part Default_Part)) ;Gesichertes aktives Teil wieder aktivieren (if KEEP_WP (sd-call-cmds (current_WP Default_WP))) ;Gesicherte Arbeitsebene aktivieren ) ;end let ) ;end Hilfsbolzen (Nullpunkt_X () (if (equal Erster_nullp 0) (progn (setq URSPRUNG 0,0,0) (setq RICHTUNG (list 0,0,1)) (sd-set-variable-status 'NULLP_X :visible nil) (sd-set-variable-status 'NULLP_Y :visible nil) (sd-set-variable-status 'NULLP_Z :visible t) (setq Erster_nullp 1)) (progn (setq URSPRUNG 0,0,0) (setq RICHTUNG (list 1,0,0)) (sd-set-variable-status 'NULLP_X :visible t) (sd-set-variable-status 'NULLP_Y :visible nil) (sd-set-variable-status 'NULLP_Z :visible nil)) ) ) ;end Nullpunkt (Nullpunkt_Y () (setq URSPRUNG 0,0,0) (setq RICHTUNG (list 0,1,0)) (sd-set-variable-status 'NULLP_X :visible nil) (sd-set-variable-status 'NULLP_Y :visible t) (sd-set-variable-status 'NULLP_Z :visible nil) ) ;end Nullpunkt (Nullpunkt_Z () (setq URSPRUNG 0,0,0) (setq RICHTUNG (list 0,0,1)) (sd-set-variable-status 'NULLP_X :visible nil) (sd-set-variable-status 'NULLP_Y :visible nil) (sd-set-variable-status 'NULLP_Z :visible t) ) ;end Nullpunkt ) ; end local-functions ) ; end dialog