;********************************************************************************************* ; Dateiname : SD_Move.lsp ; Autor : wz (geklaut von DC4/CAD.DE) ; Erstellt : 28.01.2008 ; geändert : ;********************************************************************************************* ; Beschreibung: - Bewegen von Teilen mit Positionierungsfunktionen ; - ;********************************************************************************************* ; Änderungen ; ;********************************************************************************************* (in-package :teo) (use-package :oli) (sd-defdialog 'SD_Move :dialog-title "Move NT" :toolbox-button t :variables '( ;;================================================================================================ ;;=========== zu positionierendes Objekt & Besitzer auswählen ==================================== ;;================================================================================================ ("Teil-/Baugruppenwahl") (TempBG :value-type :part-assembly ; :initial-value nil :modifies :instance :after-input (progn (setf partassy TempBG) (fensterauf) );progn :title "Teil/Bg." );;TempBG (Besitzer :value-type :assembly :modifies :instance :initial-optional t :initial-value "/" );;Besitzer ;;================================================================================================ ;;=========== Kreiskante-Kreiskante ============================================================== ;;================================================================================================ ("Kreiskante-Kreiskante") (linie1 :value-type :edge :modifies nil :title "Kreisk.beweg." :initial-optional T :after-input (progn (sd-set-variable-status 'linie2 :optional nil ) (when (and linie1 linie2) (sd-set-variable-status 'next :enable t) );;if );;progn );;linie1 (linie2 :value-type :edge :modifies nil :initial-optional T :title "Kreisk.fest" :after-input (progn (when (and linie1 linie2) (sd-set-variable-status 'next :enable t) );;if (inlinie) );;progn );;linie2 (next :title "umkehren" :initial-enable nil :push-action (progn (sd-call-cmds (position_pa TempBG :rotate :axis circen2 cirstart2 :rotation_angle pi );;position_pa );;sd-call-cmds );;progn );;next ;;================================================================================================ ;;=========== Kegel-Kegel ======================================================================== ;;================================================================================================ ("Kegel-Kegel") (kgbew :value-type :face :prompt-text "Zu bewegende Flaeche angeben" :title "bew. Kegel" :initial-optional t :check-function #'(lambda (flach) (if (sd-cone-p (sd-inq-geo-props flach)) :ok (values :error (sd-multi-lang-string "Conical Surface Only!" :german "Nur Kegelflaechen erlaubt!")) );;if );;check-function :after-input (kegel-kegel-action);;OK :next-variable kgfest );;kgbew (kgfest :value-type :face :prompt-text (sd-multi-lang-string "Pick Countersink" :german "Feste Flaeche angeben") :title (sd-multi-lang-string "Countersink" :german "fest. Kegel") :initial-optional t :check-function #'(lambda (flach) (if (sd-cone-p (sd-inq-geo-props flach)) :ok (values :error (sd-multi-lang-string "Conical Surface Only!" :german "Nur Kegelflaechen erlaubt!")))) :after-input (kegel-kegel-action);;OK );;kgfest ;;================================================================================================ ;;=========== kegel-kante ======================================================================== ;;================================================================================================ ("kegel-kante") (kgbew2 :value-type :face :prompt-text "Zu bewegende Flaeche angeben" :title "Kegel" :initial-optional t :check-function #'(lambda (flach) (if (sd-cone-p (sd-inq-geo-props flach)) :ok (values :error (sd-multi-lang-string "Conical Surface Only!" :german "Nur Kegelflaechen erlaubt!")) );;if );;check-function :after-input (kegel-kante-action) :next-variable kant );;kgbew2 (kant :selection (*sd-circle-3d-seltype* *sd-arc-3d-seltype*) :title "Kante" :prompt-text "KreisfÎrmige Kante angeben" :initial-optional t :multiple-items nil :check-function #'(lambda (kant) (if (or (sd-call-cmds (get_selection :focus_type *sd-cylinder-seltype* :select :by_edge_3d kant)) (sd-call-cmds (get_selection :focus_type *sd-cone-seltype* :select :by_edge_3d kant)) );;or :ok (values :error (sd-multi-lang-string "No Adjacent Drilling Found!" :german "Keine angrenzende Bohrung gefunden!")) );;if );;check-function :after-input (kegel-kante-action) );;kant (umk :push-action (kegel-umk-action) :title "umkehren" :initial-enable nil );;umk ;;================================================================================================ ;;=========== kugel-kegel ======================================================================== ;;================================================================================================ ("kugel-kegel ") (kugel :value-type :face :prompt-text "Zu bewegende Kugelflaeche angeben" :title "Kugel" :initial-optional t :check-function #'(lambda (flach) (if (sd-sphere-p (sd-inq-geo-props flach)) :ok (values :error "Nur Kugelflaechen erlaubt!") );;if );;check-function :after-input (kugel-kegel-action) ;;OK :next-variable kegel );;kugel (kegel :value-type :face :prompt-text "Feste Flaeche angeben" :title "fest. Kegel" :initial-optional t :check-function #'(lambda (flach) (if (sd-cone-p (sd-inq-geo-props flach)) :ok (values :error "Nur Kegelflaechen erlaubt!") );;if );;check-function :after-input (kugel-kegel-action) ;;OK );;kegel (kugelrot :push-action (kugelrot-action) ;;OK :title "umkehren" :initial-enable nil );;kugelrot ;;================================================================================================ ;;=========== freies positionieren =============================================================== ;;================================================================================================ ("freies positionieren") (POSITIONING :title "positionieren" :toogle-type :wide-toogle :position-part TempBG );;POSITIONING ;;================================================================================================ ;;=========== Zusatzfenster ====================================================================== ;;================================================================================================ ("Fenstertools") (fensteropen :push-action (progn (fensterauf) );;progn :title "AUF" );;fensteropen (fensteloesch :push-action (progn (fensterzu) ); Ende progn :title "ZU" );;fensteloesch ) ;end variables :ok-action '( progn (wechslebaugruppe) (fensterzu) );end progn :cancel-action '(progn (fensterzu) );end Progn :help-action '(progn (sd-display-url ( Format NIL "~A/SD_Move.htm" (oli::sd-convert-filename-from-platform (oli::sd-sys-getenv "SCHILLERHELPDIR")))) ); end progn :local-functions '( ;;================================================================================================ ;;=========== kegel-kegel ausrichten ============================================================= ;;================================================================================================ (kegel-kegel-action () (let (blist flist p1b p2b p3b p1f p2f p3f) (sd-set-variable-status 'kgbew :optional nil) (sd-set-variable-status 'kgfest :optional nil) (when (and kgbew kgfest) (progn (setf blist (dc4-teilpos-get-cone-dir kgbew)) (setf flist (dc4-teilpos-get-cone-dir kgfest)) (setf p1b (first blist)) (setf p2b (second blist)) (setf p3b (third blist)) (setf p1f (first flist)) (setf p2f (second flist)) (setf p3f (third flist)) (sd-call-cmds (position_pa (sd-inq-obj-pathname partassy) :match_pt_dir_pt p1b p1f p2b p2f p3b p3f)) (sd-set-variable-status 'kgbew :optional t) (sd-set-variable-status 'kgfest :optional t) (setf kgbew nil) (setf kgfest nil) );;progn );;when );;let );;kegel-kegel-action ;;================================================================================================ ;;=========== kegel-kante ausrichten ============================================================= ;;================================================================================================ (kegel-kante-action () (let (blist flist p1b p2b p3b p1f p2f p3f rad ang) (sd-set-variable-status 'kgbew2 :optional nil) (sd-set-variable-status 'kant :optional nil) (sd-set-variable-status 'umk :enable t) (when (and kgbew2 kant) (progn (setf blist (dc4-teilpos-get-cone-dir kgbew2)) (setf flist (dc4-teilpos-get-axis-dir kant)) (setf p1b (first blist)) (setf p2b (second blist)) (setf p3b (third blist)) (setf p1f (first flist)) (setf p2f (second flist)) (setf p3f (third flist)) (setf rad (sd-circle-radius (sd-inq-geo-props kant :dest-space :global))) (setf ang (sd-cone-angle (sd-inq-geo-props kgbew2 :dest-space :global))) (setf p1f (sd-vec-subtract p1f (sd-vec-scale p2f (/ rad (tan ang))))) (sd-call-cmds (position_pa (sd-inq-obj-pathname partassy) :match_pt_dir_pt p1b p1f p2b p2f p3b p3f)) (sd-set-variable-status 'kgbew2 :optional t) (sd-set-variable-status 'kant :optional t) );;progn );;when );;let );;kegel-kante-action ;;================================================================================================ ;;=========== kugel-kegel ======================================================================== ;;================================================================================================ (kugel-kegel-action () (let (blist flist p1b p2b p3b p1f p2f p3f rad ang) (sd-set-variable-status 'kugelrot :enable t) (sd-set-variable-status 'kugel :optional nil) (sd-set-variable-status 'kegel :optional nil) (when (and kugel kegel) (progn (setf blist (dc4-teilpos-get-sphere-dir kugel)) (setf flist (dc4-teilpos-get-cone-dir kegel)) (setf p1b (first blist)) (setf p2b (second blist)) (setf p3b (third blist)) (setf p1f (first flist)) (setf p2f (second flist)) (setf p3f (third flist)) (setf rad (sd-sphere-radius (sd-inq-geo-props kugel :dest-space :global))) (setf ang (sd-cone-angle (sd-inq-geo-props kegel :dest-space :global))) (setf p1f (sd-vec-add p1f (sd-vec-scale p2f (/ rad (sin ang))))) (sd-call-cmds (position_pa (sd-inq-obj-pathname partassy) :match_pt_dir_pt p1b p1f p2b p2f p3b p3f)) (sd-set-variable-status 'kugel :optional t) (sd-set-variable-status 'kegel :optional t) );;progn );;when );;let );;kugel-kegel-action ;;================================================================================================ ;;=========== Kugel umkehren ===================================================================== ;;================================================================================================ (kugelrot-action () (let (blist flist p1b p2b p3b p1f p2f p3f rad ang) (when kugel (progn (setf blist (dc4-teilpos-get-sphere-dir kugel)) (setf flist blist) (setf p1b (first blist)) (setf p2b (second blist)) (setf p3b (third blist)) (setf p1f (first flist)) (setf p2f (second flist)) (setf p3f (third flist)) (setf p2f (sd-vec-scale p2f -1)) (sd-call-cmds (position_pa (sd-inq-obj-pathname partassy) :match_pt_dir_pt p1b p1f p2b p2f p3b p3f)) (sd-set-variable-status 'kugel :optional t) (sd-set-variable-status 'kegel :optional t) (setf kkugel nil) (setf kkegel nil) );;progn );;when );;let );;kugelrot-action ;;================================================================================================ ;;=========== Kegel umkehren ===================================================================== ;;================================================================================================ (kegel-umk-action () (let (flist p1f p2f p3f) (when kant (progn (setf flist (dc4-teilpos-get-axis-dir kant)) (setf p1f (first flist)) (setf p2f (second flist)) (setf p3f (third flist)) (sd-call-cmds (position_pa (sd-inq-obj-pathname partassy) :rotate :axis :two_pta p1f p3f :rotation_angle pi)) );;progn );;when );;let );;kegel-umk-action ;;================================================================================================ ;;=========== Besitzer zuweisen ================================================================== ;;================================================================================================ (wechslebaugruppe () (sd-call-cmds (change_pa_owner :new_owner Besitzer :parts_assemblies TempBG )) );endewechslebaugruppe ;;================================================================================================ ;;=========== Kreiskante-Kreiskante ausrichten =================================================== ;;================================================================================================ (inlinie() (setf datis1 (sd-inq-geo-props linie1 :dest-space :global)) (setf circen1 (sd-circle-center datis1)) (setf cirnor1 (sd-circle-normal datis1)) (setf cirstart1 (sd-circle-start-dir datis1)) (setf cirrad1 (sd-circle-radius datis1)) (setq flaechen1 (car (sd-call-cmds (get_selection :focus_type *sd-plane-seltype* :select :by_edge_3d linie1 )))) (setq cylfl1 (car (sd-call-cmds (get_selection :focus_type *sd-cylinder-seltype* :select :by_edge_3d linie1 )))) (setq allfl1 (car (sd-call-cmds (get_selection :focus_type *sd-face-seltype* :select :by_edge_3d linie1 )))) (setq confl1 (car (sd-call-cmds (get_selection :focus_type *sd-cone-seltype* :select :by_edge_3d linie1 )))) (setq spherfl1 (car (sd-call-cmds (get_selection :focus_type *sd-sphere-seltype* :select :by_edge_3d linie1 )))) (setf flaeinq1 (sd-inq-geo-props flaechen1 :dest-space :global)) (setf cylflinq1 (sd-inq-geo-props cylfl1 :dest-space :global)) (setf conflinq1 (sd-inq-geo-props confl1 :dest-space :global)) (setf spherflinq1 (sd-inq-geo-props spherfl1 :dest-space :global)) (cond ((and flaechen1 flaechen1) (progn ;(display "in flaechen") (setf flaeinq1 (sd-inq-geo-props flaechen1 :dest-space :global)) (setf flnor1 (sd-plane-normal flaeinq1)) );endprogn ) ((and cylfl1 cylfl1) (progn ;(display "in cylfl") (setf flnor1 (SD-CYLINDER-AXIS-DIR cylflinq1)) ;(display "nach sd-c