Hallo,
das problem ist das ich nicht die deutschen commands kenne. sonst könnte ich die ja einfach ersetzenmir wurde noch der tipp gegeben doch einfach vor jeden command einen _ zu setzen. aber was ist wenn z.B. command "point" "0,0,0" dort steht? ich glaub ich geb auf........
...hier mal ein bischen wie das so aussieht:
; COMMAND:> MFIT
(vmon) : cause with dos you'll need it
(defun c:MFIT (/ etype dup index que omode ptype prtz part part# parts prt fp dnum XYZpts)
(setq serror *error* *error* merror)
(setq omode (getvar "osmode"))
(setvar "cmdecho" 0)
(setq part 0)
(initget 6)
(if div# (setq facet# (1- div#)) (setq facet# 10))
(setq dnum (strcat "\nNumber of facets <" (rtos facet# 2 0) ">: "))
(setq div# (getint dnum)) ; get facet number
(if div# (setq div# (1+ div#)) (setq div# (1+ facet#)))
(while part ; The big while for selecting entities
(if parts
(setq select (strcat "\nSelect object: " (rtos (length parts) 2 0) " selected\n"))
(setq select "\nSelect object: ")
)
(setq part (entsel select)) ; Select entity for inclusion
(setq prt (car part)) ; Take out entity name
(if part (chkpart)) ; See if it is usable
(if prtz T (setq prtz (list prt))) ; Start a prtz list
(if part
(if etype ; If not useable
(prompt (strcat ", Can't use " etype )) ; Say you're sorry
(progn
(if parts
(if (member prt prtz); see if already in list and ask if intentional
(progn
(prompt "(duplicate)")
(initget "D U")
(setq dup (getkword "\nDiscard/<Use>: "))
(if (= dup "D")
T
(progn
(setq parts (append parts (list part))) ; add part to list
(setq prtz (append prtz (list prt)))
)
)
)
(progn
(setq parts (append parts (list part))) ; add part to list
(setq prtz (append prtz (list prt)))
)
)
(setq parts (list part)) ; start list if not already created
)
)
)
)
; CRUM! Make sure the selection process is done
(if (= part nil)
(progn
(initget "C R U M")
(setq que (getkword "\nContinue/Restart/Undo 1/<Make>: "))
(cond
((= que "C") (setq part 0))
((= que "R") (restart))
((= que "U") (undo))
)
)
)
(if (= parts nil) (setq part 0)) ;This keeps the selection prompt correct
; Make sure they don't overload the 3dmesh command
(if (= (* div# (length parts)) 65536.0) ; check mesh size
(progn
(prompt "\nAmazing! You have reached mesh size limit")
(setq part nil)
)
)
) ;End of the big while
; Collect the points for the mesh
(prompt "\rCollecting points for mesh.")
(setq index 0)
(setvar "osmode" 0)
(setq part# (length parts))
(command "undo" "mark") ; set an undo mark
(command "point" "0,0,0") ; set a last entity
(command "layer" "m" "$$$3D$$$" "") ; create temp layer
(repeat part# ; divide all the parts
(setq part (nth index parts))
(setq prt (car part)
ptype (cdr (assoc 0 (entget prt)))
)
(cond
((= ptype "CIRCLE") (if cirdiv (divcir2) (divcir1)))
((= ptype "ARC") (divarc))
((or (= ptype "LINE") (= ptype "3DLINE")) (divline))
((= ptype "PLINE") (divpline))
((= ptype "POINT") (divpoint))
)
(setq index (1+ index))
) ; finish divides time to move on
;Be polite let them know what's going on.
(prompt "\nBuilding mesh list, please wait...")
(getpoints)
(command "undo" "back") ; Remove unnecessary points and layer
; Ok, let's build that mesh.
(command "3dmesh" part# div#) ; Start 3dmesh command
(setq pt# 0)
(repeat (length XYZpts)
(setq pt1 (nth pt# XYZpts)) ; pull out a point
(command pt1) ; send it to the mesh command
(setq pt# (1+ pt#)) ; move on
)
(setvar "cmdecho" 1)
(setvar "osmode" omode)
(Prompt "\nFinished !")
(princ)
)
für mich reines chinesisch.....
