这将让你追踪你已经拥有的线路,但是作为2条线路,你最多可以做16条线路,我从ASMI那里得到的
- ;; ============================================================ ;;
- ;; ;;
- ;; MPL.LSP - This lisp draws 2 - 16 polylines simultaneously ;;
- ;; ;;
- ;; ============================================================ ;;
- ;; ;;
- ;; Command(s) to call: MPL ;;
- ;; ;;
- ;; Instead standard options instead you can use the short ;;
- ;; options consisting of quantity of polylines (from 2 to 16) ;;
- ;; and justification (Top, Zero, Bottom). For example: ;;
- ;; ;;
- ;; Command: mpl ;;
- ;; <<< Quantity = 12, Justification = Top, Offset = 40 >>> ;;
- ;; Specify first point or [Quantity/Justification/Offset]: 6 ;;
- ;; <<< Quantity = 6, Justification = Top, Offset = 40 >>> ;;
- ;; ;;
- ;; Command: mpl ;;
- ;; <<< Quantity = 6, Justification = Top, Offset = 40 >>> ;;
- ;; Specify first point or [Quantity/Justification/Offset]: B ;;
- ;; <<< Quantity = 6, Justification = Bottom, Offset = 40 >>> ;;
- ;; ;;
- ;; Command: mpl ;;
- ;; <<< Quantity = 6, Justification = Top, Offset = 40 >>> ;;
- ;; Specify first point or [Quantity/Justification/Offset]: 16z ;;
- ;; <<< Quantity = 16, Justification = Zero, Offset = 40 >>> ;;
- ;; ;;
- ;; ============================================================ ;;
- ;; ;;
- ;; THIS PROGRAM AND PARTS OF IT MAY REPRODUCED BY ANY METHOD ;;
- ;; ON ANY MEDIUM FOR ANY REASON. YOU CAN USE OR MODIFY THIS ;;
- ;; PROGRAM OR PARTS OF IT ABSOLUTELY FREE. ;;
- ;; ;;
- ;; THIS PROGRAM PROVIDES THIS PROGRAM 'AS IS' WITH ALL FAULTS ;;
- ;; AND SPECIFICALLY DISCLAIMS ANY IMPLIED WARRANTY OF ;;
- ;; MERCHANTABILITY OR FITNESS FOR A PARTICULAR USE. ;;
- ;; ;;
- ;; ============================================================ ;;
- ;; ;;
- ;; V1.3, 12 May, 2005, Riga, Latvia ;;
- ;; © Aleksandr Smirnov (ASMI) ;;
- ;; For AutoCAD 2000 - 2008 (isn't tested in a next versions) ;;
- ;; ;;
- ;; [url]http://www.asmitools.com[/url] ;;
- ;; ;;
- ;; ============================================================ ;;
- (defun c:mpl(/ ptOpt oldQuont oldJust oldOff stPt mlName lastEnt
- firEnt lnSet oldEcho rLst *error*)
- (vl-load-com)
- (defun asmi-mlStyleCreate(Quont / dxfLst topOrd Count mlDict)
- (setq dxfLst
- (list'(0 . "MLINESTYLE")'(102 . "{ACAD_REACTORS")'(102 . "}")
- '(100 . "AcDbMlineStyle")(cons 2(strcat(itoa Quont)"_PLINES"))
- '(70 . 0)'(3 . "")'(62 . 256)'(51 . 1.5708)'(52 . 1.5708)
- (cons 71 Quont))
- Count 0.0
- topOrd(-(/ Quont 2.0) 0.5)
- ); end setq
- (repeat Quont
- (setq dxfLst(append dxfLst
- (list(cons 49(- topOrd Count))
- '(62 . 256) '(6 . "BYLAYER")))
- Count(1+ Count)
- );end setq
- ); end repeat
- (if
- (null
- (member
- (assoc 2 dxfLst)(dictsearch(namedobjdict)"ACAD_MLINESTYLE")))
- (progn
- (setq mlDict
- (cdr
- (assoc -1
- (dictsearch(namedobjdict)"ACAD_MLINESTYLE"))))
- (dictadd mlDict(cdr(assoc 2 dxfLst))(entmakex dxfLst))
- ); end progn
- ); end if
- (strcat(itoa Quont)"_PLINES")
- ); end of asmi-mlStyleCreate
- (defun asmi-LayersUnlock(/ restLst)
- (setq restLst '())
- (vlax-for lay(vla-get-Layers
- (vla-get-ActiveDocument
- (vlax-get-acad-object)))
- (setq restLst
- (append restLst
- (list
- (list lay (vla-get-Lock lay)
- ); end list
- ); end list
- ); end append
- ); end setq
- (vla-put-Lock lay :vlax-false)
- ); end vlax-for
- restLst
- ); end of asmi-LayersUnlock
- (defun asmi-LayersStateRestore(StateList)
- (foreach lay StateList
- (vla-put-Lock(car lay)(cadr lay))
- ); end foreach
- (princ)
- ); end of asmi-LayersStateRestore
- (defun ExplodeMline()
- (setvar "CMDECHO" 0)
- (if(or(not lastEnt)(not(equal lastEnt(entlast))))
- (setq lastEnt(entlast))
- (setq lastEnt nil)
- ); end if
- (if lastEnt
- (progn
- (setq rLst(asmi-LayersUnlock))
- (command "_.explode" lastEnt)
- (setq lnSet(ssadd))
- (ssadd
- (setq lastEnt
|