;Stücklisten zeichnen ;Datenübenahme von WinPCQ / SAP R/3 ;Allgemeine Stücklisten-Prozeduren (vmon) ;Schriftfeld aus Datei lesen (defun LiesSfd () ;(F:CMDoff) ;(setq gez "x" abt "x" kunde " " mtyp " " mtyp-fz " " ) (setq sfd (findfile "c:/db-acad.sfd")) (setq ff (open sfd "r") m " " ) (setq m (read-line ff)) (if m (progn (setq plan0 (F:LTRIM(substr m 1 20))) (if (= (substr plan0 1 3) "HRP") (progn (setq hrpnr (F:LTRIM(substr plan0 4 6))) (setq plan (strcat "HRP " hrpnr "-2.1")) (setq stldwg0 (F:TRIM (strcat "L" hrpnr))) ) ;else (progn (setq plan plan0) (setq stldwg0 (F:TRIM (strcat (substr plan0 4 5) (substr plan0 10)))) ) ) (setq datum (substr m 21 10)) (setq gez (F:TRIM (substr m 32 8))) (setq kundennr (F:TRIM (substr m 59 8))) (setq kunde (F:TRIM (substr m 67 25))) (setq kunde1 (F:TRIM (substr m 93 25))) (setq strasse (F:TRIM (substr m 119 25))) (setq ort (F:TRIM (substr m 145 25))) (setq kommision (F:TRIM (substr m 171 15))) (setq mtyp (F:TRIM (substr m 187 40))) (setq mtyp-fz (F:TRIM (substr m 227 30))) (setq schaltpl (F:TRIM (substr m 249 20))) (setq bemerkung (F:TRIM (substr m 278 30))) ) ) (close ff) ) ;Stücklistenzeile zerlegen der Textzeile aus SAP Datei ; text_2 und 3 aus SAP Stückliste ; norm = SAP Feld für RD Blatt-Nr. ; HTN = Hersteller-Nummer ; mat-nr=Finzel-SAP-Material-Nr. ; text_2,text_3 aus SAP Stückliste der Positionstext ; Beikz ist das Beistellkennzeichnen aus Stückliste K=Kunde,L=Lieferant,S=Aufarbeitung (defun Zeile(s) (setq stk_nr (substr s 1 10)) (setq menge (substr s 110 10)) (if (= (substr menge 1 2) "00") (setq menge (strcat " " (substr menge 3)))) (if (= (substr menge 1 1) "0") (setq menge (strcat " " (substr menge 2)))) (setq benennung (substr s 12 30)) (setq typ (substr s 43 40)) (setq htn (substr s 84 25)) (setq hersteller (substr s 121 25)) (setq mat_nr (substr s 147 8)) (setq norm (substr s 156 20)) (setq text_2 (substr s 177 40)) (setq text_3 (substr s 218 40)) (setq beikz (substr s 259 1)) ; Punkt setzen wenn HTN und TEXT_2 leer (RZS 09.01.2008) (if (and (= (F:ATRIM htn) "" ) (= (F:ATRIM text_2) "")) (setq htn ".")) ) ;Steuerung des Zeilenvorschubes in Abhängigkeit von der Belegung der ;Felder norm,htn, text_2 und text_3 Zusatzdaten aus SAP (defun Y1234 (y1) (setq y2 y1 y3 y1 y4 y1) ;Damit immer eine zweite Zeile Bezeichnung in AutoCad Stückliste existiert ; HFI-03.11.2007 (if (or (/= (F:ATRIM htn) "" ) (/= (F:ATRIM norm) "")) (setq y2 (- y1 zeilenvor)) ) (if (and (= (F:ATRIM htn) "" ) (/= (F:ATRIM norm) "")) (progn (if (/= (F:ATRIM text_2) "") (setq y3 y2) ) (if (/= (F:ATRIM text_3) "") (setq y4 (- (min y1 y3) zeilenvor)) ) );else (progn (if (/= (F:ATRIM text_2) "") (setq y3 (- (min y1 y2) zeilenvor)) ) (if (/= (F:ATRIM text_3) "") (setq y4 (- (min y1 y2 y3) zeilenvor)) ) ) ) ) ;Bestimmung der Seitenzahl (defun SeitenZaehlen (seitenanf seitenende zeilenvor zeilig ) (setq fff (open datei "r") s " " seitemax 0 y1 seitenanf y01 y1) (prompt "\nBitte warten! ") (while s (setq s (read-line fff)) (if s (progn (zeile s) (setq stk_nr1 (substr (F:ATRIM stk_nr) 1 3)) (if (/= stk_nr1 "999") (progn (y1234 y1) (setq y01 (min y1 y2 y3 y4)) ) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (setq seitemax (1+ seitemax)) (setq y1 seitenanf ) (setq y01 y1) ) ) (if (and s (/= stk_nr1 "999")) (progn (y1234 y1) (setq y1 (min y1 y2 y3 y4)) (setq y1 (- y1 (* zeilig zeilenvor))) ) ) ) (close fff) (setq seitemax seitemax) ) ;Zeichnen einer Stücklistenzeile (defun ZeileZeichnen () (setq stk_nr1 (substr (F:ATRIM stk_nr) 1 3)) (if (/= stk_nr1 "999") (progn (if (/= (F:ATRIM beikz) "") (command "text" ptbeikz "0" beikz) ) (command "text" ptstk_nr "0" stk_nr) (command "text" ptbenennung "0" benennung) (command "text" pttyp "0" typ) (if (/= (F:ATRIM mat_nr) "") (command "text" ptmat_nr "0" mat_nr) ) (if (/= (F:TRIM htn) "") (command "text" pthtn "0" htn) ) (if (/= (F:ATRIM norm) "") (command "text" ptnorm "0" norm ) ) (if (/= (F:ATRIM text_2) "") (command "text" pttext_2 "0" text_2) ) (if (/= (F:ATRIM text_3) "") (command "text" pttext_3 "0" text_3) ) (command "text" ptmenge "0" menge) (command "text" pthersteller "0" hersteller) ) ) ) ;Abspeichern eine Stücklistenseite (defun StldwgSichern (stldwg0 seite / ofiledia) (if (> 10 seite) (progn (setq stldwg (strcat stldwg0 "0")) (setq stldwg (strcat stldwg (itoa seite))) ) (setq stldwg (strcat stldwg0 (itoa seite))) ) (setq ofiledia (getvar "filedia")) (command "sichals" "R14" stldwg) (if (/= (getvar "CMDACTIVE") 0) (command "J")) (setvar "filedia" ofiledia) ) ;Stückliste zeichnen im Finzel/Hydraulik-Ring Format (unsere normale) (defun STULI (zeilig) (F:CMDoff) (setq os (getvar "osmode")) ; Objektfang (osmode) speichern (setvar "osmode" 0) ; Objektfang ausschalten (setq datei (findfile "c:/db-acad.dif")) (setq seitenanf 253.0) (if (= zeilig 1) (setq seitenende 40 zeilenvor 6 )) (if (= zeilig 2) (setq seitenende 44 zeilenvor 6 )) (command "farbe" "_yellow") (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (LiesSfd) ;Schriftfeld ausfüllen (command "text" "134,12" "0" plan) (command "text" "21,11" "0" gez) (command "text" "21,16" "0" datum) (command "text" "z" "68,26" "0" kunde) (command "text" "z" "84,12" "0" mtyp) (command "text" "z" "84,6" "0" mtyp-fz) (command "text" "z" "26,24" "0" kundennr) ;Seiten zählen und max. Seitenzahl eintragen (setq seitemax (SeitenZaehlen seitenanf seitenende zeilenvor zeilig)) (command "stil" "simplex" "simplex" "2.0" "0.75" "0" "n" "n" "n") (command "text" "186,11.50" "0" seitemax) ;Stückliste erzeugen (setq f (open datei "r") seite 0 y1 seitenanf y01 y1 s " ") (while s (setq s (read-line f)) (if s (progn (zeile s) (progn (y1234 y1) (setq y01 (min y1 y2 y3 y4)) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (setq seite (1+ seite)) (command "text" "186,16.5" "0" seite) (if s ;neues Blatt beginnen (progn (setq ptbks (F:NPT (1+ seite))) (setq ptbks (trans ptbks 0 1)) ;Punkt in WKS uebertragen ; (command "bks" "u" ptbks) ;für Autocad Version <2006 (command "bks" "neu" ptbks) ;für Autocad2006 (command "_zoom" "_w" "*0,0" "408,287") ;Rahmen und Schriftfeld kopiern (command "_copy" "k" "*0,0" "*196,35" "e" "f" "*183,15" "*195,20" "" "*0,0" "0,0") (command "_zoom" "_w" "0,0" "408,287") ;zoomen auf A3-Groesse (setq y1 seitenanf) (setq y01 y1) ) ) ) ) (if s (progn (y1234 y1) (setq x 14.0 ptbeikz (list x y1)) (setq x 16.0 ptstk_nr (list x y1)) (setq x 32.0 ptbenennung (list x y1)) (setq x 76.0 pttyp (list x y1)) (setq x 134.0 ptmat_nr (list x y1)) (setq x 152.0 ptmenge (list x y1)) (setq x 168.0 pthersteller (list x y1)) (setq x 76.0 pthtn (list x y2)) (setq x 32.0 ptnorm (list x y2)) (setq x 76.0 pttext_2 (list x y3)) (setq x 76.0 pttext_3 (list x y4)) (ZeileZeichnen) (setq y1 (min y1 y2 y3 y4)) (setq y1 (- y1 (* zeilig zeilenvor))) ) ) ) (close f) (setvar "osmode" os) ; Objektfang wieder einschalten ;(command "_open" "j" (getvar "dwgname")) (F:CMDon) ) ;Stückliste zeichnen im neuen Finzel Format mit Hersteller und HTN (defun STULN (zeilig) (F:CMDoff) (setq os (getvar "osmode")) ; Objektfang (osmode) speichern (setvar "osmode" 0) ; Objektfang ausschalten (setq datei (findfile "c:/db-acad.dif")) (setq seitenanf 253.0) (if (= zeilig 1) (setq seitenende 40 zeilenvor 6 )) (if (= zeilig 2) (setq seitenende 44 zeilenvor 6 )) (command "farbe" "_yellow") (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (LiesSfd) ;Schriftfeld ausfüllen (command "text" "134,12" "0" plan) (command "text" "21,11" "0" gez) (command "text" "21,16" "0" datum) (command "text" "z" "68,26" "0" kunde) (command "text" "z" "84,12" "0" mtyp) (command "text" "z" "84,6" "0" mtyp-fz) (command "text" "z" "26,24" "0" kundennr) ;Seiten zählen und max. Seitenzahl eintragen (setq seitemax (SeitenZaehlen seitenanf seitenende zeilenvor zeilig)) (command "stil" "simplex" "simplex" "2.0" "0.75" "0" "n" "n" "n") (command "text" "186,11.50" "0" seitemax) ;Stückliste erzeugen (setq f (open datei "r") seite 0 y1 seitenanf y01 y1 s " ") (while s (setq s (read-line f)) (if s (progn (zeile s) (progn (y1234 y1) (setq y01 (min y1 y2 y3 y4)) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (setq seite (1+ seite)) (command "text" "186,16.5" "0" seite) (if s ;neues Blatt beginnen (progn (setq ptbks (F:NPT (1+ seite))) (setq ptbks (trans ptbks 0 1)) ;Punkt in WKS uebertragen ; (command "bks" "u" ptbks) ;für Autocad Version <2006 (command "bks" "neu" ptbks) ;für Autocad2006 (command "_zoom" "_w" "*0,0" "408,287") ;Rahmen und Schriftfeld kopiern (command "_copy" "k" "*0,0" "*196,35" "e" "f" "*183,15" "*195,20" "" "*0,0" "0,0") (command "_zoom" "_w" "0,0" "408,287") ;zoomen auf A3-Groesse (setq y1 seitenanf) (setq y01 y1) ) ) ) ) (if s (progn (y1234 y1) (setq x 14.0 ptbeikz (list x y1)) (setq x 16.0 ptstk_nr (list x y1)) (setq x 32.0 ptbenennung (list x y1)) (setq x 76.0 pttyp (list x y1)) (setq x 134.0 ptmat_nr (list x y1)) (setq x 152.0 ptmenge (list x y1)) (setq x 76.0 pthersteller (list x y2)) (setq x 103.0 pthtn (list x y2)) (setq x 168.0 ptnorm (list x y1)) (setq x 76.0 pttext_2 (list x y3)) (setq x 76.0 pttext_3 (list x y4)) (ZeileZeichnen) (setq y1 (min y1 y2 y3 y4)) (setq y1 (- y1 (* zeilig zeilenvor))) ) ) ) (close f) (setvar "osmode" os) ; Objektfang wieder einschalten ;(command "_open" "j" (getvar "dwgname")) (F:CMDon) ) ;Stückliste zeichnen im neuen Finzel Format ohne Hersteller ohne HTN (defun STULO (zeilig) (F:CMDoff) (setq os (getvar "osmode")) ; Objektfang (osmode) speichern (setvar "osmode" 0) ; Objektfang ausschalten (setq datei (findfile "c:/db-acad.dif")) (setq seitenanf 253.0) (if (= zeilig 1) (setq seitenende 40 zeilenvor 6 )) (if (= zeilig 2) (setq seitenende 44 zeilenvor 6 )) (command "farbe" "_yellow") (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (LiesSfd) ;Schriftfeld ausfüllen (command "text" "134,12" "0" plan) (command "text" "21,11" "0" gez) (command "text" "21,16" "0" datum) (command "text" "z" "68,26" "0" kunde) (command "text" "z" "84,12" "0" mtyp) (command "text" "z" "84,6" "0" mtyp-fz) (command "text" "z" "26,24" "0" kundennr) ;Seiten zählen und max. Seitenzahl eintragen (setq seitemax (SeitenZaehlen seitenanf seitenende zeilenvor zeilig)) (command "stil" "simplex" "simplex" "2.0" "0.75" "0" "n" "n" "n") (command "text" "186,11.50" "0" seitemax) ;Stückliste erzeugen (setq f (open datei "r") seite 0 y1 seitenanf y01 y1 s " ") (while s (setq s (read-line f)) (if s (progn (zeile s) (progn (y1234 y1) (setq y01 (min y1 y2 y3 y4)) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (setq seite (1+ seite)) (command "text" "186,16.5" "0" seite) (if s ;neues Blatt beginnen (progn (setq ptbks (F:NPT (1+ seite))) (setq ptbks (trans ptbks 0 1)) ;Punkt in WKS uebertragen ; (command "bks" "u" ptbks) ;für Autocad Version <2006 (command "bks" "neu" ptbks) ;für Autocad2006 (command "_zoom" "_w" "*0,0" "408,287") ;Rahmen und Schriftfeld kopiern (command "_copy" "k" "*0,0" "*196,35" "e" "f" "*183,15" "*195,20" "" "*0,0" "0,0") (command "_zoom" "_w" "0,0" "408,287") ;zoomen auf A3-Groesse (setq y1 seitenanf) (setq y01 y1) ) ) ) ) (if s (progn (y1234 y1) (setq x 14.0 ptbeikz (list x y1)) (setq x 16.0 ptstk_nr (list x y1)) (setq x 32.0 ptbenennung (list x y1)) (setq x 76.0 pttyp (list x y1)) (setq x 134.0 ptmat_nr (list x y1)) (setq x 152.0 ptmenge (list x y1)) (setq x 168.0 ptnorm (list x y1)) (setq x 76.0 pttext_2 (list x y3)) (setq x 76.0 pttext_3 (list x y4)) (ZeileZeichnen) (setq y1 (min y1 y2 y3 y4)) (setq y1 (- y1 (* zeilig zeilenvor))) ) ) ) (close f) (setvar "osmode" os) ; Objektfang wieder einschalten ;(command "_open" "j" (getvar "dwgname")) (F:CMDon) ) ;Stückliste auf Schaltplan zeichnen (Kundenstückliste) (defun STULI_KRAU () (F:CMDoff) (setq os (getvar "osmode")) ; Objektfang (osmode) speichern (setvar "osmode" 0) ; Objektfang ausschalten (setq datei (findfile "c:/db-acad.dif")) (setq seitenanf 253.0) (if (= zeilig 1) (setq seitenende 40 zeilenvor 6 )) (if (= zeilig 2) (setq seitenende 44 zeilenvor 6 )) (command "farbe" "_yellow") (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (LiesSfd) ;Schriftfeld ausfüllen (command "text" "134,12" "0" plan) (command "text" "21,11" "0" gez) (command "text" "21,16" "0" datum) (command "text" "z" "68,26" "0" kunde) (command "text" "z" "84,12" "0" mtyp) (command "text" "z" "84,6" "0" mtyp-fz) (command "text" "z" "26,24" "0" kundennr) ;Seiten zählen und max. Seitenzahl eintragen (setq seitemax (SeitenZaehlen seitenanf seitenende zeilenvor zeilig)) (command "stil" "simplex" "simplex" "2.0" "0.75" "0" "n" "n" "n") (command "text" "186,11.50" "0" seitemax) ;Stückliste erzeugen (setq f (open datei "r") seite 0 y1 seitenanf y01 y1 s " ") (while s (setq s (read-line f)) (if s (progn (zeile s) (progn (y1234 y1) (setq y01 (min y1 y2 y3 y4)) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (setq seite (1+ seite)) (command "text" "186,16.5" "0" seite) (if s ;neues Blatt beginnen (progn (setq ptbks (F:NPT (1+ seite))) (setq ptbks (trans ptbks 0 1)) ;Punkt in WKS uebertragen ; (command "bks" "u" ptbks) ;für Autocad Version <2006 (command "bks" "neu" ptbks) ;für Autocad2006 (command "_zoom" "_w" "*0,0" "408,287") ;Rahmen und Schriftfeld kopiern (command "_copy" "k" "*0,0" "*196,35" "e" "f" "*183,15" "*195,20" "" "*0,0" "0,0") (command "_zoom" "_w" "0,0" "408,287") ;zoomen auf A3-Groesse (setq y1 seitenanf) (setq y01 y1) ) ) ) ) (if s (progn (y1234 y1) (setq x 14.0 ptbeikz (list x y1)) (setq x 16.0 ptstk_nr (list x y1)) (setq x 32.0 ptbenennung (list x y1)) (setq x 76.0 pttyp (list x y1)) (setq x 134.0 ptmat_nr (list x y1)) (setq x 152.0 ptmenge (list x y1)) (setq x 168.0 pthersteller (list x y1)) (setq x 76.0 pthtn (list x y2)) (setq x 32.0 ptnorm (list x y2)) (setq x 76.0 pttext_2 (list x y3)) (setq x 76.0 pttext_3 (list x y4)) (ZeileZeichnen) ;(setq y1 (min y1 y2 y3 y4)) (setq y1 (- y1 (* zeilig zeilenvor))) ) ) ) (close f) (setvar "osmode" os) ; Objektfang wieder einschalten ;(command "_open" "j" (getvar "dwgname")) (F:CMDon) ) ;;Stückliste auf Schaltplan zeichnen ;(defun STUECK (richtung) ; (F:CMDoff) ; (setq datei (findfile "c:/db-acad.dif")) ; (setq f (open datei "r")) ; (setq zeilenvor 6) ; (if (= richtung "S") ; (progn ; (setq p (getpoint "\nWähle Stücklisten-Anfang: ")) ; (setq x (car p) y (cadr p) p1 p) ; (setq winkel 0 maxzeilen 40) ; ) ;else richtung ; (progn ; (setq x 22.0 y 40.0 p1 (list x y)) ; (setq winkel 90 maxzeilen 60) ; ) ; ) ; (command "_INSERT" (strcat "K:/CADLB/hyplan/stl_dwg/h-stext") p1 "1" "1" winkel) ; (setq n 1 s " ") ; (while s (setq s (read-line f)) ; (if (and (= n maxzeilen) s) ; (progn ; (command "_INSERT" (strcat "K:/CADLB/hyplan/stl_dwg/h-srahm") p1 "1" n winkel) ; (if (= richtung "S") ; (setq n 1 x (+ x 194.0) y (cadr p) p1 (list x y)) ;else ; (setq n 1 x 22.0 y (+ y 194.0) p1 (list x y)) ; ) ; (command "_INSERT" (strcat "K:/CADLB/hyplan/stl_dwg/h-stext") p1 "1" "1" winkel) ; ) ; ) ; (if s ; (progn ; (Zeile s) ; (setq stk_nr1 (substr (F:ATRIM stk_nr) 1 3)) ; (IF (/= stk_nr1 "999") ; (progn ; (setq stk_nr (F:TRIM stk_nr)) ; (setq menge (F:TRIM menge)) ; (setq benennung (F:TRIM benennung)) ; (setq typ (F:TRIM typ)) ; (setq mat_nr (F:TRIM mat_nr)) ; (setq htn (F:TRIM htn)) ; (setq hersteller (F:TRIM hersteller)) ; (setq n (1+ n)) ; (if (= richtung "S") ; (setq pt (list x (setq y (- y zeilenvor)))) ;else ; (setq pt (list (setq x (+ x zeilenvor)) y)) ; ) ; (command "attreq" "1") ; (command "_insert" (strcat "K:/CADLB/hyplan/stl_dwg/h-szeile") pt "1" "1" winkel stk_nr benennung typ htn Mat_nr menge hersteller) ; ; ) ; ) ; ) ; ) ; ) ; (command "_INSERT" (strcat "K:/CADLB/hyplan/stl_dwg/h-srahm") p1 "1" n winkel) ; (close f) ; (F:CMDon) ;) ;ZF-Stückliste (defun STULI_ZF () (F:CMDoff) (setq datei (findfile "c:/db-acad.dif")) (setq seitenanf 248.0 seitenende 46.0 zeilenvor 6 zeilig 1) (command "farbe" "_green") (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (initget 1 "J N") (menucmd "S=JN") (setq sl (getkword "\nZF-Rahmen einfügen J oder N : ") ) (IF (= sl "J") (progn ;Rahmen einfügen und Schriftfeld ausfüllen (load "hrg-rahm") (rahmen (strcat hydrrah "zf-stl")) (LiesSfd) ;Schriftfeld ausfüllen (command "text" "150,40" "0" plan) (command "text" "30,5" "0" gez) (command "text" "30,17" "0" datum) (command "text" "z" "164,14" "0" mtyp) (command "text" "z" "104,26" "0" mtyp-fz) ;Seiten zählen und max. Seitenzahl eintragen (setq seitemax (SeitenZaehlen seitenanf seitenende zeilenvor zeilig)) (command "text" "178,5" "0" seitemax) ) (progn ;Stückliste erzeugen (LiesSfd) (setq f (open datei "r") seite 0 y1 seitenanf y01 y1 s " ") (while s (setq s (read-line f)) (if s (progn (zeile s) (setq stk_nr1 (substr (F:ATRIM stk_nr) 1 3)) (if (/= stk_nr1 "999") (progn (y1234 y1) (setq y01 (min y1 y2 y3 y4)) ) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (setq seite (1+ seite)) (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (command "text" "157,5" "0" seite) (if s ;neues Blatt beginnen (progn (setq ptbks (F:NPT (1+ seite))) (setq ptbks (trans ptbks 0 1)) ;Punkt in WKS uebertragen (command "bks" "Neu" ptbks) ;Autocad2006 (command "_zoom" "_w" "*0,0" "408,287") ;Rahmen und Schriftfeld kopiern (command "_copy" "k" "*0,0" "*196,36" "f" "*144,36" "*196,42" "e" "f" "*152,1" "*168,10" "" "*0,0" "0,0") (command "_zoom" "_w" "0,0" "408,287") ;zoomen auf A3-Groesse (setq y1 seitenanf) (setq y01 y1) ) ) (setq y1 seitenanf) (setq y01 y1) ) ) (if (and s (/= stk_nr1 "999")) (progn (y1234 y1) (command "stil" "simplex" "simplex" "2.0" "0.75" "0" "n" "n" "n") (setq x 14.0 ptstk_nr (list x y1)) (setq x 30.0 ptbenennung (list x y1)) (setq x 74.0 pttyp (list x y1)) (setq x 118.0 pthtn (list x y1)) (setq x 156.0 ptmenge (list x y1)) (setq x 166.0 pthersteller (list x y1)) (ZeileZeichnen) (setq y1 (min y1 y2 y3 y4)) (setq y1 (- y1 (* zeilig zeilenvor))) ) ) ) (close f) ) ) (F:CMDon) (princ) ) ;VW-Stückliste (defun STULI_VW () (F:CMDoff) (setq datei (findfile "c:/db-acad.dif")) (setq seitenanf 224.0 seitenende 36.5 zeilenvor 8.5 zeilig 1) (command "farbe" "_green") (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (LiesSfd) ;Schriftfeld ausfüllen (command "text" "z" "100,255" "0" (strcat "Hydraulik-Installation " plan)) (command "text" "z" "96,15" "0" gez) (command "text" "z" "69,15" "0" datum) (setq zeichnrvw (getstring T "\nZeichnungs-Nr. VW: ")) (command "text" "96,274" "0" zeichnrvw) (setq inventar (getstring T "\nVW-Inventar-Nr.: ")) (command "text" "150,274" "0" inventar) (setq zeichnrk (getstring T "\nZeichnungs-Nr. Kunde: ")) (if (/= zeichnrk "") (setq seitek (getint "\Erste Blatt-Nr. Kunde: ")) ) (if (or (not seitek) (< seitek 1)) (setq seitek 1) ) ;Seiten zählen und max. Seitenzahl eintragen (setq seitemax (SeitenZaehlen seitenanf seitenende zeilenvor zeilig)) (command "text" "190,15" "0" seitemax) ;Stückliste erzeugen (setq f (open datei "r") seite 0 y1 seitenanf y01 y1 s " ") (while s (setq s (read-line f)) (if s (progn (zeile s) (setq stk_nr1 (substr (F:ATRIM stk_nr) 1 3)) (if (/= stk_nr1 "999") (progn (y1234 y1) (setq y01 (min y1 y2 y3 y4)) ) ) ) ) (if (or (not s) (< y01 seitenende)) (progn (setq seite (1+ seite)) (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (command "text" "192.0,247.5" "0" seite) (if (/= zeichnrk "") (setq zeichnrk1 (strcat zeichnrk " Bl." (itoa (+ seite seitek -1)))) ) (command "text" "60,6" "0" zeichnrk1) ;(StldwgSichern stldwg0 (+ seite seitek -1)) (if s ;neues Blatt beginnen (progn (setq ptbks (F:NPT (1+ seite))) (setq ptbks (trans ptbks 0 1)) ;Punkt in WKS uebertragen (command "bks" "neu" ptbks) ;Autocad2006 (command "_zoom" "_w" "*0,0" "408,287") ;Rahmen und Schriftfeld kopiern (command "_copy" "k" "*0,252" "*196,282" "f" "*0,12" "*198,24" "" "*0,0" "0,0") (command "_zoom" "_w" "0,0" "408,287") ;zoomen auf A3-Groesse (setq y1 seitenanf) (setq y01 y1) ) ) (setq y1 seitenanf ) (setq y01 y1) ) ) (if (and s (/= stk_nr1 "999")) (progn (y1234 y1) (command "stil" "simplex" "simplex" "2.0" "0.7" "0" "n" "n" "n") (setq x 8.0 ptbeikz (list x y1)) (setq x 10.0 ptstk_nr (list x y1)) (setq x 17.0 ptmenge (list x y1)) (setq x 52.0 ptbenennung (list x y1)) (setq x 92.0 pthersteller (list x y1)) (setq x 92.0 ptnorm (list x y2)) (setq x 117.0 pttyp (list x y1)) (setq x 117.0 pthtn (list x y2)) (setq x 117.0 pttext_2 (list x y3)) (setq x 117.0 pttext_3 (list x y4)) (setq x 165.0 ptmat_nr (list x y1)) (if (setq p (F:AT ".." stk_nr)) (setq stk_nr (strcat (substr stk_nr 1 p) (substr stk_nr (+ p 2)))) ) (setq htn "") (ZeileZeichnen) (setq y1 (min y1 y2 y3 y4)) (setq y1 (- y1 (* zeilig zeilenvor))) ) ) ) (close f) (F:CMDon) ) ;Ford-Stückliste (defun STULI_FORD () (F:CMDoff) (setq datei (findfile "c:/db-acad.dif")) (setq seitenanf 250.0 seitenende 22 zeilenvor 6 zeilig 1) (LiesSfd) ;Schriftfeld ausfüllen (command "farbe" "magenta") (command "stil" "simplex" "simplex" "5.0" "0.75" "0" "n" "n" "n") (command "text" "272,2" "0" plan) (setq benennplan (getstring T "\nBenennung 1 : ")) (if (= benennplan "") (setq benennplan "Hydraulikplan")) (command "text" "z" "390,152" "90" benennplan) (command "farbe" "_green") (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (command "text" "z" "388,37" "90" gez) (command "text" "404,4" "90" datum) (command "stil" "simplex" "simplex" "3.5" "0.75" "0" "n" "n" "n") (command "text" "z" "400,152" "90" mtyp) (command "text" "z" "406,152" "90" mtyp-fz) (setq inventar (getstring T "\nInventar-Nr.: ")) (command "text" "398,192" "90" inventar) (setq zeichnford (getstring T "\nFord-Zeichnungs-Nr.: ")) (command "text" "382,192" "90" zeichnford) (setq abtford (getstring T "\nFord-Abteilung (Werk): ")) (command "text" "z" "404,80" "90" abtford) ;Seiten zählen und max. Seitenzahl eintragen (setq seite1 (getint "\Erste Blatt-Nr. <1>: ")) (if (or (not seite1) (< seite1 1)) (setq seite1 1) ) (setq seitemax (SeitenZaehlen seitenanf seitenende zeilenvor zeilig)) (setq seitemax (+ seitemax (1- seite1))) (command "text" "407,260" "90" seitemax) ;Stückliste erzeugen (setq f (open datei "r") seite (1- seite1) y1 seitenanf y01 y1 s " ") (setq lfd_nr 0) (while s (setq s (read-line f)) (if s (progn (zeile s) (setq stk_nr1 (substr (F:ATRIM stk_nr) 1 3)) (if (/= stk_nr1 "999") (progn (y1234 y1) (setq y01 (min y1 y2 y3 y4)) ) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (command "stil" "simplex" "simplex" "3.5" "0.75" "0" "n" "n" "n") (setq seite (1+ seite)) (command "text" "396,260" "90" seite) ;(StldwgSichern stldwg0 seite) (if s ;neues Blatt beginnen (progn (setq ptbks (F:NPT (- seite seite1 -2))) (setq ptbks (trans ptbks 0 1)) ;Punkt in WKS uebertragen (command "bks" "n" ptbks) (command "_zoom" "_w" "*0,0" "408,287") ;Rahmen und Schriftfeld kopiern (command "_copy" "k" "*0,0" "*408,18" "f" "*372,0" "*408,286" "e" "f" "*390,255" "*400,290" "" "*0,0" "0,0") (command "_zoom" "_w" "0,0" "408,287") ;zoomen auf A3-Groesse (setq y1 seitenanf) (setq y01 y1) ) ) (setq y1 seitenanf) (setq y01 y1) ) ) (if (and s (/= stk_nr1 "999")) (progn (command "stil" "simplex" "simplex" "2.0" "0.75" "0" "n" "n" "n") (y1234 y1) (setq ptlfd_nr (list 22.0 y1)) (setq ptstk_nr (list 226.0 y1)) (setq ptbenennung (list 30.0 y1)) (setq pttyp (list 132.0 y1)) (setq pthtn (list 176.0 y1)) (setq ptmenge (list 215.0 y1)) (setq pthersteller (list 92.0 y1)) (ZeileZeichnen) (setq lfd_nr (1+ lfd_nr)) (command "text" "r" ptlfd_nr "0" lfd_nr) (setq y1 (min y1 y2 y3 y4)) (setq y1 (- y1 (* zeilig zeilenvor))) ) ) ) (close f) (F:CMDon) ) ;TÜV-Liste zeichnen (defun STULI_TUV () (F:CMDoff) (setq datei (findfile "c:/db-acad.dif")) (setq seitenanf 238.0 seitenende 52 zeilenvor 6 zeilig 1 ) (command "farbe" "_green") (command "stil" "simplex" "simplex" "3.5" "0.75" "0" "n" "n" "n") ;Schriftfeld ausfüllen (setq auftragsnr nil) (while (= auftragsnr nil) (setq auftragsnr (getstring T "\nAuftragsnummer: "))) (command "text" "148,4" "0" auftragsnr) (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (LiesSfd) (command "text" "134,12" "0" plan) (command "text" "21,11" "0" gez) (command "text" "21,16" "0" datum) (command "text" "z" "68,26" "0" kunde) (command "text" "z" "84,12" "0" mtyp) (command "text" "z" "84,6" "0" mtyp-fz) (command "text" "z" "26,24" "0" kundennr) ;Seiten zählen und max. Seitenzahl eintragen (setq fff (open datei "r") s " " seitemax 0 y1 seitenanf y01 y1) (prompt "\nBitte warten! ") (setq auswahl "KOLBENS*,BLASENS*,MEMBRAN*,SPEICHERS*,SICHERH*,DRUCKV*,DRUCKB*,SI*") (while s (setq s (read-line fff)) (if s (progn (zeile s) (if (wcmatch benennung auswahl) (progn (setq y01 (- y1 (* zeilenvor 3))) ) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (setq seitemax (1+ seitemax)) (setq y1 seitenanf ) (setq y01 y1) ) ) (if (and s (wcmatch benennung auswahl)) (progn (setq y1 (- y1 (* 3 zeilenvor))) ) ) ) (close fff) (command "text" "186,11.50" "0" seitemax) ;Stückliste erzeugen (setq f (open datei "r") s " " seite 0 y1 seitenanf y01 y1) (while s (setq s (read-line f)) (if s (progn (zeile s) (if (wcmatch benennung auswahl) (progn (setq y01 (- y1 (* zeilenvor 3))) ) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (setq seite (1+ seite)) (command "text" "186,16.5" "0" seite) (if s ;neues Blatt beginnen (progn (setq ptbks (F:NPT (1+ seite))) (setq ptbks (trans ptbks 0 1)) ;Punkt in WKS uebertragen (command "bks" "n" ptbks) (command "_zoom" "_w" "*0,0" "408,287") ;Rahmen und Schriftfeld kopiern (command "_copy" "k" "*0,0" "*196,50" "e" "f" "*183,15" "*195,20" "" "*0,0" "0,0") (command "_zoom" "_w" "0,0" "408,287") ;zoomen auf A3-Groesse (setq y1 seitenanf) (setq y01 y1) ) ) (setq y1 seitenanf) (setq y01 y1) ) ) (if (and s (wcmatch benennung auswahl)) (progn (setq y2 (- y1 zeilenvor)) (setq y3 (- y2 zeilenvor)) (setq ptstk_nr (list 16.0 y1)) (setq ptbenennung (list 34.0 y1)) (setq ptnorm (list 0.0 y1)) ;Dummy (setq pttyp (list 34.0 y2)) (setq ptmat_nr (list 34.0 y3)) (setq pttext_2 (list 150.0 y1)) (setq pttext_3 (list 150.0 y2)) (setq pthtn (list 96.0 y1)) (setq ptmenge (list 0.0 y1)) ;Dummy (setq pthersteller (list 96.0 y2)) (setq norm "") ;Dummy (setq menge "") ;Dummy (if (wcmatch benennung "KOLBENS*,BLASENS*,MEMBRAN*") (progn (setq text_2 "Fabr.Nr.:") (setq text_3 "Baujahr:" ) ) ;else (progn (setq text_2 "Ventil Nr.:") (setq text_3 "" ) ) ) (ZeileZeichnen) (command "linie" (list 12.0 (- y3 2)) "@184<0" "") (setq y1 (- y1 (* zeilenvor 3))) ) ) ) (close f) ;(command "_open" "j" (getvar "dwgname")) (F:CMDon) ) ;Stückliste Wema VOGTLAND zeichnen (defun STULI_VOGT () (F:CMDoff) (setq datei (findfile "c:/db-acad.dif")) (setq seitenanf 202.0 seitenende 61.0 zeilenvor 7 zeilig 1) (command "farbe" "_green") (command "stil" "simplex" "simplex" "3.5" "0.75" "0" "n" "n" "n") ;Schriftfeld ausfüllen (LiesSfd) (setq mtyp (F:TRIM mtyp) mtyp0 "" mtyp1 nil) (setq mtyplaenge (strlen mtyp)) (if (> mtyplaenge 6) (setq mtyp0 (substr mtyp (- mtyplaenge 6))) ) (setq mtyp1 (getstring T (strcat "\nAuftrags-Nr. Wema VOGTLAND <" mtyp0 "> :"))) (if (= mtyp1 "") (setq mtyp mtyp0) (setq mtyp mtyp1)) (command "text" "r" "243,23" "0" mtyp) (setq mtyp-fz (F:TRIM mtyp-fz) mtyp-fz0 "" mtyp-fz1 nil) (setq mtyp-fzlaenge (strlen mtyp-fz)) (if (> mtyp-fzlaenge 14) (setq mtyp-fz0 (substr mtyp-fz (- (strlen mtyp-fz) 14))) ) (setq mtyp-fz1 (getstring T (strcat "\nZeichnungs-Nr. Wema VOGTLAND <" mtyp-fz0 "> :"))) (if (= mtyp-fz1 "") (setq mtyp-fz mtyp-fz0) (setq mtyp-fz mtyp-fz1)) (command "text" "247,23" "0" mtyp-fz) (setq endkunde1 (getstring T "\nEndkunde 1.Zeile: ")) (command "text" "110,33" "0" endkunde1) (setq endkunde2 (getstring T "\nEndkunde 2.Zeile: ")) (command "text" "110,27" "0" endkunde2) (setq inventar (getstring T "\nInventar-Nr.: ")) (command "text" "267,33" "0" inventar) (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (command "text" "88,30.8" "0" (F:TRIM gez)) (command "text" "88,35" "0" datum) (setq seite nil) (while (= seite nil) (setq seite (getint "\nErste Blatt-Nr.: "))) (setq seite (1- seite)) ;Seiten zählen und max. Seitenzahl eintragen (setq seitemax (SeitenZaehlen seitenanf seitenende zeilenvor zeilig)) (setq seitemax (+ seitemax seite)) (setq sseitemax (itoa seitemax)) (if (< seitemax 10) (setq sseitemax (strcat "0" sseitemax))) (command "text" "292,22" "0" sseitemax) ;Stückliste erzeugen (setq f (open datei "r") y1 seitenanf y01 y1 s " ") (while s (setq s (read-line f)) (if s (progn (zeile s) (setq stk_nr1 (substr (F:ATRIM stk_nr) 1 3)) (if (/= stk_nr1 "999") (progn (y1234 y1) (setq y01 (min y1 y2 y3 y4)) ) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (setq seite (1+ seite)) (setq sseite (itoa seite)) (if (< seite 10) (setq sseite (strcat "0" sseite))) (command "text" "303,26" "0" sseite) (if (= (substr stldwg0 1 1) "L") (setq stldwg0 (strcat "T" (substr stldwg0 2))) ) (StldwgSichern stldwg0 seite) ;(command "igesout" (strcat stldwg0 sseite)) (setq y1 seitenanf) (setq y01 y1) (command "_erase" "f" "21,46" "306,208" "") (command "_erase" "f" "300,24" "308,30" "") ) ) (if (and s (/= stk_nr1 "999")) (progn (y1234 y1) (setq ptstk_nr (list 22.0 y1)) (setq ptbenennung (list 53.5 y1)) (setq ptnorm (list 53.5 y2)) ;Dummy (setq pttyp (list 147.0 y1)) (setq ptmat_nr (list 147.0 y2)) (setq pttext_2 (list 0.0 y2)) ;Dummy (setq pttext_3 (list 0.0 y2)) ;Dummy (setq pthtn (list 0.0 y1)) ;Dummy (setq ptmenge (list 40.0 y1)) (setq pthersteller (list 267.0 y1)) (setq htn "") (ZeileZeichnen) (setq y1 (min y1 y2 y3 y4)) (setq y1 (- y1 (* zeilig zeilenvor))) ) ) ) (close f) (command "_open" "j" (getvar "dwgname")) (F:CMDon) (princ) ) ;BMW-Stückliste zeichnen (defun STULI_BMW () (F:CMDoff) (setq datei (findfile "c:/db-acad.dif")) (setq seitenanf 202.0 seitenende 47.0 zeilenvor 7 zeilig 1) (command "farbe" "_green") (command "stil" "simplex" "simplex" "3.5" "0.75" "0" "n" "n" "n") (initget 1 "J N") (menucmd "S=JN") (setq sl (getkword "\nBMW-Rahmen einfügen J oder N : ") ) (IF (= sl "J") (progn ;Rahmen einfügen und Schriftfeld ausfüllen (load "hrg-rahm") (rahmen (strcat hydrrah "BMW_stl")) ;Schriftfeld ausfüllen (LiesSfd) (command "text" "230,210" "0" plan) (setq mtyp1 nil) (setq mtyp1 (getstring T (strcat "\nSach-Nr. Fertigungsmittel <" mtyp ">: "))) (if (/= mtyp1 "") (setq mtyp mtyp1)) (command "text" "z" "263,29" "0" mtyp) (setq benen_fm nil) (setq benen_fm (getstring T "\nBenennung Fertigungsmittel : ")) (if (= benen_fm "") (setq benen_fm "Hydraulikplan")) (command "text" "z" "203,29" "0" benen_fm) (setq sss (getstring T "\nZusatzangaben: ")) (command "text" "20,210" "0" sss) (setq sss (getstring T "\nBenennung Teil: ")) (command "text" "z" "103,29" "0" sss) (setq sss (getstring T "\nSach-Nr. Teil: ")) (command "text" "z" "155,29" "0" sss) ) (progn (LiesSfd) ;Seiten zählen und max. Seitenzahl eintragen (setq seitemax (SeitenZaehlen seitenanf seitenende zeilenvor zeilig)) (command "text" "294,29" "0" seitemax) (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") ;Stückliste erzeugen (setq f (open datei "r") seite 0 y1 seitenanf y01 y1 s " ") (while s (setq s (read-line f)) (if s (progn (zeile s) (setq stk_nr1 (substr (F:ATRIM stk_nr) 1 3)) (if (/= stk_nr1 "999") (progn (y1234 y1) (setq y01 (min y1 y2 y3 y4)) ) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (setq seite (1+ seite)) (command "stil" "simplex" "simplex" "3.5" "0.75" "0" "n" "n" "n") (command "text" "r" "289,29" "0" seite) (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (if s ;neues Blatt beginnen (progn (setq ptbks (F:NPT (1+ seite))) (setq ptbks (trans ptbks 0 1)) ;Punkt in WKS uebertragen (command "bks" "n" ptbks) (command "_zoom" "_w" "*0,0" "408,287") ;Rahmen und Schriftfeld kopiern (command "_copy" "k" "*0,0" "*308,42" "f" "*16,208" "*308,224" "e" "f" "*284,28" "*291,36" "" "*0,0" "0,0") (command "_zoom" "_w" "0,0" "408,287") ;zoomen auf A3-Groesse (setq y1 seitenanf) (setq y01 y1) ) ) (setq y1 seitenanf) (setq y01 y1) ) ) (if (and s (/= stk_nr1 "999")) (progn (y1234 y1) (setq ptstk_nr (list 22.0 y1)) (setq ptbenennung (list 53.5 y1)) (setq ptnorm (list 53.5 y2)) ;Dummy (setq pttyp (list 133.0 y1)) (setq ptmat_nr (list 133.0 y2)) (setq pttext_2 (list 0.0 y2)) ;Dummy (setq pttext_3 (list 0.0 y2)) ;Dummy (setq pthtn (list 220.0 y1)) (setq ptmenge (list 40.0 y1)) (setq pthersteller (list 267.0 y1)) (ZeileZeichnen) (setq y1 (min y1 y2 y3 y4)) (setq y1 (- y1 (* zeilig zeilenvor))) ) ) ) (close f) ) ) (F:CMDon) (princ) ) ;ITT-Stückliste (defun STULI_IT () (F:CMDoff) (setq datei (findfile "c:/db-acad.dif")) (setq seitenanf 153.0 seitenende 25.0 zeilenvor 6.26 zeilig 1) (command "farbe" "_green") (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (initget 1 "J N") (menucmd "S=JN") (setq sl (getkword "\nITT-Rahmen einfügen J oder N : ") ) (IF (= sl "J") (progn ;Rahmen einfügen und Schriftfeld ausfüllen (load "hrg-rahm") (rahmen (strcat hydrrah "ITT_STL")) (LiesSfd) ;Schriftfeld ausfüllen (command "text" "58,180" "0" plan) (command "text" "260,8" "0" gez) (command "text" "260,15" "0" datum) ;Seiten zählen und max. Seitenzahl eintragen (setq seitemax (SeitenZaehlen seitenanf seitenende zeilenvor zeilig)) (command "text" "Z" "243,180" "0" seitemax) ) (progn ;Stückliste erzeugen (LiesSfd) (setq f (open datei "r") seite 0 y1 seitenanf y01 y1 s " ") (while s (setq s (read-line f)) (if s (progn (zeile s) (setq stk_nr1 (substr (F:ATRIM stk_nr) 1 3)) (if (/= stk_nr1 "999") (progn (y1234 y1) (setq y01 (min y1 y2 y3 y4)) ) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (setq seite (1+ seite)) (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (command "text" "Z" "228,180" "0" seite) (if s ;neues Blatt beginnen (progn (setq ptbks (F:NPT (1+ seite))) (setq ptbks (trans ptbks 0 1)) ;Punkt in WKS uebertragen (command "bks" "u" ptbks) (command "_zoom" "_w" "*0,0" "408,287") ;Rahmen und Schriftfeld kopiern (command "_copy" "k" "*0,0" "*280,26" "f" "*0,158" "*280,196" "e" "f" "*210,170" "*230,190" "" "*0,0" "0,0") (command "_zoom" "_w" "0,0" "408,287") ;zoomen auf A3-Groesse (setq y1 seitenanf) (setq y01 y1) ) ) (setq y1 seitenanf) (setq y01 y1) ) ) (if (and s (/= stk_nr1 "999")) (progn (y1234 y1) (command "stil" "simplex" "simplex" "2.0" "0.75" "0" "n" "n" "n") (setq ptstk_nr (list 0.0 y1)) (setq ptbenennung (list 30.0 y1)) ;(setq ptnorm (list 33.0 y2)) (setq pttyp (list 76.0 y1)) ;(setq ptmat_nr (list 75.0 y2)) ;(setq pttext_2 (list 75.0 y3)) ;(setq pttext_3 (list 75.0 y4)) (setq pthtn (list 210.0 y1)) (setq ptmenge (list 17.0 y1)) (setq pthersteller (list 154.0 y1)) (ZeileZeichnen) (setq y1 (min y1 y2 y3 y4)) (setq y1 (- y1 (* zeilig zeilenvor))) ) ) ) (close f) ) ) (F:CMDon) (princ) ) ;Stückliste KRAUSE Wien zeichnen ;(defun STULI_KRAU () ; (F:CMDoff) ; (setq datei (findfile "c:/db-acad.dif")) ; (setq seitenanf 268.0 seitenende 31.0 zeilenvor 10 zeilig 1) ; (command "farbe" "_green") ; (command "stil" "simplex" "simplex" "3.5" "0.75" "0" "n" "n" "n") ; ;Schriftfeld ausfüllen ; (LiesSfd) ; ;(command "_insert" "013RHYDK$M_0" "0,0" "1" "1" "0" "" "" "" "" "01" "02" mtyp plan "" "" "" "" "" datum gez) ; (command "_insert" "013RHYK$MDXF_0" "0,0" "1" "1" "0" "" "" "01" "02" "" mtyp "Hydraulik" "" "Kom." "Stückliste" "" "" datum gez) ; (F:FERTIG) ; (command "_ddatte" "_l") ; (command "_zoom" "_e") ; (setq seite 0) ; ;Seiten zählen und max. Seitenzahl eintragen ; (setq seitemax (SeitenZaehlen seitenanf seitenende zeilenvor zeilig)) ; (setq seitemax (+ seitemax seite)) ; (setq sseitemax (itoa seitemax)) ; (if (< seitemax 10) (setq sseitemax (strcat "0" sseitemax))) ; ;Stückliste erzeugen ; (setq f (open datei "r") y1 seitenanf y01 y1 s " ") ; (while s (setq s (read-line f)) ; (if s ; (progn ; (zeile s) ; (setq stk_nr1 (substr (F:ATRIM stk_nr) 1 3)) ; (if (/= stk_nr1 "999") ; (progn ; (y1234 y1) ; (setq y01 (min y1 y2 y3 y4)) ; ) ; ) ; ) ; ) ; (if (or (not s) (<= y01 seitenende)) ; (progn ; (setq seite (1+ seite)) ; (setq sseite (itoa seite)) ; (if (< seite 10) (setq sseite (strcat "0" sseite))) ; (COMMAND "_ATTEDIT" "_Y" "013RHYK$MDXF_0" "blattnr." "" "_W" "404,13" "414,9" "we" "e" sseite "n") ; ;(COMMAND "_ATTEDIT" "_Y" "013RHYDK$M_0" "blattnr." "" "408,11" "" "we" "e" sseite "n") ; (setq sfolgseite (itoa (1+ seite))) ; (if (= seite seitemax) ; (setq sfolgseite "-") ; ;else ; (if (< seite 9) (setq sfolgseite (strcat "0" sfolgseite))) ; ) ; (COMMAND "_ATTEDIT" "_Y" "013RHYK$MDXF_0" "f.blatt" "" "_W" "397,9" "406,5" "we" "e" sfolgseite "n") ; ;(COMMAND "_ATTEDIT" "_Y" "013RHYDK$M_0" "f.blatt" "" "399,7" "" "we" "e" sfolgseite "n") ; (StldwgSichern stldwg0 seite) ; (command "_dxfout" (strcat stldwg0 sseite) "V" "R12" "6") ; (setq y1 seitenanf) ; (setq y01 y1) ; (command "_erase" "_w" "18,270" "416,20" "") ; ) ; ) ; (if (and s (/= stk_nr1 "999")) ; (progn ; (y1234 y1) ; (command "_insert" "06GERZH1DXF" (list 20 y1) "1" "1" "0") ; ;(command "_insert" "06GERZH100" (list 21 y1) "1" "1" "0") ; (command menge "" stk_nr benennung typ "" hersteller htn) ; (F:FERTIG) ; (setq y1 (min y1 y2 y3 y4)) ; (setq y1 (- y1 (* zeilig zeilenvor))) ; ) ; ) ; ) ; (close f) ; (command "_open" "j" (getvar "dwgname")) ; (F:CMDon) ; (princ) ;) ;Stückliste zeichnen im Vickers-Format (defun vickers (zeilig) (F:CMDoff) (setq datei (findfile "c:/db-acad.dif")) (setq seitenanf 253.0) (if (= zeilig 1) (setq seitenende 40 zeilenvor 6 )) (if (= zeilig 2) (setq seitenende 44 zeilenvor 6 )) (command "farbe" "_blue") (command "stil" "simplex" "simplex" "2.5" "0.75" "0" "n" "n" "n") (LiesSfd) ;Schriftfeld ausfüllen (command "text" "134,12" "0" plan) (command "text" "21,11" "0" gez) (command "text" "21,16" "0" datum) (command "text" "z" "68,26" "0" kunde) (command "text" "z" "84,12" "0" mtyp) (command "text" "z" "84,6" "0" mtyp-fz) (command "text" "z" "26,24" "0" kundennr) ;Seiten zählen und max. Seitenzahl eintragen (setq seitemax (SeitenZaehlen seitenanf seitenende zeilenvor zeilig)) (command "stil" "simplex" "simplex" "2.0" "0.75" "0" "n" "n" "n") (command "text" "186,11.50" "0" seitemax) ;Stückliste erzeugen (setq f (open datei "r") seite 0 y1 seitenanf y01 y1 s " ") (while s (setq s (read-line f)) (if s (progn (zeile s) (setq stk_nr1 (substr (F:ATRIM stk_nr) 1 3)) (if (/= stk_nr1 "999") (progn (y1234 y1) (setq y01 (min y1 y2 y3 y4)) ) ) ) ) (if (or (not s) (<= y01 seitenende)) (progn (setq seite (1+ seite)) (command "text" "186,16.5" "0" seite) (if s ;neues Blatt beginnen (progn (setq ptbks (F:NPT (1+ seite))) (setq ptbks (trans ptbks 0 1)) ;Punkt in WKS uebertragen (command "bks" "u" ptbks) (command "_zoom" "_w" "*0,0" "408,287") ;Rahmen und Schriftfeld kopiern (command "_copy" "k" "*0,0" "*196,35" "e" "f" "*183,15" "*195,20" "" "*0,0" "0,0") (command "_zoom" "_w" "0,0" "408,287") ;zoomen auf A3-Groesse (setq y1 seitenanf) (setq y01 y1) ) ) ) ) (if (and s (/= stk_nr1 "999")) (progn (y1234 y1) (setq x 14.0 ptstk_nr (list x y1)) (setq x 30.0 ptbenennung (list x y1)) (setq x 74.0 pttyp (list x y1)) (setq x 138.0 ptmat_nr (list x y1)) (setq x 156.0 ptmenge (list x y1)) (setq x 166.0 pthersteller (list x y1)) (setq x 74.0 pthtn (list x y2)) (setq x 30.0 ptnorm (list x y2)) (setq x 74.0 pttext_2 (list x y3)) (setq x 74.0 pttext_3 (list x y4)) (ZeileZeichnen) (setq y1 (min y1 y2 y3 y4)) (setq y1 (- y1 (* zeilig zeilenvor))) ) ) ) (close f) ;(command "_open" "j" (getvar "dwgname")) (F:CMDon) )