Files
Walz/STEUERG/AUSGAENGE_F_LSP.old
T

393 lines
13 KiB
Plaintext

;------------------------------------------------------------------------;
; AUSGAENGE_F ;
;------------------------------------------------------------------------;
; 30.09.2007 ;
;------------------------------------------------------------------------;
(defun Dbox (/ Dat)
(setq Dat (load_dialog (strcat lw "/acadsst/steuerg/AUSGAENGE_F.DCL")))
(if (not (new_dialog "AUSGAENGE_F" Dat)) (exit))
(set_tile "DWG_NAME" m_DWG_NAME); Blockname
(set_tile "INPUT" m_INPUT)
(set_tile "IDENT" m_IDENT)
(set_tile "COMPONENT" m_COMPONENT)
(set_tile "BEZEICHNUNG" m_BEZEICHNUNG)
(set_tile "KENNZEICHNUNG" m_KENNZEICHNUNG)
(set_tile "FAKT" m_FAKT)
(set_tile "ZUSATZ" m_ZUSATZ)
(set_tile "PREFIX" m_PREFIX) ; B,S oder E
(set_tile "IO-BEZ" m_IO-BEZ)
(set_tile "IO-BEZ-RECHTS" m_IO-BEZ-RECHTS)
(mode_tile "anzeige" 0)
(SetDia)
(ACTION_TILE "DWG_NAME" "(zeig_dia)")
(action_tile "accept" "(SetPara) (done_dialog)")
(action_tile "cancel" "(exit) (done_dialog)")
(start_dialog)
(unload_dialog Dat)
)
(defun SetDia()
(setq breite (dimx_tile "anzeige"))
(setq hoehe (dimy_tile "anzeige"))
(start_image "anzeige")
(FILL_IMAGE 0 0 breite hoehe -18)
(cond
((= m_DWG_NAME "0")
(slide_image 0 0 breite hoehe "ils2100(i00)")
)
((= m_DWG_NAME "1")
(slide_image 0 0 breite hoehe "steuerg(kab20)")
)
((= m_DWG_NAME "2")
(slide_image 0 0 breite hoehe "steuerg(kab02)")
)
((= m_DWG_NAME "3")
(slide_image 0 0 breite hoehe "steuerg(kab03)")
)
((= m_DWG_NAME "4")
(slide_image 0 0 breite hoehe "steuerg(kab05)")
)
((= m_DWG_NAME "5")
(slide_image 0 0 breite hoehe "steuerg(kab10)")
)
((= m_DWG_NAME "6")
(slide_image 0 0 breite hoehe "steuerg(pn_reib)")
)
((= m_DWG_NAME "7")
(slide_image 0 0 breite hoehe "steuerg(pn_reibs)")
)
) ; end cond
(end_image)
)
(defun zeig_dia()
(setq WINKEL1 0)
(setq m_DWG_NAME (get_tile "DWG_NAME"))
(setq m_COMPONENT (get_tile "COMPONENT"))
(setq m_PREFIX (get_tile "PREFIX"))
(setq m_FAKT (get_tile "FAKT"))
(setq m_ZUSATZ (get_tile "ZUSATZ"))
(setq m_IO-BEZ (get_tile "IO-BEZ"))
(setq m_IO-BEZ-RECHTS (get_tile "IO-BEZ-RECHTS"))
(SetDia)
)
(defun setpara()
(setq m_PREFIX (get_tile "PREFIX"))
(setq m_INPUT (get_tile "INPUT"))
(setq m_IDENT (get_tile "IDENT"))
(setq m_COMPONENT (get_tile "COMPONENT"))
(setq m_BEZEICHNUNG (get_tile "BEZEICHNUNG"))
(setq m_KENNZEICHNUNG (get_tile "KENNZEICHNUNG"))
(setq m_DWG_NAME (get_tile "DWG_NAME"))
(setq m_FAKT (get_tile "FAKT"))
(setq m_IO-BEZ (get_tile "IO-BEZ"))
(setq m_IO-BEZ-RECHTS (get_tile "IO-BEZ-RECHTS"))
(setq m_ZUSATZ (get_tile "ZUSATZ"))
(setq FAKTO (atof m_FAKT))
(InputStringAnalyse)
)
(defun InputStringAnalyse()
(setq DisplayString "")
(setq InputLaenge (strlen m_INPUT))
; (alert (itoa InputLaenge))
(if (or (> InputLaenge 4) (= InputLaenge 0))
(progn
(alert "Mehr als 4 Stellen nicht bzw. LEERE Eingabe nicht erlaubt")
(exit)
)
)
(cond
((= InputLaenge 1)
(setq DisplayString (strcat "000" m_INPUT))
)
((= InputLaenge 2)
(setq DisplayString (strcat "00" m_INPUT))
)
((= InputLaenge 3)
(setq DisplayString (strcat "0" m_INPUT))
)
((= InputLaenge 4)
(setq DisplayString m_INPUT)
)
) ; end cond
(cond
((= m_COMPONENT "0")
(if (> (strlen m_ZUSATZ) 0 )
(progn
(setq VERWENDUNG m_ZUSATZ)
(setq m_IDENT "9999")
)
(progn
(setq VERWENDUNG "NO-ID")
(setq m_IDENT "9999")
)
)
)
) ; end cond
; (alert verwendung)
)
(defun datain ()
(setq dummy nil)
)
(defun geometrie()
(cond
((= m_DWG_NAME "0")
(setq BL_NAME "") ;Blinde Eintragung
(setq BEZEICHNUNG "")
(setq BEZ1 "")
(setq BEZ2 "")
(setq BEZEICHNUNG_BG "")
)
((= m_DWG_NAME "1")
(setq BL_NAME "720000002") ; ASI Kabel 20 M für SMC Pneumatik für Weiche
(setq BEZEICHNUNG "ASI-KABEL 20M F.SMC F.WEICHE")
(setq BEZEICHNUNG_BG "")
(setq BEZ1 "SW")
(setq BEZ2 "20M")
)
((= m_DWG_NAME "2")
(setq BL_NAME "722001121") ; ASI Kabel 2 M für SMC Pneumatik für Weiche
(setq BEZEICHNUNG "ASI-KABEL 2M F.SMC F.WEICHE")
(setq BEZEICHNUNG_BG "")
(setq BEZ1 "SW")
(setq BEZ2 "2M")
)
((= m_DWG_NAME "3")
(setq BL_NAME "722001122") ; ASI Kabel 3 M für SMC Pneumatik für Weiche
(setq BEZEICHNUNG "ASI-KABEL 3M F.SMC F.WEICHE")
(setq BEZEICHNUNG_BG "")
(setq BEZ1 "SW")
(setq BEZ2 "3M")
)
((= m_DWG_NAME "4")
(setq BL_NAME "722001123") ; ASI Kabel 5 M für SMC Pneumatik für Weiche
(setq BEZEICHNUNG "ASI-KABEL 5M F.SMC F.WEICHE")
(setq BEZEICHNUNG_BG "")
(setq BEZ1 "SW")
(setq BEZ2 "5M")
)
((= m_DWG_NAME "5")
(setq BL_NAME "722001124") ; ASI Kabel 10 M für SMC Pneumatik für Weiche
(setq BEZEICHNUNG "ASI-KABEL 10M F.SMC F.WEICHE")
(setq BEZEICHNUNG_BG "")
(setq BEZ1 "SW")
(setq BEZ2 "10M")
)
((= m_DWG_NAME "6")
(setq BL_NAME "722000015") ; Ansteuerung Reibrad mit 30 M Kabel
(setq BEZEICHNUNG "ANSTEUERUNG REIBRAD MIT KABEL")
(setq BEZEICHNUNG_BG "")
(setq BEZ1 "RR")
(setq BEZ2 "NOKAB")
)
((= m_DWG_NAME "7")
(setq BL_NAME "722000015") ; Ansteuerung Reibrad mit 30 M Kabel und ASI Stecker
(setq BEZEICHNUNG "ANSTEUERUNG REIBRAD MIT KABEL")
(setq BEZEICHNUNG_BG "ANSTEUERUNG REIBRAD MIT KABEL UND STECKER")
(setq BEZ1 "RR")
(setq BEZ2 "+KAB")
)
) ; end cond
(cond
((= m_PREFIX "PREFIX_1")
(setq _PREFIX "M")
(setq ANZ_CHARACT 0)
)
((= m_PREFIX "PREFIX_2")
(setq _PREFIX "Y")
(setq ANZ_CHARACT 0)
)
((= m_PREFIX "PREFIX_3")
(setq _PREFIX "A")
(setq ANZ_CHARACT 0)
)
((= m_PREFIX "PREFIX_4")
(setq _PREFIX "K")
(setq ANZ_CHARACT 0)
)
((= m_PREFIX "PREFIX_5")
(setq _PREFIX "H")
(setq ANZ_CHARACT 0)
)
((= m_PREFIX "PREFIX_6")
(setq _PREFIX "LT")
(setq ANZ_CHARACT 1)
)
((= m_PREFIX "PREFIX_7")
(setq _PREFIX "SOL")
(setq ANZ_CHARACT 2)
)
((= m_PREFIX "PREFIX_8")
(setq _PREFIX "MTR")
(setq ANZ_CHARACT 2)
)
((= m_PREFIX "PREFIX_9")
(setq _PREFIX "O")
(setq ANZ_CHARACT 0)
)
)
(setq AUSWAHL-SATZ-ROTATE nil) ; wird am Ende ROTATE
(setq AUSWAHL-SATZ nil) ; Blockbildung
(setq P0 (getpoint "\nPick insert point: "))
(setvar "osmode" 0)
(bl-name P0) ;--> Block-Name definieren -> Rückgabe: element-name
(setq P10 (list (+ (car p0) (+ (* FAKTO 1170)) (* 150 ANZ_CHARACT)) (+ (cadr p0) (* FAKTO 0)) (caddr p0)))
(setq P11 (list (+ (car p0) (+ (* FAKTO 1170)) (* 150 ANZ_CHARACT)) (- (cadr p0) (* FAKTO 330)) (caddr p0)))
(setq P12 (list (+ (car p0) (* FAKTO 0)) (- (cadr p0) (* FAKTO 330)) (caddr p0)))
(setq P13 (list (+ (car p0) (* FAKTO 340)) (+ (cadr p0) (* FAKTO 0)) (caddr p0)))
(setq P14 (list (+ (car p0) (* FAKTO 340)) (- (cadr p0) (* FAKTO 330)) (caddr p0)))
;<<<Text>>>
(setq P1 (list (+ (car p12) (* FAKTO 380)) (+ (cadr p12) (* FAKTO 90)) (caddr p12)))
(setq P2 (list (+ (car p12) (* FAKTO 550)) (+ (cadr p12) (* FAKTO 90)) (caddr p12)))
(setq P3 (list (+ (car p12) (* FAKTO 20)) (+ (cadr p12) (* FAKTO 220)) (caddr p12)))
(setq P4 (list (+ (car p12) (* FAKTO 20)) (+ (cadr p12) (* FAKTO 120)) (caddr p12)))
(setq P5 (list (+ (car p12) (* FAKTO 20)) (+ (cadr p12) (* FAKTO 10)) (caddr p12)))
(setq P6 (list (+ (car p12) (* FAKTO 20)) (+ (cadr p12) (* FAKTO 20)) (caddr p12)))
(setq P7 (list (+ (car p12) (* FAKTO 1200)) (+ (cadr p12) (* FAKTO 100)) (caddr p12)))
(command "_layer" "_m" "AUSGANG" "_c" "3" "" "")
;<<< IO Einfügen
(command "_insert" (strcat lw "/acadsst/steuerg/io") P6 FAKTO "" "")
(if (= m_IO-BEZ "1") ; IO-Bezeichnung = Artikelbezeichnung
(ATTRIBUTE-AENDERN_IO (strcat _PREFIX DisplayString) m_IDENT VERWENDUNG BEZEICHNUNG m_KENNZEICHNUNG)
(ATTRIBUTE-AENDERN_IO (strcat _PREFIX DisplayString) m_IDENT VERWENDUNG m_BEZEICHNUNG m_KENNZEICHNUNG)
)
(setq AUSWAHL-SATZ-ROTATE (ssget "_L"))
;>>> Byteweise arbeiten. Wenn die letzte Zahl "7" dann auf "10" aufrunden
(setq LAENGE_m_INPUT (strlen m_INPUT))
(if (= (substr m_INPUT LAENGE_m_INPUT 1) "7")
(setq m_INPUT (itoa (+ 3 (atoi m_INPUT))))
(setq m_INPUT (itoa (+ 1 (atoi m_INPUT))))
)
;<<< Korpus zeichnen ---------------------------------------
(command "_layer" "_m" "EINGANG-HW" "_c" "7" "" "")
(command "_pline" P0 P10 P11 P12 P0 "")
(setq AUSWAHL-SATZ (ssget "_L"))
(ssadd (entlast) AUSWAHL-SATZ-ROTATE)
(command "_pline" P13 P14 "")
(ssadd (entlast) AUSWAHL-SATZ)
(ssadd (entlast) AUSWAHL-SATZ-ROTATE)
;<<< Beschreibung als Text hinzufügen
(command "_text" P3 (rtos (* FAKTO 70)) "0" BEZ1)
(ssadd (entlast) AUSWAHL-SATZ)
(ssadd (entlast) AUSWAHL-SATZ-ROTATE)
(command "_text" P4 (rtos (* FAKTO 70)) "0" BEZ2)
(ssadd (entlast) AUSWAHL-SATZ)
(ssadd (entlast) AUSWAHL-SATZ-ROTATE)
; ;<<<< Zusatztext >>>>>>>
; (if (and (> (strlen m_ZUSATZ) 0 ) (/= m_COMPONENT "8"))
; (progn
; (setq x_length (+ 1170 (* (strlen m_Zusatz) 160)))
; (setq P15 (list (+ (car p0) (* FAKTO x_length)) (+ (cadr p0) (* FAKTO 0)) (caddr p0))) ;Zusatztext
; (setq P16 (list (+ (car p0) (* FAKTO x_length)) (- (cadr p0) (* FAKTO 330)) (caddr p0))) ;Zusatztext
; (command "_text" P7 (rtos (* FAKTO 150)) "0" m_ZUSATZ)
; (ssadd (entlast) AUSWAHL-SATZ)
; (ssadd (entlast) AUSWAHL-SATZ-ROTATE)
; (command "_pline" P10 P15 "")
; (ssadd (entlast) AUSWAHL-SATZ)
; (ssadd (entlast) AUSWAHL-SATZ-ROTATE)
; (command "_pline" P15 P16 "")
; (ssadd (entlast) AUSWAHL-SATZ)
; (ssadd (entlast) AUSWAHL-SATZ-ROTATE)
; (command "_pline" P16 P11 "")
; (ssadd (entlast) AUSWAHL-SATZ)
; (ssadd (entlast) AUSWAHL-SATZ-ROTATE)
; )
; (progn
(setq P15 (list (car p10) (cadr p10) (caddr p10)))
(setq P16 (list (car p11) (cadr p11) (caddr p11)))
; )
; )
;<<<<<<<<< IO-Bezeichnung auch als TEXT rechts einfügen
(if (= m_IO-BEZ-RECHTS "1")
(progn
(setq P8 (list (+ (car p16) (* FAKTO 100)) (+ (cadr p16) (* FAKTO 100)) (caddr p16)))
(command "_text" P8 (rtos (* FAKTO 150)) "0" m_BEZEICHNUNG)
(ssadd (entlast) AUSWAHL-SATZ-ROTATE)
)
)
(if (= m_DWG_NAME "0")
(progn
(mach-block-ohne-prop P0 "0" AUSWAHL-SATZ)
)
(progn
(mach-block P0 "0" AUSWAHL-SATZ)
(attribute-aendern "0" "0" "9" "0" (strcat _PREFIX DisplayString) block-kennung BL_NAME BEZEICHNUNG "1" "")
)
)
(ssadd (entlast) AUSWAHL-SATZ-ROTATE)
(setq AUSWAHL-SATZ (ssget "_L")) ; Auswahlsatz reinitialieren
:<<<-------------------------------------------------------------------
;<<<< BAUGRUPPEN >>>
(if (= m_DWG_NAME "7")
(progn
(EINZELTEIL P0 "722003015" "VENTILSTECKER ASI-SEITE" "1")
(command "_layer" "_m" "A-GRUPPE" "_c" "7" "" "")
(mach-block P0 "0" AUSWAHL-SATZ)
(attribute-aendern "0" "2" "9" "0" (strcat _PREFIX DisplayString) block-kennung "333333333" BEZEICHNUNG_BG "1" "")
(ssadd (entlast) AUSWAHL-SATZ-ROTATE)
)
)
(command "_rotate" AUSWAHL-SATZ-ROTATE "" P0 pause)
)
(defun EINZELTEIL (P1 E_ARTINR E_BEZEICHNUNG E_MENGE)
(setq WINKEL1 (+ WINKEL1 10))
(command "_insert" (strcat lw "/acadsst/steuerg/d_einzel") P0 "" "" (rtos WINKEL1))
(attribute-aendern "0" "0" "29" "" "" block-kennung E_ARTINR E_BEZEICHNUNG E_MENGE "")
(ssadd (entlast) AUSWAHL-SATZ)
)
;------------------------------------------------------------------------------
(defun c:AUSGAENGE_F ( / DWG_NAME BL_NAME P0)
(setvar "limcheck" 0)
(setvar "CMDECHO" 0)
(setvar "BLIPMODE" 0)
(setq ALTFANG (getvar "osmode"))
(setq EINZEL 0) ; fuer EINZEL=0 Baugruppen / EINZEL=1 fuer APB
(prompt "**** AUSGÄNGE SPINNEREI *******")
(prompt "")
(if (null m_DWG_NAME) (setq m_DWG_NAME "0")) ; Auswahl
(if (null m_INPUT) (setq m_INPUT "1")) ; Input Bit
(if (null m_IDENT) (setq m_IDENT "1000")) ; ID
(if (null m_COMPONENT) (setq m_COMPONENT "0")) ; Verwendung
(if (null m_BEZEICHNUNG) (setq m_BEZEICHNUNG "xxxxxxxxxxxxxxx")) ; BEZEICHNUNG
(if (null m_KENNZEICHNUNG) (setq m_KENNZEICHNUNG "=Axx+Exxx-Axxx")) ; KENNZEICHNUNG
(if (null m_FAKT) (setq m_FAKT "1")) ; Skalierungsfaktor
(if (null m_ZUSATZ) (setq m_ZUSATZ "")) ; Zusatztext
(if (null m_PREFIX) (setq m_PREFIX "PREFIX_1")) ; Prefix (B,E oder S)
(if (null m_IO-BEZ) (setq m_IO-BEZ "0")) ; Bezeicnung nicht der Artikelbezeichnung gleichsetzen
(if (null m_IO-BEZ-RECHTS) (setq m_IO-BEZ-RECHTS "0")) ; Bezeicnung als Text rechts andrucken
(Dbox)
(prompt "")
(datain)
(geometrie)
(setvar "osmode" ALTFANG)
)