;*******************************;************************************************************** ; Dateiname : Sd_Ausrichten.lsp ; Autor : wz ; Erstellt : 22.10.2007 ; geändert : ;********************************************************************************************* ; Beschreibung : -> Richtet Teil aus und vierschiebt zum Nullpunkt ; - ;********************************************************************************************* ; ---------------------------------------------------------------------------------------- ; ä Ì Ä Ø ö Î Ö Ú ü Ï Ü Û ß Þ ° ³ ; ---------------------------------------------------------------------------------------- (use-package :oli) (sd-defdialog 'SD_Ausrichten :toolbox-button t :variables '( ;; ---------------------------------------------------------------------------------------------------------------------------------------------------- (Objekt :value-type :part-assembly :prompt-text "Teil oder Baugruppe wÌhlen" :title "Objekt" :modifies nil :initial-value nil :initial-enable t );end Objekt ;; ---------------------------------------------------------------------------------------------------------------------------------------------------- (ORIGIN :value-type :point-3d :prompt-text "Punkt wÌhlen der auf dem globalen Nullpunkt liegen soll" :title "Ursprung" :initial-value nil );end ORIGIN ;; ---------------------------------------------------------------------------------------------------------------------------------------------------- (Vorderansicht :value-type :measure-direction :prompt-text "FlÌche/Richtung wÌhlen die Vorderseite darstellt" :built-in-feedback t :title "Vorderansicht" );end Vorderansicht ;; ---------------------------------------------------------------------------------------------------------------------------------------------------- (Draufsicht :value-type :measure-direction :prompt-text "FlÌche/Richtung wÌhlen die Draufsicht darstellt" :built-in-feedback t :title "Draufsicht" );end Draufsicht ;; ---------------------------------------------------------------------------------------------------------------------------------------------------- ) ;; end variables :local-functions '( ;; ---------------------------------------------------------------------------------------------------------------------------------------------------- ;; Funktion zum Neupositionieren von Objekt (MoveHome () (sd-call-cmds (position_pa Objekt :by_ref_coord_sys :pos_obj_coord_sys (format nil "~A/DummyKoSys" (sd-inq-obj-pathname Objekt)) :ref_coord_sys "/Alignpart/AlignKoSys" );end position_pa );end sd-call-cmds );; end MoveHome ;; ---------------------------------------------------------------------------------------------------------------------------------------------------- ;; Funktion zum erstellen eines Dummyteils mit Koordinatensystenm (CreateAglinPart () (progn ;; Arbeitsebene erstellen (sd-call-cmds (create_workplane :new :name "TEMP-AE" :owner "/" ;; The default orientation corresponds to the global coordinate system, (wp origin: 0,0,0; u-axis: 1,0,0; v-axis: 0,1,0; normal: 0,0,1). );end create_workplane );end sd-call-cmds ;; Rechteck zeichnen (sd-call-cmds (RECTANGLE 0,0 10,10)) ;; Teil erstellen (sd-call-cmds (create_part :owner "/" :name "Alignpart")) ;; Rechteck extrudieren (sd-call-cmds (extrude :part "/Alignpart" :auto_direction :yes :keep_wp :no :Type :DISTANCE_TYPE :distance 10.00 );end extrude );end sd-call-cmds ;; Koordinatensystem erstellen (sd-call-cmds (pos_create_coordinate_system :action :create :owner "/Alignpart" :name "AlignKoSys" :pt_dir :point 0,0,0 :w_axis 0,0,1 :u_axis 0,1,0 );end create_workplane );end sd-call-cmds );end progn );end CreateAglinPart ;; ---------------------------------------------------------------------------------------------------------------------------------------------------- ;; Koordinatensystem an Objekt erstellen (CreateCoordinateSystem () (sd-call-cmds (pos_create_coordinate_system :action :create :owner objekt :name "DummyKoSys" :pt_dir :point origin :w_axis (first Vorderansicht) :u_axis (first Draufsicht) );end pos_create_coordinate_system );end sd-call-cmds );end CreateCoordinateSystem ;; ---------------------------------------------------------------------------------------------------------------------------------------------------- ;; Hilfsteil und -koordinatensystem löschen (DeleteObsoleteObjects () (delete_3d (format nil "~A/DummyKoSys" (sd-inq-obj-pathname Objekt))) (delete_3d "/Alignpart") );end DeleteObsoleteObjects ;; ---------------------------------------------------------------------------------------------------------------------------------------------------- ;; ---------------------------------------------------------------------------------------------------------------------------------------------------- ); end local-functions :ok-action '(progn (CreateAglinPart) (CreateCoordinateSystem) (MoveHome) );end progn :cleanup-action '(progn (DeleteObsoleteObjects) );end progn ) ;; end defdialog