方法是取外点线偏移1个单位,然后得到所有顶点,这在“修剪栅栏”中使用,我认为这会起作用,然后对内点线重复两次拾取,但仍然很快。只是需要一些时间。其他人以前也可能有。
一个正在进行的工作,它不工作,但我知道方法是这样做,因为我已经做了这一点,这是一位代码,我没有更多。
- ; pline co-ords example
- ; By Alan H
- (defun getcoords (ent)
- (vlax-safearray->list
- (vlax-variant-value
- (vlax-get-property
- (vlax-ename->vla-object ent)
- "Coordinates"
- )
- )
- )
- )
- (defun co-ords2xy ()
- ; convert now to a list of xy as co-ords are x y x y x y if 3d x y z x y z
- (setq len (length co-ords))
- (setq numb (/ len 2)) ; even and odd check required
- (setq I 0)
- (repeat numb
- (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords) ))
- ; odd (setq xy (list (nth i co-ords)(nth (+ I 1) co-ords)(nth (+ I 2) co-ords) ))
- (setq co-ordsxy (cons xy co-ordsxy))
- (setq I (+ I 2))
- )
- )
- ; program starts here
- (defun c:trmmer ( / co-ordsxy)
- (setq co-ords (getcoords (car (entsel "\nplease pick pline")))) ; chnage to offset one unit
- (co-ords2xy) ; list of 2d points making pline
- ; need to get this to work
- (command "trim" obj "" F co-ordsxy)
- )
|