当然会,但他需要将系统变量peditacept编辑为0,然后运行overkill。
现在给他写一些noob代码。
编辑:
不需要代码,只要。
1.将Peditacept值更改为0
2.user Overkill命令,选择all(在我的例子中,只是为了清理整个图形)
3.正确放置矩形,因为图形中似乎有两个矩形。也许加入他们吧。
4、使用EXTRIM命令。
5、一些清理
6、完成。
我没有得到系统变量Peditaccept,Overkill在现有多段线上运行得很好。
但不要让我在你友善的Lisp程序时阻止你。 我使用SSX选择“SURVEY NO BOUNDARY”层上的所有对象。只要选中“优化多段线内的线段”,Overkill将修复现有多段线。正如埃尔登所说:“如果你先运行Overkill,那么Extrim就可以了。但它只会修剪穿过矩形的线。”这是修剪而不是擦除的常规。我使用擦除外部边界来修剪和擦除外部:
;| Function to trim objects inside selected boundaries (allows for multiple boundaries)
Boundaries can be "Circle, Ellipse, LWPolyline and Polyline" Entities
Written By: Peter Jamtgaard Copyright 2015 All Rights Reserved
^C^C^P(or C:BoundaryTrim (load "BoundaryTrim.lsp"));BoundaryTrim
EraseOutsideBoundary added by Tom Beauford
^C^C^P(or C:EraseOutsideBoundary (load "BoundaryTrim.lsp"));EraseOutsideBoundary
==============================================================================|;
;(defun C:BT ()(c:BoundaryTrim))
(defun C:BoundaryTrim (/ acDoc intCount ssBoundaries)
(if (setq ssBoundaries (ssget (list (cons 0 "Circle,Ellipse,LWPolyline,Polyline"))))
(progn
(vla-startundomark (setq acDoc (vla-get-activedocument (vlax-get-acad-object))))
(repeat (setq intCount (sslength ssBoundaries))
(setq intCount (1- intCount))
(BoundaryTrim (ssname ssBoundaries intCount))
(BoundaryWindowErase (ssname ssBoundaries intCount)); <-Erase objects inside boundary optional
)
)
)
(if acDoc (vla-endundomark acDoc))
)
; Command line function to select objects that are windowed by a selected circle.
(defun C:BoundarySelect (/ lstPoints objBoundary ssBoundary)
(if (and
(setq ssBoundary(ssget ":E:S" (list (cons 0 "Circle,Ellipse,LWPolyline,Polyline"))))
(setq objBoundary (vlax-ename->vla-object (ssname ssBoundary 0)))
(setq lstPoints (SegmentPoints objBoundary 360))
)
(and
(setq ssSelections (ssget "_WP" lstPoints))
)
)
)
; Function to trim linework inside a boundary entity
(defun BoundaryTrim (entBoundary1 / lstPoints entBoundary1 entBoundary2 lstCenter
lstPoints1 lstPoints2 objBoundary1 objBoundary2 ssBoundary *Error*)
(defun *Error* ()
(setvar "cmdecho" intCMDEcho)
)
(setq intCMDEcho (getvar "cmdecho"))
(setvar "cmdecho" 0)
(if (and
(setq objBoundary1(vlax-ename->vla-object entBoundary1))
(setq lstPoints1 (SegmentPoints objBoundary1 360))
(setq lstCenter (mapcar '(lambda (X)(/ (apply '+ X) (length lstPoints1)))(transposematrix lstPoints1)))
(vl-cmdf "offset" (/ (distance (car lstPoints1) lstCenter) 36.0) entBoundary1 lstCenter "")
(setq entBoundary2(entlast))
(setq objBoundary2(vlax-ename->vla-object entBoundary2))
(setq lstPoints2 (SegmentPoints objBoundary2 360))
)
(progn
(vl-cmdf "trim" entBoundary1 "" "f")
(foreach lstPoint lstPoints2 (vl-cmdf lstPoint))
(vl-cmdf "" "")
(entdel entBoundary2)
(vl-cmdf "redraw")
(setvar "cmdecho" intCMDEcho)
)
)
)
; Function to trim linework outside a boundary entity
(defun TrimOutsideBoundary (entBoundary1 / lstPoints entBoundary1 entBoundary2 lstCenter
maxpt lstPoints1 lstPoints2 objBoundary1 objBoundary2 ssBoundary *Error*)
(defun *Error* ()
(setvar "cmdecho" intCMDEcho)
)
(setq intCMDEcho (getvar "cmdecho"))
(setvar "cmdecho" 0)
(if (and
(setq objBoundary1(vlax-ename->vla-object entBoundary1))
(setq lstPoints1 (SegmentPoints objBoundary1 360))
(setq lstCenter (mapcar '(lambda (X)(/ (apply '+ X) (length lstPoints1)))(transposematrix lstPoints1)))
(setq maxpt (list (1+ (car (getvar 'extmax)))(1+ (cadr (getvar 'extmax)))(1+ (caddr (getvar 'extmax)))))
(vl-cmdf "offset" (/ (distance (car lstPoints1) lstCenter) 200.0) entBoundary1 maxpt "")
(setq entBoundary2(entlast))
(setq objBoundary2(vlax-ename->vla-object entBoundary2))
(setq lstPoints2 (SegmentPoints objBoundary2 360))
)
(progn
(vl-cmdf "trim" entBoundary1 "" "f")
(foreach lstPoint lstPoints2 (vl-cmdf lstPoint))
(vl-cmdf "" "")
(entdel entBoundary2)
(vl-cmdf "redraw")
(setvar "cmdecho" intCMDEcho)
)
)
)
; Function to erase linework inside a boundary entity
(defun BoundaryWindowErase (entBoundary / lstPoints objBoundary ssSelections)
(if (and
(setq objBoundary(vlax-ename->vla-object entBoundary))
(setq lstPoints (SegmentPoints objBoundary 360))
(setq ssSelections (ssget "_WP" lstPoints))
)
(and
(setq ssSelections (ssget "_WP" lstPoints))
(vl-cmdf "erase" ssSelections "")
)
)
)
; Function to determine the points along a curve dividing it intSegments number of times
(defun SegmentPoints (objCurve intSegments /sngSegment intCount lstPoint lstPoints sngLength sngSegment)
(if (and
(setq sngLength (vlax-curve-getdistatparam objCurve (vlax-curve-getendparam objCurve)))
(setq sngSegment(/ sngLength intSegments))
(setq intCount 0)
)
(progn
(repeat (1+ intSegments)
(setq lstPoint (vlax-curve-getpointatdist objCurve (* intCount sngSegment)))
(setq lstPoints(cons lstPoint lstPoints))
(setq intCount (1+ intCount))
)
lstPoints
)
)
)
; Function to Transpose a matrix
(defun TransposeMatrix (lstMatrix)
(if (car lstMatrix)
(cons (mapcar 'car lstMatrix)
(TransposeMatrix (mapcar 'cdr lstMatrix))
)
)
)
; Function to erase linework outside a boundary entity
(defun C:EraseOutsideBoundary ( / ss1 n ssBoundary objBoundary lstPoints ssSelections entSelection)
(vla-startundomark (setq acDoc (vla-get-activedocument (vlax-get-acad-object))))
(setq ss1 (ssget "_X" '((67 . 0)))n -1)
(if (and
(setq ssBoundary(ssget ":E:S" (list (cons 0 "Circle,Ellipse,LWPolyline,Polyline"))))
(setq entBoundary(ssname ssBoundary 0))
(ssdel entBoundary ss1)
(TrimOutsideBoundary entBoundary)
(setq objBoundary (vlax-ename->vla-object entBoundary))
(setq lstPoints (SegmentPoints objBoundary 360))
)
(and
(setq ssSelections (ssget "_CP" lstPoints))
(repeat (sslength ssSelections)
(setq entSelection (ssname ssSelections (setq n (1+ n))))
(if(ssmemb entSelection ssSelections)(ssdel entSelection ss1))
)
(command "erase" ss1 "")
)
)
(if acDoc (vla-endundomark acDoc))
)
CookieCutter2-ET extrim带来更多乐趣
外部轮廓删除
页:
1
[2]